nevalang / neva

🌊 Dataflow programming language with static types and implicit parallelism. Compiles to native code and Go
https://nevalang.org
MIT License
85 stars 7 forks source link

Do we really need group forms for entity declarations? #601

Closed emil14 closed 1 month ago

emil14 commented 1 month ago

Just like in Go we can define several type and const in one block. But, unlike Go we can also define several component (Go doesn't allow func blocks).

When I look at stuff like this

component {
  Foo(a) (b) {
    // ...
  }

  Bar(a) (b) {
    // ...
  }

  Baz(a) (b) {
    // ...
  }
}

It looks like this is a single component with several methods. In fact these are 3 different components but the keyword is component, not components.

Do we need these grouped forms declarations? If we should get rid of them, we should do it now. It will be harder to do later

Without:

component Foo(a) (b) {
  // ...
}

component Bar(a) (b) {
  // ...
}

component Baz(a) (b) {
  // ...
}
Catya3 commented 1 month ago

What you gain in factorizing component you lose in tab-levels. I will not find it that useful to use blocks except for const {}, maybe. I prefer renaming to comp to make it shorter.

emil14 commented 1 month ago

Done