logoalt Hacker News

userbinatortoday at 2:41 AM2 repliesview on HN

To be precise this is 1024 bytes of C, which compiles to a binary many times larger, and implements a very tiny subset of Python.

loops work by jumping backwards and reparsing the source each iteration

This is how the DOS .bat processing works; not sure if Unix-style shells are the same, as I've never had the need to exploit that "feature".

Another comment here has mentioned C4, but another extremely dense (and slightly larger, since it wasn't actually deliberately(!) "code-golfed") interpreter you may want to look at is the J Incunabulum:

https://www.jsoftware.com/ioj/iojATW.htm

More generally, the array programming culture seems to consider this level of density the norm:

https://news.ycombinator.com/item?id=45800777


Replies

shaknatoday at 5:50 AM

Bash lines are buffered, so modifying behind the program position doesn't really work, but you can self-append to the file to keep a script going infinitely.

maya335today at 6:08 AM

[flagged]