Skip to content
This repository has been archived by the owner on Dec 4, 2022. It is now read-only.
/ compy Public archive

[dormant] an experiment in making a compiler for teaching

License

Notifications You must be signed in to change notification settings

jeapostrophe/compy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

[dormant] an experiment in making a compiler for teaching

This is a little nano-pass compiler to experiment with teaching a compiler course in that style.

The 'langs' directory has the compilers for the various languages.

The 'asm' language is X86 assembly. I expect it to grow and grow as
the course goes on.

day0 just has single byte numbers.

day1 adds the basic operations of the CPU (arithmetic, logic, etc.)

day2 adds multiplication and division

day3 adds comparison operators

day4 adds if0

I haven't done any more yet, but I expect to add...

* explicit continuations in code
* CPS'd function calls with top-level functions
* add a CPS pass
* add a vector function (must learn OS malloc interaction)
* add list functions using vector as base
* implement closures
* implement type safety (dynamically and statically)
* implement call/cc
* implement function inlining
* ... ?

Grading ideas
* Turn in tests, organized by language and feature
* Manual review of if features are really tested by the test
* Compare their test behavior versus mine (to see if it is a valid test)
* Score is (passing/how many tests I had)
* You get 2 points for a test that crashes someone else's code
* You get nothing if any don't pass (of anyone's tests)

About

[dormant] an experiment in making a compiler for teaching

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

 
 
 

Languages