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?
Show HN: Buzz, strongly typed scripting language written in Zig
61–70 of 70 posts
Re: Show HN: Buzz, strongly typed scripting language written in Zig
#62Really the biggest distraction is that the static typing is lost between int and float with the catch-all num type. I think this will make it harder to program in, not easier (reasoning about where NaN, Inf, under/overflow, rounding etc might occur will depend on some choice it makes internally so as a programmer may need to give up and “assume the worst” everywhere!)
You can still keep it nice and easy and scripty with literals like 1 vs 1.0, and not worrying about number types other than signed Int64 and Float64.
Re: Show HN: Buzz, strongly typed scripting language written in Zig
#63I love the idea of a statically typed scripting language! Overall it seems pretty cool. Really the biggest distraction is that the static typing is lost between int and float with the catch-all num type. I think this will make it harder to program in, not easier (reasoning about where NaN, Inf, under/overflow, rounding etc might occur will depend on some choice it makes internally so as a programmer may need to give…
Re: Show HN: Buzz, strongly typed scripting language written in Zig
#64I love the idea of a statically typed scripting language! Overall it seems pretty cool. Really the biggest distraction is that the static typing is lost between int and float with the catch-all num type. I think this will make it harder to program in, not easier (reasoning about where NaN, Inf, under/overflow, rounding etc might occur will depend on some choice it makes internally so as a programmer may need to give…
Is there any difference between a statically typed scripting language and a statically typed compiled language that compiles in <.1s?
Re: Show HN: Buzz, strongly typed scripting language written in Zig
#65just for your information: the logo resembles islamic flags
Re: Show HN: Buzz, strongly typed scripting language written in Zig
#66- pipe for comments
- error handling via exceptions: I prefer monadic Result types a la Rust, exceptions obscure control flow and are try/catch us unnecessarily verbose
Re: Show HN: Buzz, strongly typed scripting language written in Zig
#67Earlier 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…
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 wi…
Re: Show HN: Buzz, strongly typed scripting language written in Zig
#68I love the idea of a statically typed scripting language! Overall it seems pretty cool. Really the biggest distraction is that the static typing is lost between int and float with the catch-all num type. I think this will make it harder to program in, not easier (reasoning about where NaN, Inf, under/overflow, rounding etc might occur will depend on some choice it makes internally so as a programmer may need to give…
Is there any difference between a statically typed scripting language and a statically typed compiled language that compiles in <.1s?
The main difference between a scripting language and a non-scripting language in my opinion is that a scripting language is called through a host program, which offers configuration and a standard library, while a non-scripting language runs by itself, using the operating system as its environment.
Re: Show HN: Buzz, strongly typed scripting language written in Zig
#69> object ... You already lost me there. ¯\_(ツ)_/¯ https://suzdalnitski.medium.com/oop-will-make-you-suffer-846...
They are more like structs with methods. There’s no inheritance only protocols (interfaces) you can conform to. Buzz is not an OOP language.
Re: Show HN: Buzz, strongly typed scripting language written in Zig
#70Earlier quoted context omitted.
Actually what made me not consider this a "real" scripting language is not any of those things but rather the existence of a non-optional entry point function. Scripting languages typically read code from top of file to bottom to decide what to execute
It’s really hard (impossible?) to have a type system with user defined types and do without a declarative top level.