effekt-lang / effekt-lang/effekt
Drop syntax differences between blocks vs values
- Dominant language
- Scala
- Stars
- 469
- Forks
- 41
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 23
Description
This is purely a stylistic difference, so this whole issue is just bikeshedding 😄
If you look at a type, you can already tell what category it comes from:
blocks:
- function type (`T => R`)
- interface type (user-defined usually, but `Region` is special and is in the compiler)
values:
- built-in value types (like `Int` or `Unit`)
- discriminated union (`type`)
- `record`
- a block type followed by `at captureSet`
There's thus no real reason why block types need different syntax. Unifying the syntax can help ease understanding (I struggled a bit initially getting used to it).
With #67, it might even be nice to have polymorphism that ranges over all types, not just specifically block or value ones. The function would have to treat such type as if it was a block type, but it can be instantiated with a value type if needed. This will also reduce the amount of `box`ing necessary.
Ironing out other differences between values and blocks is useful, too, like #1186.
The current braces-based syntax can still be left in for those who wish to be more explicit (and to keep old code compiling).
The ultimate vision would be to look more like Scala's capture checking. Scala doesn't really treat capabilities and other types differently in syntax, only in semantics (well, except that capabilities can show in capture sets).
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.