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/useable language though!
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.
I agree, not quite my preference in scripting languages. I prefer to be able to deal with numeric representation.
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 < 5.3) behaviour: everything is a double, and you only get 53 bits of integer precision (which is quite frustrating).
An alternative if you want
> simple and relatively high level
is to use decimals, at the cost of complicating the implementation.
No I mean as an actual type, instead of `num` juggling representation internally.
I definitely wouldn't break it out into int, long, float, double, and unsigned variants. That would be too low level for this kind of language.
https://hackage.haskell.org/package/base-4.17.0.0/docs/GHC-N...