
Implement a programming language in 7 lines - frankpinto
http://matt.might.net/articles/implementing-a-programming-language/
======
nickpsecurity
This one is a cheat because read does a lot of the work. I can tolerate
treating STDIN/OUT as black boxes because they often are. The Scheme
interpreter's functionality is what's custom. The read function is crucial to
it. So, it's implementation should be included. That puts this way over 7
lines.

The good news is that I now know where the name Y Combinator comes from. I
imagine it will take me a lot longer to wrap my head around that concept,
though. Truly weird haha.

~~~
duaneb
I do recommend learning the Y Combinator; it's the answer to the problem "How
do I have a recursive anonymous function?"

~~~
agumonkey
Beside the theoretical side of Y, what made it interesting to me was the few
tutorials on how one could derive it to stop an infinite expansion, which is a
feeling I often get when trying to solve a problem, creates another similar
problem only slightly different. Now I stop and try to find how to make bind
the tail to the dog's mouth.

------
segmondy
Implementing a programming language in a few lines has always been done.

Here is an example in prolog of such a meta interpreter.

    
    
        interpret(true):- !.
        interpret(GoalA, GoalB):- !,interpret(GoalA),interpret(GoalB).
        interpret(Goal):- clause(Goal, Body), interpret(Body).

------
drallison
Worth the read. Matt Might does really interesting things and explains what he
does well. His blog is worth checking out.

