3 ms·
Could you explain how Reason syntax isn't "really willing to modernize in ways that would attract your average programmer"? I'm trying to understand what do you
by debugnik 11mo ago
Could you explain how Reason syntax isn't "really willing to modernize in ways that would attract your average programmer"? I'm trying to understand what do you even mean.
- deleted 11mo ago[deleted]
- deleted 11mo ago[deleted]
- atombender 11mo agoReason still looks like an ML-style language rather than something from the C family of things (where JavaScript ultimately comes from). For example, in Reason, a function is: let x: (int, int) => int = (a, b) => a + b; A more JS-like syntax might be: fn x(a, b int): int { a + b } Or at least: let x = fn(a, b int): int { a + b }
- debugnik 11mo agoBut the Reason example you shared is almost valid TypeScript already! https://www.typescriptlang.org/play/?#code/DYUwLgBAHgXBAUBDOA7ArgWwEYgE4BoItVMdcBKCAXgD4J1s9qFFCtLaJEIBqIgbiA https://www.typescriptlang.org/play/?#code/DYUwLgBAHgXBAUBDO... I've seen JS using lambdas instead of classic functions like that in the wild. And that Reason can be made more JS-idiomatic without changes to the syntax: let x = (a: int, b: int): int => a + b;