
MiniPascal - ltcode
https://github.com/soegaard/minipascal
======
tonyjstark
It's always nice to see some Racket on HN. And it's even better to see some
Pascal (o the memories).

Can you elaborate why you chose a mini Pascal and the Readme mentions a Ragg
tutorial, do you have a link?

~~~
soegaard
The Ragg tutorial uses Brainfuck as an example of how to use "compile a
language by macros". The grammar of the input language is specified as BNF and
the output is a syntax object representing Racket forms. Syntax objects are
normally used in Racket to implement macros - and therefore there is an
extremely rich support for manipulating syntax objects builtin. Using this
machinery it is relatively simple to implement compilers using this
representation of programs.

Since Brainfuck is an artifical language, I thought I'd show how to compile a
"real" language using the same approach. My first idea was to look at Basic,
but I decided it would be more fun to pick a language with types.

Having read Jensen's book on compiling Pascal years ago (a must read if you
are interested in Pascal compilers) the choice fell on Pascal.

The Ragg tutorial:

[http://www.hashcollision.org/brainfudge/](http://www.hashcollision.org/brainfudge/)

