Skip to content

Latest commit

 

History

History
73 lines (43 loc) · 1.9 KB

eclectus.pod

File metadata and controls

73 lines (43 loc) · 1.9 KB

Eclectus

Eclectus aims to be a Scheme to PIR compiler implemented in Scheme. It is based on Abdulaziz Ghuloums compiler tutorial.

Design

Scheme code is compiled into a cons representing a Parrot Abstract Syntax Tree. This compilation is done with the help of riaxpander. This cons PAST is in the form of a S-XML data structure. The cons PAST is being emitted as NQP code. The emitted code is compiled to PIR and is being run with a PIR wrapper. Library functions are implemented in PIR.

There is a lot of room for improvements.

Status

Going through the tutorial.

Testing

Tests are written in Scheme. The test-driver is derived from the tutorial, tweaked to emit TAP.

Run individual test scripts with e.g.:

gosh -fcase-fold -I .  -I riaxpander -l gauche/prelude.scm t/scheme/unary_primitives.t

Or use the Perl-Wrapper for selecting the appropriate program and options.

perl eclectus.pl t/scheme/unary_primitives.t

As an intermediate result a PAST-Datastructure ist generated and saved as a file. This intermediate file can for example be executed with:

../../parrot driver_nqp.pbc t/unary_primitives_0.nqp

Dependencies

Test::Harness::Archive

TODO

- support for strings - support for pairs - support for 'letrec - allow test-description per test case - In the longterm, Eclectus should become self-hosting

AUTHOR

Bernhard Schmalhofer, Andreas Rottmann

SEE ALSO

http://en.wikipedia.org/wiki/Eclectus

http://www.perlfoundation.org/parrot/index.cgi?eclectus

http://www.cs.indiana.edu/%7Eaghuloum/compilers-tutorial-2006-09-16.pdf

http://scheme2006.cs.uchicago.edu/11-ghuloum.pdf

http://www.cs.indiana.edu/%7Eaghuloum/ikarus/index.html

http://www-pu.informatik.uni-tuebingen.de/users/sperber/info-i-9900/material/konstruktion/konstruktion-10.ps

http://okmij.org/ftp/Scheme/SXML.html

http://www.canonical.org/~kragen/sw/urscheme/