5 ms·
Congratulations, looks like a really nice language. One nitpick: I think "val" looks too much like "var" and this will make it harder do differentiate them by
by supercasio 6y ago
Congratulations, looks like a really nice language.
One nitpick: I think "val" looks too much like "var" and this will make it harder do differentiate them by code skimming. I suggest changing "val" to something like "const", or "fix", or "imm"...
- conradludgate 6y agoI find it interesting how there's so many ways now of describing mutable vs immutable. Rust: let vs let mut Swift: let vs var Js: const vs let Silk: val vs var I honestly get confused now. I started a new job working in go and I keep writing let everywhere
- zelphirkalt 6y agoThe only one of those, that does not indicate by name to me, that it is about mutability, is the on of Swift. I guess you could argue, that in math, when someone says "let x be 2", then x is constant. In the context of programming though, I am more familiar with the var and let in JS, which is not at all about mutability.
- The_rationalist 6y agoA decent LSP is able to detect avoidable var declarations and rewrite them as val on demand. So the visibility does not matter much, what matter the most is speed to rewrite from mutable to immutable. Also, Var val isn't new, it is used by Kotlin which is arguably the language with the most modern/uncluttered/beautiful syntax.
- overkalix 6y agoNever had this problem with Scala...
- half-kh-hacker 6y agoAnecdote: Kotlin uses val/var, but IntelliJ (the de-facto standard editor for Kotlin) will underline all mutable variables.
- tym0 6y agoIf you don't mutate them after initialisation.