3 ms·
It looks better, but hard to comprehend without looking into the original code. E.g. this line: inner path = do Generally speaking, improved syntax would
by culebron21 4y ago
It looks better, but hard to comprehend without looking into the original code. E.g. this line:
inner path = do
Generally speaking, improved syntax would have been great, but similar projects that existed 10-15 years ago failed to be adopted widely (CoffeeScript, HAML).
- haskman 4y agoWhy is that hard to comprehend? `do` starts a new block with sequencing semantics (so we don't need the `?` operators) in Haskell. CoffeeScript can actually be considered very successful, since it influenced the design of a lot of other language features we take for granted. Same can be said for HAML.
- culebron21 4y agoIt's similar to what you can do in Julia, but there you use this syntax only for one-liner functions. The problem with this function declaration is that you need read up to the '= do' combo in order to understand that you're in a function definition. A keyword in the beginning would make it much easier. I'd love to hear what features CoffeeScript made appear in other languages. JS did not take the syntax at all. I guess it's hard to tell whether generators and var-args came from CS or Python.
- haskman 4y agoOff the top of my head Coffeescript introduced the function arrow syntax to JS, as well as class based inheritence. Also you don't need to take my word for it, Brendan Eich, the creator of JS himself has said that CoffeeScript had a significant impact on his thoughts about the future of JavaScript (https://brendaneich.com/2011/05/my-jsconf-us-presentation/ https://brendaneich.com/2011/05/my-jsconf-us-presentation/).