Skip to content

A nanopass scheme compiler in scheme for x86.

Notifications You must be signed in to change notification settings

localchart/nanopass

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

94 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is a scheme compiler for my study.
It runs on OS X (Intel) only.

How to compile fib.

in gauche
> (load "./compiler.scm")
> (x86 (cg-top (code-generation-form (immediate-literal-form (assignmentless-form (analyzed-form (cps-form (core-form (local-form (macroless-form (append-library '(letrec ((fib (lambda (n) (if (= n 0) n (if (= n 1) n (+ (fib (- n 1)) (fib (- n 2)))))))) (fib 35)))))))))))))

a.out will be created.

References.

[1] Summer Scheme Workshop; Compiling Scheme, http://www.cs.indiana.edu/eip/compile/
[2] Ur-Scheme, http://www.canonical.org/~kragen/sw/urscheme/
[3] An Incremental Approach to Compiler Construction, http://www.cs.indiana.edu/~aghuloum/
[4] The 90 Minute Scheme to C compiler, http://www.iro.umontreal.ca/~boucherd/mslug/meetings/20041020/minutes-en.html
[5] scheme -> LLVM, http://www.ida.liu.se/~tobnu/scheme2llvm/

About

A nanopass scheme compiler in scheme for x86.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Scheme 88.7%
  • C 9.3%
  • Assembly 2.0%