Live data from Hacker News

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

github.com

11–20 of 70 posts

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

#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?

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

#12
post #7

Maybe I'm just old, but first thing I would look for in a strongly typed language is int vs float, but all I see here is num. Is a single numeric type expected for modern languages?

I'm not excluding the idea to allow the user to choose between the two. But the language must remain simple and relatively high level so I'm wary of going down that road.

Segmenting the two and performing conversions implicitly as necessary is fairly standard, the only thing that would be required is... exposing the current implicit behaviour.

Python, Ruby, or Lua do that. That's less "nonsense" than doing the same but hiding it from the user.

"num" also gives a false impression: before checking, I expected JS's (or Lua An alternative if you want

> simple and relatively high level

is to use decimals, at the cost of complicating the implementation.

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

#13
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?

The only language I've seen pipe used with comments (not line comments though) is Common Lisp:

  #|
    This is a multi-line comment
  #|
    And they can be nested because this is really just a reader macro
  |#
  |#

I don't think I've ever seen a standalone | for comments, especially since it's so often used as bitwise or logical or.

And here they use \ for bitwise or, and the word `or` for logical or.

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

#14
post #7

Maybe I'm just old, but first thing I would look for in a strongly typed language is int vs float, but all I see here is num. Is a single numeric type expected for modern languages?

I'm not excluding the idea to allow the user to choose between the two. But the language must remain simple and relatively high level so I'm wary of going down that road.

I think it's fine to not offer all unsigned/signed variations, but in languages like TypeScript I often miss this distinction. Even Python differentiates between int and float where it is relevant, for example when indexing arrays. Sometimes you just don't want to mix the two.

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

#15
post #7

Earlier quoted context omitted.

I'm not excluding the idea to allow the user to choose between the two. But the language must remain simple and relatively high level so I'm wary of going down that road.

Segmenting the two and performing conversions implicitly as necessary is fairly standard, the only thing that would be required is... exposing the current implicit behaviour. Python, Ruby, or Lua do that. That's less "nonsense" than doing the same but hiding it from the user. "num" also gives a false impression: before checking, I expected JS's (or Lua An alternative if you want > simple and relatively high level is…

Exposing how? If you mean documentation, Buzz as not yet its reference manual but it'll definitely be there.

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

#16
post #10
post #9

just for your information: the logo resembles islamic flags

I disagree, they usually have green or black. I don't recollect them using stars either.

> I disagree, they usually have green or black.

The logo is black, which seems to qualify as "green or black"?

Red and white are also very common (ottoman flag, turkey, tunisia).

> I don't recollect them using stars either.

"Star and crescent" has been common muslim iconography since the 14th century, and the ottoman empire (which introduced them).

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

#17
post #15

Earlier quoted context omitted.

Segmenting the two and performing conversions implicitly as necessary is fairly standard, the only thing that would be required is... exposing the current implicit behaviour. Python, Ruby, or Lua do that. That's less "nonsense" than doing the same but hiding it from the user. "num" also gives a false impression: before checking, I expected JS's (or Lua An alternative if you want > simple and relatively high level is…

Exposing how? If you mean documentation, Buzz as not yet its reference manual but it'll definitely be there.

> Exposing how? If you mean documentation

No I mean as an actual type, instead of `num` juggling representation internally.

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

#18
post #15

Earlier quoted context omitted.

Segmenting the two and performing conversions implicitly as necessary is fairly standard, the only thing that would be required is... exposing the current implicit behaviour. Python, Ruby, or Lua do that. That's less "nonsense" than doing the same but hiding it from the user. "num" also gives a false impression: before checking, I expected JS's (or Lua An alternative if you want > simple and relatively high level is…

Exposing how? If you mean documentation, Buzz as not yet its reference manual but it'll definitely be there.

Lua has the same strategy as Buzz around numbers see https://www.lua.org/manual/5.4/manual.html#2.1

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

#19
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…

Typing is technically a distinct concept from binary representation, it just happens to be a very useful concept for interpreting bits. If the set of valid operations is known at compile time with no exceptions, I'd call that strong typing regardless of whether the internal representation changes during execution.

The problem I do see with combining int and float is that it means that you always have to be careful with == on any pair of numbers, where a language that does distinguish between the two gives you a clue about when equality will work and when it won't.

But that's a flaw in the number type, not a weakness in the type system.

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

#20
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…

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)
Post reply on HN