views:

403

answers:

13

My college is going to start soon, but I want to do something in the remaining weeks :)

I've taken a course last semester about programming languages and I want to bring my knowledge into reality. What simple, elegant language can a junior programmer implement an interpreter for?

I don't mind if the language is very small or experimental.

+15  A: 

assembly

I'm not talking about compiling it to machine code. Just an interpreter.

We did it in first year, but the prof wrote the virtual machine, but you can still write it on your own.

hasen j
DaveE
+10  A: 

Lisp and/or Scheme. For pointers, read the code of IronLisp developed by Leppie.

Konrad Rudolph
For extra fun, implement them in scheme or lisp. I think we worked through that problem in my intro programming class...
Paul McMillan
Lisp is an abstract syntax tree already.
jrhicks
+5  A: 

lolcode, and brainfuck are both small and fairly simple-esque.

Ben S
+2  A: 

Design your own language, then attempt to implement it .. then bow down humbly before those that designed and implemented the likes of c++, Java, c sharp, etc..

but by all means do try! It's challenging and mostly fun!

lexu
A: 

You can pick any language but do interpreter only for subset of that language. This way you can start working with the language you're familiar with and don't need to spend time learning a new one.

Vadim
+2  A: 

Coming from an imperative (change-based) background (familiar to assembly, C, Pascal), one could try an adaption of brainfuck, because it's extremely easy to interpret.

This could be extended with little human-readable syntax to an assembly-like language and with some efforts become a little BASIC (or C).

Targeting a functional languages, a little LISP or lambda calculus is relatively easy. There are several implementations like IronLisp or the Write yourself a Scheme in 48 hours tutorial that show the way.

Dario
+2  A: 

FORTH

Pete Kirkham
+3  A: 

Wirth's Pascal is a classic language that's designed for easy parsing, has strict but simple semantics, and is often used as an exercise for parsing/compiler writing.

Pavel Minaev
A: 

PAL is the language we used in my compiler class. What is PAL? It's a subset of PASCAL silly!

Anyway, pascal is nice since everything is compile time.

Daniel Huckstep
+4  A: 

RPAL compiles down to lambda expressions, which can then be interpreted.

kwatford
I think this is what I am looking for :)
AraK
A: 

BASIC will be fairly.... well basic :). You can simply start by evaluating expressions. Even that is very satisfying when you are still in collage. Might I ask if which language do you plan to use?

Cem Kalyoncu
I am almost used to C++. I know little bit Scheme, Java
AraK
If you care to help us by writing an evaluator check http://sourceforge.net/projects/mathlibcpp or drop me an email to cemkalyoncu at gmail dot com.
Cem Kalyoncu
A: 

jasmin stack based assembly, and since you can decompile java down to its easy to write trivial test programs.

Krypes
+1  A: 

Several people have implemented variants of my stack-based language (Cat) in their spare time.

cdiggins