by giann · 4y ago · 0 comments
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.
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.