Question

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.

Was it helpful?

Solution

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

OTHER TIPS

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.

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

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

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!

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.

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.

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

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.

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.

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?

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top