问题
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.
回答1:
RPAL compiles down to lambda expressions, which can then be interpreted.
回答2:
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.
回答3:
Lisp and/or Scheme. For pointers, read the code of IronLisp developed by Leppie.
回答4:
lolcode, and brainfuck are both small and fairly simple-esque.
回答5:
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!
回答6:
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.
回答7:
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.
回答8:
FORTH
回答9:
Several people have implemented variants of my stack-based language (Cat) in their spare time.
回答10:
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.
回答11:
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.
回答12:
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?
回答13:
jasmin stack based assembly, and since you can decompile java down to its easy to write trivial test programs.
来源:https://stackoverflow.com/questions/1446065/what-language-can-a-junior-programmer-implement-an-interpreter-for-it