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

> non-expressions

I think "statements" is the usual term, with "sentences" being the general term which encompasses both (a "sentence" in this context is something recognized by your formal grammar).

Can your Lisp variant handle unrestricted continuations?



I must admit I have no idea what an unrestricted continuation is. I'm not an academic, just a guy writing a lisp on his spare time.

Here's what I'm doing with continuations:

At the bytecode level, call/cc is trivial to implement given my current design. All you need is the current instruction pointer, the current environment (environments right now are just immutable A-lists), and the current return pointer. But it's not obvious to me how to translate call/cc from the syntax to the bytecode.

Tail call elimination is the next thing I'm implementing, and unless there's something wrong with my design I haven't noticed yet, it won't be hard to do. Another step to take down that direction, though, is adding a pass transforming to continuation-passing style. I think this is going to be one of the last things I do, because I'd like to explore other optimizations so I can compare performance.


Where are the terms used like that? I've only seen statement used as "a thing you do", with expression "a thing that evaluates", and optional conversion in each direction.

I'm not sure what you mean by sentences being "recognized" by the grammar. Keep in mind that there are languages where only a series of 'statements' is allowed, no freestanding expressions.




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

Search: