Hacker News new | past | comments | ask | show | jobs | submit login
Combining Forth and Lisp
4 points by daly on May 18, 2023 | hide | past | favorite
In Jonesforth (https://raw.githubusercontent.com/nornagon/jonesforth/master/jonesforth.S) during the discussion of Indirect Threaded Code it is pointed out that words have a 'codeword' prefix. The codeword prefix is used to define the interpreter for the code, either a list of addresses of words or a direct pointer to assembly code.

Expanding on the idea, it is easy to define a third interpreter which interprets the embedded bytes as a lisp s-expression. The original lisp interpreter is about a single page long (see pp 70-71 https://www.softwarepreservation.org/projects/LISP/book/LISP%201.5%20Programmers%20Manual.pdf )

If you embed your FORTH language in a single LISP array you can use LISP to modify FORTH.

Gotta love these amazing languages.




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

Search: