Simple Interpreter Contest

I am proposing a MentalMasturbation-style contest for WikiZens that may actually result in something useful: a tiny interpreter that is easy to read and customize.

Create a simple-as-possible stand-alone C program that interprets a "scripting" language of some sort.

Interpreter points awarded for:

Resulting Scripting Language Factors:

WikiZens will grade the results which will be recorded in a format similar to the following:

 Factor 1: Fred:B+, John:C, Lisa:D+ (Names would be Wiki handles)
 Factor 2: Fred:A-, John:D+, Lisa:B
 Etc...
Of course somebody can re-score the totals using weightings of their choosing.

Personally, I'd lean toward something like TopsHomoiconicScriptingLanguage. Other things to consider include skipping stacks and recursion. Variations on ReversePolishNotation is also an interesting possibility. Keep in mind that most scripting uses involve strings far more often than math. Explicit function/subroutine parameters may not even be needed, but something at least like BASIC's "GOSUB" should probably be available.

--top

I'm lazy, so I'm going to submit someone else's work: http://howtowriteaprogram.blogspot.co.uk/2010/11/lisp-interpreter-in-90-lines-of-c.html

C only, you say? Not C++? Okay, how about: http://www.sonoma.edu/users/l/luvisi/sl3.c

Top, you aren't trying to get us to, er, do your homework for you, are you? I know you've sometimes expressed an interest in implementing your language designs, so you're not trying -- in a roundabout way -- to get us to show you how to do it, are you? If so, that's not a bad thing, but there are probably easier ways to learn language implementation.

I'm mostly just curious about the kinds of trade-offs people would make and why. If you don't wish to participate, you don't have to. Don't think about me, do what you feel like.


EditText of this page (last edited September 19, 2012) or FindPage with title or text search