A peek into my preparations for the courseProcessing Python Code; Producing Scheme Code.One page python parser in python. A (partial) python to scheme compiler, demonstrating high-level program analysis and generation. A design by PLT, presented at PyCon 2004. Parsing PrologOne page prolog parser in prolog. Parsing CParsing C++Pedagogical non-toy compilersHistorically the course doesn't study a real-world (i.e. used by others) compiler. The reasons, as well as the solution(s), are in the chart. Which one would you like to study? An Incremental Approach to Compiler Construction: teaches compilation of a non-toy language to x86. He then used the approach and scaled up to a production quality compiler. Chibi-Scheme is <10K lines of C, for a "very small but mostly complete R5RS Scheme implementation using a reasonably fast custom VM. Chibi-Scheme tries as much as possible not to trade its small size by cutting corners, and provides full continuations, both low and high-level hygienic macros based on syntactic-closures, string ports and exceptions. Chibi-Scheme is written in highly portable C and supports multiple VM instances to run simultaneously." Runtime interoperability; FFIsI'm not sure yet whether this fits with 488, 324, both or neither. It may be more appropriate for 209. In any case, Danny Heap is using PLT Scheme in 104 and was wondering about the 108/148/150 python library equivalents. So while we're looking at native ones, I made a quick proof of concept scripting CPython with PLT Scheme, so he can relax and assume at least access to all python libraries. If he ends up using any, I'll make him a very nice wrapper that completely hides the python (i.e. the 104 students will not even know there's any python going on, e.g. they'll call python library functions using scheme function call syntax, not passing python code strings). PLT FFI links. One. The other way around: embedding of scheme in python. General ParsersScheme code for language implementation. Semantics EngineeringTextsSome of what I'm readingUsing ParentheC to Transform Scheme Programs to C. Compiler Technology/Implementation Techniques and Optimization (and I've just emailed them to suggest adding the previous paper). |