Khaled Alshaya
Khaled Alshaya

Reputation: 96939

What language can a junior programmer implement an interpreter for it?

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.

Upvotes: 5

Views: 1367

Answers (13)

cdiggins
cdiggins

Reputation: 18263

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

Upvotes: 1

Krypes
Krypes

Reputation: 561

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

Upvotes: 0

Cem Kalyoncu
Cem Kalyoncu

Reputation: 14603

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?

Upvotes: 0

kenm
kenm

Reputation: 23995

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

Upvotes: 6

Daniel Huckstep
Daniel Huckstep

Reputation: 5408

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.

Upvotes: 0

Pavel Minaev
Pavel Minaev

Reputation: 101665

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.

Upvotes: 4

Pete Kirkham
Pete Kirkham

Reputation: 49331

FORTH

Upvotes: 2

Dario
Dario

Reputation: 49238

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.

Upvotes: 2

Vadim
Vadim

Reputation: 21724

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.

Upvotes: 0

lexu
lexu

Reputation: 8849

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!

Upvotes: 5

Ben S
Ben S

Reputation: 69412

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

Upvotes: 8

Konrad Rudolph
Konrad Rudolph

Reputation: 546213

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

Upvotes: 15

hasen
hasen

Reputation: 166402

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.

Upvotes: 16

Related Questions