# 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. Sinep Gupta says:

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. Bruce Elrick says:

What, pray tell, is an integer? Since no computer has infinite memory, no computer can represent all integers.

I’m not sure what purity you are going for.

1. PPJ says:

“no computer can represent all integers”
Not even half of them! So you can’t even call it half pure.

1. bebop says:

Considering the upper and lower bounds of the integer line, the number of integers that can be represented is close to zero.

1. Paul says:

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.

2. Sinep Gupta says:

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.

1. There is also a more compact representation, Church decimals, with church numbers only representing digits and numerals stored as lists of such digits.

2. The Commenter Formerly Known As Ren says:

“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.
B^)

1. cstmoore says:

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. make piece not war says:

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.

3. Wafna says:

Forth you love if honk then.

1. Charles Springer says:

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.

4. Greg A says:

wow what a trip

5. Funny. I was just talking with someone this week about how to interpret a Forth expression, and I used parentheses to group operators with operands, like a postfix version of Lisp. :)

6. william payne says:

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?

7. Don Golding says:

The thing about Forth, is you can build any language using it.

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.