3 ms·
What should I be looking for here that distinguishes it from other lightweight statically-typed scripting languages? Performance? Tooling? Particularly good FFI
by djur 3y ago
What should I be looking for here that distinguishes it from other lightweight statically-typed scripting languages? Performance? Tooling? Particularly good FFI?
There are some syntactic quirks that don't convey any obvious benefit, like the use of '>' to indicate a return type. Since this language uses C-style prefixed type identifiers, why not do that for functions as well? Alternately, why not use the much more common ':' or even '->'? The use of a doubled return type (`> str > int`) to indicate yields is obscure, and the fact that the second type is the yielded type is surprising (yields come before the final return, so I'd expect the types to be in the same order).
Similarly, I understand the mimetic quality of '[str]' for 'array of str', but '{str, int}' doesn't have the same ring since key/value pairs are separated by ':'.
Comments starting with '|' feels like pure quirk. I don't really mind quirk in a tiny language like this, but there's a point where "funny syntax" becomes a bigger takeaway from the documentation than any actual features.
- basro 3y agoWhat would be the other lightweight statically typed scripting languages? There really aren't many.
- Deukhoofd 3y agoI've used AngelScript in the past for some hobby projects, and had a lot of fun with it. https://www.angelcode.com/angelscript/ https://www.angelcode.com/angelscript/
- deleted 3y ago[deleted]
- cabalamat 3y ago> There are some syntactic quirks that don't convey any obvious benefit, like the use of '>' to indicate a return type. [...] why not use the much more common ':' or even '->'? Agreed. New languages should use similar conventions to popular existing languages, for the sake of familiarity, unless there are obvious benefits to doing something else. > Similarly, I understand the mimetic quality of '[str]' for 'array of str' It's quite Haskell-like. > but '{str, int}' doesn't have the same ring since key/value pairs are separated by ':'. Indeed. `{str:int}` would be better.
- choppsv1 3y agoRe: comment char: I couldn't agree more, went in excited by static typed, and was immediately turned off by this seemingly arbitrary divergence. I kept looking for other uses of, for example, `#` in the language that might explain this quirky comment char, but got to the end of the guide w/o finding any. Maybe the author will reconsider :)
- deafpolygon 3y ago> Comments starting with '|' feels like pure quirk. Yeah... | is a pipe (shell) or an "or" (programming) symbol. Seeing it in the code to indicate a comment just rubs me the wrong way. It's almost as if it was chosen just to be different.