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

I once wrote an interpreter in continuation-passing style, meaning every final line of a function called the next function in the interpreter, passing a continuation and error continuation on.

Such a program never returns until it finishes interpreting, and can make an unlimited number of such calls.

This is a bad idea without TCE.



Why couldn't the compiler inline the whole interpreter?


Because in the continuation-passing style, the functions-calling-functions are circular in many places, inlining would explode rather than halting.




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

Search: