bakery2k
Joined 10 years ago
Joined 10 years ago
Are other projects moving from Lua (or other embedded scripting languages) to WebAssembly? What are the benefits of compiling an extension to WASM rather than writing it in Lua?
I think that's the point. A lot of people bought a PS2 because it was also a DVD player (same with the PS3 and Blu-ray).
Surely a faster VM, or even an ahead-of-time compiler, would be possible if we give up on some dynamism? Is that a direction the community should take?
(I think Guido's answer would be no, based on his apparent dislike of existing "Python compiler" projects such as Nuitka.)
Python doesn't support overloading, and it doesn't support optional arguments before required ones, so the actual implementation in Python is a bit messy - something like:
def range(start_or_stop, optional_stop=None):
if optional_stop is None:
start = 0
stop = start_or_stop
else:
start = start_or_stop
stop = optional_stop
...Wren therefore allows overloads such as `range(stop)` and `range(start, stop)`. This is more intuitive than Python's `range(start=0, stop)`, which might be the only function in the language that has an optional parameter before a required one.
Is this any worse than using `+` for floating-point addition, which isn't even associative?