Live data from Hacker News

Buzz: A lightweight statically typed scripting language

buzz-lang.dev

41–50 of 91 posts

Re: Buzz: A lightweight statically typed scripting language

#41
I have seen a few comments expressing a desire for a statically typed scripting language. I’ve been using a new workflow for a couple of years I’d like to share.

Install .NET 8, and create a new C# Console application. From .NET 6 onwards, it uses the new “top level statements” style which is effectively like the blank slate of a script file. The barrier to entry has never been lower. (https://learn.microsoft.com/en-us/dotnet/core/tutorials/top-...)

This lets you take advantage of a really healthy toolchain/package manager ecosystem.

You can take this a step further by using VS Code with the Polyglot Notebooks extension to get a Jupyter-style experience with C# code. (https://marketplace.visualstudio.com/items?itemName=ms-dotne...)

Re: Buzz: A lightweight statically typed scripting language

#42

What makes a language a "scripting" one?

For me it's when it's useful for writing adhoc utility tools distributed as source, and directly runnable from source code in the terminal and without requiring a manual compilation step (but maybe requiring installing a runtime).

E.g. Python, JS/TS with node.js/deno, Lua, Bash, Powershell qualify as scripting language, but C, C++, Rust are not.

Of course there's a grey area of compilers which allow compiling and running a "script" via shebang.

Re: Buzz: A lightweight statically typed scripting language

#43

FYI, for the interested, https://github.com/buzz-language/buzz/issues/209 > You have to use the nightly build of zig. ie. `brew install zig && zig build` will not work.

ZVM (https://github.com/tristanisham/zvm) is a good alternative to keep uptodate with Zig nightly versions and also quickly switch to a stable version when needed.

Re: Buzz: A lightweight statically typed scripting language

#44

Not explicitly mentioned in the guide, but Buzz has a garbage collector [1] (can also be inferred via a casual mention of upvalues). So it has more focus on scripting than static typing I guess, but the language design doesn't look so to me. [1] https://buzz-lang.dev/reference/std/gc.html

Static typing is orthogonal to scripting or GC.

Yes, but "statically typed scripting language" is a quite unusual combination of words [1], and there seemed nothing to back up the "scripting" concept, so I thought it might be something more akin to Nim or Zig (i.e. "scripty system programming"), and it wasn't. That was a missing line of thought that I should have explicitly stated, sorry for the confusion.

[1] Especially when no type inference was mentioned.

Re: Buzz: A lightweight statically typed scripting language

#45

I mean this looks awesome and all but I feel like constantly developing/learning new languages and frameworks has been such a giant waste of resources in our community in general. I hope things stabilize in the future. I've got 15 professional years under my belt at this point and I don't feel like an expert in anything.

I think the only reason why there was a temporary "language bottleneck" in the late 90s and early 2000s was that CPUs got too complex around that time to deal with the resulting code generation complexities in a "homebrew compiler". LLVM and later projects like Cranelift changed that, and now it's possible again for individuals and small teams to create new languages which have competitive performance. In my book that's great, competition and experimentation is always a good thing for progress (even when it means there's also many more hobby projects that won't move the needle).

Re: Buzz: A lightweight statically typed scripting language

#46
post #20

Fun! I’m always on the lookout for a new scripting language. I hate Bash, and Python just isn’t my style, even though it’s currently my default. Something like Kotlin would be my dream, but that’s still pretty hard to use for quick scripts. Going to look closely at this.

If you are interested in writing down more of what problems you have with scripting languages, feel free to shout me an email. Should be in profile.

I have been slowly working on a model of what problems i see in this domain and my own ideas to "fix" (or more like try to) them. So would love to see other perspectives.

Re: Buzz: A lightweight statically typed scripting language

#47

Earlier quoted context omitted.

If you need Lua but also type-safety, how about Luau [1] then? [1] https://luau-lang.org/

Wow, this looks great. With gradual typing too! Helps slowly port existing Lua projects over. Thanks for linking to this.

You might find https://nelua.io interesting.

Re: Buzz: A lightweight statically typed scripting language

#48
post #35
post #32

Earlier quoted context omitted.

There have been statically types scripting languages for ages. Embeddable ones, too. That's not new.

Any in particular that you're a fan of? (Genuinely curious)

NimScript comes to my mind. You get most of the Nim language, which is statically typed and versatile. But NimScript is interpreted immediately, like running a Python script, instead of compiled to an optimised binary like regular Nim.

Re: Buzz: A lightweight statically typed scripting language

#49

Honestly, except for some of the syntactic quirks, this looks fabulous. I definitely think there's a need and space for type-safe embeddable scripting languages like this. Lua usually dominates this space but the lack of type-safety always kept me from adopting it wholeheartedly. With Zig also in the picture, I can totally imagine an ecosystem that uses something like Buzz for scripting the high level parts of an app…

If you need Lua but also type-safety, how about Luau [1] then? [1] https://luau-lang.org/

There’s also Teal, a typed dialect in Lua, written in plain Lua: https://github.com/teal-language/tl

Re: Buzz: A lightweight statically typed scripting language

#50
post #38

I admire people who make projects like this. But it is so alien to me to try making something like a language. What is the motivation, and the goal? Surely it is practically a one-in-a-million chance to actually unseat Python or bash or Lua. I could never really justify using something like Buzz in a professional setting, just because it is too obscure and new. And look - if it is just for the joy of it, I get it! Bu…

It’s surprisingly easy to write an interpreted language and I’d highly recommend it as a learning tool. You get a really good intuitive sense of how programming languages work by doing it.

Especially if you are happy with the parent language’s semantics around arithmetic and basic types.
Post reply on HN