|
|
|
|
|
by naasking
3764 days ago
|
|
Interesting language, and looks fairly concise to write. I imagine shoehorning all numbers into doubles makes for slower integer code. Also a shame you included pervasive null. Wren looks straightforward enough that you could have a static type system without losing any expressiveness. Have you considered that? |
|
Maybe, though in a bytecode-compiled, dynamically typed language, my hunch is that using doubles for everything is actually faster. If I had separate integer and float types, all of the arithmetic operators would have do runtime type tests to handle the different combinations and conversions.
I could be wrong, though. Either way, only having doubles definitely simplifies the VM.
> Also a shame you included pervasive null.
Yeah, it doesn't come up too often in practice. Unlike, say, JS, Wren considers it a runtime error to call a function without enough arguments. I'm not a big fan of null, but in a dynamically typed language it's sort of inevitable. It's the result type of a function with no explicit return.
> Wren looks straightforward enough that you could have a static type system without losing any expressiveness. Have you considered that?
Yes! I'm interested in trying to layer an optional type system on top of it, and I tried to design most of the language and core library such that it's amenable to that.
However, designing a type system is really hard, so I don't know how well it'll pan out. Now that the language itself is pretty far along and you can write useful programs in it, I'm hoping to start tinkering with this and see what I can come up with.
You can see the first baby steps here:
https://github.com/munificent/wrenalyzer