Re:WebAssembly Tail Calls
by vbezhenar on Friday April 07, 2023 @01:37AM
(#35478410)
To add to other reasons, my opinion is: Webassembly right now is an extremely easy target for compilation. You can create your own compiler absolutely easily and get plenty of V8 optimizations for free. It's like LLVM, but probably much more accessible for hobby projects. You just parse text, build AST and dump AST to WebAssembly.
If WebAssembly would implement tail calls, implementing them in an original language requires zero efforts, they would just work.
But implementing tail calls using some kind of optimization, like function rewrite to loop is far from easy.
So my personal hope is that Webassembly would include features that are possible but very hard to develop in a hobby project. GC is another example. Even primitive toy GC is a serious project.
If WebAssembly would implement tail calls, implementing them in an original language requires zero efforts, they would just work.
But implementing tail calls using some kind of optimization, like function rewrite to loop is far from easy.
So my personal hope is that Webassembly would include features that are possible but very hard to develop in a hobby project. GC is another example. Even primitive toy GC is a serious project.