7 lines of code, 3 minutes: Implement a programming language (2010)
32 points by azhenley 3 hours ago | 5 comments

voidUpdate 11 minutes ago
> "If you've programmed in JavaScript, this form is equivalent to: function (v) { return e ; } "

function (v) { return e ; } -> Uncaught SyntaxError: Function statements require a function name

function a (v) { return e ; } a() -> Uncaught ReferenceError: e is not defined

Am I missing something?

reply
emigre 2 minutes ago
It's meant as an example. The function receives something, which we call v, and returns something else, which we call e. It's not meant to be taken literally as the variable names - otherwise, you are right, e is undefined in that example.
reply
utopiah 41 minutes ago
IMHO this and building an ALU with LEDs and logic gates should be part of ... well honestly any curriculum, even if you don't want to be study CS. Only doing that once in your life is enough to understand you could do it.

It was a "nerd" exploration few decades ago but nowadays so many of the things we do, from buying croissant to voting, is based on hardware and software. People should have a sense that yes it's complex but it's also NOT magic.

reply
RandomTeaParty 22 minutes ago
"Implement lambda calculus in languages that are pretty much lambda calculus"

How large would implementation be in more usual languages?

reply
bjoli 2 hours ago
I think it is a lovely experience just because it forces you to think about which abstractions are the correct ones. I think many people have had the feeling that they would love to change one (or many) aspects of a programming language.

I have been playing with an s-expr based language that compiles to f sharp, and it has made me realize how much I think Rich Hickey made some very lovely choices for clojure. I have never written clojure more than just for fun, but the more in think about my own toy language, the more highly I think of Rich Hickey. Many times because of the choices he made, but even more because of how he compromised to be able to interop with java.

reply