Re:Buzz: A lightweight statically typed scripting language
by basro on Wednesday December 27, 2023 @05:01AM
(#38780563)
What would be the other lightweight statically typed scripting languages? There really aren't many.
Re:Buzz: A lightweight statically typed scripting language
by Deukhoofd on Wednesday December 27, 2023 @11:06AM
(#38783295)
I've used AngelScript in the past for some hobby projects, and had a lot of fun with it.
Re:Buzz: A lightweight statically typed scripting language
by tom_ on Wednesday December 27, 2023 @12:03PM
(#38783948)
There's also daScript: https://dascript.org - have yet to use it though.
Re:Buzz: A lightweight statically typed scripting language
by cabalamat on Wednesday December 27, 2023 @05:08AM
(#38780598)
> 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.
Re:Buzz: A lightweight statically typed scripting language
by choppsv1 on Wednesday December 27, 2023 @09:20AM
(#38782125)
Re: 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 :)
Re:Buzz: A lightweight statically typed scripting language
by deafpolygon on Thursday December 28, 2023 @12:28PM
(#38795866)
> 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.
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.