Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Tails calls can be easily replaceable by br or loop instructions, nothing special for anyone with compiler design knowledge.


That's true as far as it goes - but wasm lacks general "goto" instructions (across procedures), and loops only work for self-tail-calls.

There's an expressiveness gap between languages with and without proper tail calls. (Unless you're willing to accept the unsafe-for-space solution.)


I think it would still be possible to implement Scheme with the current specification, which is on my snowy weekends to do list for the upcoming Winter.

How far I would get before losing interest or facing those issues, I don't know.


It's possible, yes, but it isn't possible to do particularly efficiently. If you want separate compilation, it gets even worse. (Separate compilation is where proper tail calls come in very handy.)


Ah you got a point there, forgot about separate compilation.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: