Live data from Hacker News

Show HN: Buzz, strongly typed scripting language written in Zig

github.com

31–40 of 70 posts

Re: Show HN: Buzz, strongly typed scripting language written in Zig

#31
post #20
post #8

Earlier quoted context omitted.

Makes sense, and I guess it’s semantics, but if the language/interpreter is handling which numeric types to use for me, should it really be sold as “strongly typed” in the main tagline for the language? Internally, float and int are completely different types, 2’s compliment vs ieee754. Conglomerating them to a “number” feels like weak typing. (Disclaimer: I’m a grumpy C++ engineer.) Edit: it does look like a neat/us…

Those are representations, not types. I think they are using the "what can I do with this" definition of type, which is just its public API, and nominality (walks like a duck, quacks like a duck, doesn't mean it's a duck)

They are not ducks, they are two different animals, even if you disregard binary representation.

Re: Show HN: Buzz, strongly typed scripting language written in Zig

#33
post #8
post #4

Earlier quoted context omitted.

I think it's more to do with it being a scripting language. Scripting languages are designed to be quick and easy to write, so instead of having to deal with int/float etc, the language can do it for you.

Makes sense, and I guess it’s semantics, but if the language/interpreter is handling which numeric types to use for me, should it really be sold as “strongly typed” in the main tagline for the language? Internally, float and int are completely different types, 2’s compliment vs ieee754. Conglomerating them to a “number” feels like weak typing. (Disclaimer: I’m a grumpy C++ engineer.) Edit: it does look like a neat/us…

It may be strong typing, and there are just no ints. This is how JavaScript works: all numbers are f64.

Re: Show HN: Buzz, strongly typed scripting language written in Zig

#34
post #11

Love it! The only thing that was a “meh” for me was using pipe for comments. It’s the only thing that I found to be unintuitive, which I very much like to see whenever I’m looking at a new language.

Do any other languages use it for comments?

[deleted]

Re: Show HN: Buzz, strongly typed scripting language written in Zig

#35
post #8

Earlier quoted context omitted.

Makes sense, and I guess it’s semantics, but if the language/interpreter is handling which numeric types to use for me, should it really be sold as “strongly typed” in the main tagline for the language? Internally, float and int are completely different types, 2’s compliment vs ieee754. Conglomerating them to a “number” feels like weak typing. (Disclaimer: I’m a grumpy C++ engineer.) Edit: it does look like a neat/us…

It may be strong typing, and there are just no ints. This is how JavaScript works: all numbers are f64.

Then what is: 1 << 33

Re: Show HN: Buzz, strongly typed scripting language written in Zig

#37
Are there any practical advantages to using Zig vs anything else? Presumably, the cross compilation means this should run everywhere for free, but would love to know if there was anything especially easy/hard with respect to the host language.

Re: Show HN: Buzz, strongly typed scripting language written in Zig

#38

Earlier quoted context omitted.

It may be strong typing, and there are just no ints. This is how JavaScript works: all numbers are f64.

Then what is: 1 << 33

Hmm... it's 2. It seems that the bitwise operators do indeed convert numbers into 32 bit integers (truncating any decimal parts) before applying their operation.

Re: Show HN: Buzz, strongly typed scripting language written in Zig

#39
Curious what the author is thinking of when calling this a "scripting language"? I personally don't have much trouble imagining a strongly-typed scripting language, but that definitely goes against the flow of the past couple of decades. Is it that it is garbage collected? That's about all I can see that would make this immediately obviously a "scripting language". It doesn't seem like it ought to be intrinsically as slow as what usually gets called a "scripting language".

To be clear, this is an honest question, and possibly something the author should consider answering, intended as feedback, not a criticism. I'm open to it. I'm also curious and I'm sure I'm not the only one. (Either way I definitely would suggest mentioning if it's garbage collected or not. It's an important point.)

Re: Show HN: Buzz, strongly typed scripting language written in Zig

#40
post #39

Curious what the author is thinking of when calling this a "scripting language"? I personally don't have much trouble imagining a strongly-typed scripting language, but that definitely goes against the flow of the past couple of decades. Is it that it is garbage collected? That's about all I can see that would make this immediately obviously a "scripting language". It doesn't seem like it ought to be intrinsically as…

Author here. A few points make buzz a “scripting language” in my view: - runs in a VM - garbage collected - high level - “simple” meaning there’s only a handful of concepts to understand to use it

It’s true that we’re not used to scripting languages having a type system. But its a trend that is catching on: python has types, php too and typescript is at its peak in popularity to name a few.

Post reply on HN