buzz, A small statically typed scripting language 👨‍🚀 (buzz-lang.dev)
from armchair_progamer@programming.dev to programming_languages@programming.dev on 17 May 2024 02:34
https://programming.dev/post/14193794

From the README on GitHub:

buzz code example

The compiler is written in Zig.

v4.0 Release Notes

#programming_languages

threaded - newest

zemja@programming.dev on 17 May 2024 12:09 next collapse

Is the name “Fizz” already taken?

FizzyOrange@programming.dev on 17 May 2024 17:13 collapse

Very neat! Is it embeddable? There are plenty of statically typed languages but there are hardly any statically typed embeddable languages.

Quite a lot to like here. I only skimmed it but some things that seem like slightly odd choices:

  • > instead of -> for return types. The latter is pretty clearly nicer IMO and less confusing.
  • Old C-style type name instead of name: type. The latter is less confusing and plays better with type inference and inlay hints. Easier to parse too.
  • For a small language I think arbitrary sized integers make way more sense than fixed size. This is one of the few things Python got completely right IMO. If you care about performance you can add a range type, like range(0…256) and unsigned like range(0…) and then use flow typing to convert between them.
armchair_progamer@programming.dev on 18 May 2024 01:40 collapse

Author’s comment on lobste.rs:

Yes it’s embeddable. There’s a C ABI compatible API similar to what lua provides.