logoalt Hacker News

anitiltoday at 12:39 AM1 replyview on HN

This is really cool! It's so fun to see what you can achieve and what's optional. I have seen the 'single character variable' limitation in some other minilangs before, but using the source itself as the target of function calls and loops is new to me. It does make a lot of sense but I wouldn't have thought of that.


Replies

userbinatortoday at 2:48 AM

but using the source itself as the target of function calls and loops is new to me

This was standard practice on interpreters for 8-bit microcomputers; with only a 64K total address space, creating an AST first seems immensely wasteful, so you interpret from the source directly.

I believe shells still do this when you run shell scripts; I know the DOS COMMAND.COM definitely does.