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.
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.
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.
“no computer can represent all integers”
Not even half of them! So you can’t even call it half pure.
Considering the upper and lower bounds of the integer line, the number of integers that can be represented is close to zero.
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.
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.
There is also a more compact representation, Church decimals, with church numbers only representing digits and numerals stored as lists of such digits.
“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^)
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.
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.
Forth you love if honk then.
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.
wow what a trip
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. :)
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?
The thing about Forth, is you can build any language using it.