Forsp: A Forth & Lisp Hybrid Lambda Calculus Language

In the world of lambda calculus programming languages there are many ways to express the terms, which is why we ended up with such an amazing range of programming languages, even if most trace their roots back to ALGOL. Of the more unique (and practical) languages, Lisp and Forth probably range near the top, but what if you were to smudge both together? That’s what [xorvoid] did and it resulted in the gracefully titled Forsp programming language. Unsurprisingly it got a very warm and enthusiastic reception over at Hacker News.

While keeping much of Lisp-isms, the Forth part consists primarily out of it being very small and easy to implement, as demonstrated by the C-based reference implementation. It also features a Forth-like value/operand stack and function application. Also interesting is Forsp using call-by-push-value (CBPV), which is quite different from call-by-value (CBV) and call-by-name (CBN), which may give some advantages if you can wrap your mind around the concept.

Even if practicality is debatable, Forsp is another delightful addition to the list of interesting lambda calculus demonstrations which show that the field is anything but static or boring.

16 thoughts on “Forsp: A Forth & Lisp Hybrid Lambda Calculus Language

  1. While I find it adorable, I don’t consider it a pure implementation of lambda calculus because in the end it must operate on CPU that’s using on integer-based ALU instead of pure lambda expressions.

          1. Compared to infinity, the number of integers that can be represented by any computer is zero.

            Also, at the same time, the number of integers that can be represented by a computer is close enough to infinity for most practical purposes.

            Still trying to wrap my had around practical lambda calculus though.

      1. I’m speaking about pure lambda calculus where everything, including numbers and mathematical operations is represented as a function. There is a variant called typed lambda calculus but from mathematical point of view it’s not pure as it includes support for things like mathematical operations contained in what is pretty much a black-box ALU and to free variables held in CPU registers or RAM – again, dependency on black-box made by Intel, AMD or in case of RAM – HyperX.

  2. “but what if you were to smudge both together”

    [Maya] you’re probably too young to remember when the 4th and 5th largest computer companies (Sperry and Burroughs) merged and became the 9th largest computer company.

    1. Unisys.

      My best friend was working at Sperry when the merger happened. I remember him telling me that a little while after the merger some posters of Sylvester the Cat appeared with the caption “Unithith!” Management was not pleased.

    2. Imagine what would happened if the last two computer companie from the list merged. It would double the list of computer companies. Sure, the list would be sparse, but this only would welcomed new computer companies to emerge.

    1. The old bumper sticker was first line FORTH (red heart symbol), second line IF HONK THEN

      One could see many confused faces at stop lights in the rear view mirror.

  3. Install of a small interactive single task OS on any micro/nano computer which
    1 writes to an external monitor.
    2 Reads from an external keyboard
    3 reads and writes from external disk file system
    are initial steps to make that micro/nano computer ready to install more
    more complicated, yet simple, certifiable simple OS such as fig Forth or Intel
    MCS BASIC-52?

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.