Skip to content
Find file History
Latest commit f91be07 Jul 18, 2014 @namin update link to petite chez scheme
old link with ubuntu-specific installation is now dead, so just link to petite chez scheme download section
..
Failed to load latest commit information.
README.md update link to petite chez scheme Jul 18, 2014
compiler.scm Remove extra skip after return address marker on stack. Jan 13, 2012
cps.scm
ctest.c
ctest.sh back to 32bit Dec 22, 2011
lib.scm Implemented optional arguments. Jan 2, 2012
scheme_entry.h Pass in a memory struct instead of the heap directly. Jan 8, 2012
startup.c Remove extra skip after return address marker on stack. Jan 13, 2012
startup.h GC-friendly representation of closures. Jan 9, 2012
tests-1.1-req.scm
tests-1.2-req.scm
tests-1.3-req.scm Fixed fxzero?, which used to only compared lower bits. e.g. (fxzero? … Dec 18, 2011
tests-1.4-req.scm 1.7 Procedures: all 1.7 tests pass. Dec 18, 2011
tests-1.5-req.scm 1.7 Procedures: all 1.7 tests pass. Dec 18, 2011
tests-1.6-opt.scm
tests-1.6-req.scm 1.1 Integers Dec 15, 2011
tests-1.7-req.scm Closures :-) All 2.1 tests pass. Dec 20, 2011
tests-1.8-req.scm Fixed fxzero?, which used to only compared lower bits. e.g. (fxzero? … Dec 18, 2011
tests-1.9-req.scm Debugged stack. Completed all sections discussed in the draft tutorial. Dec 19, 2011
tests-1.9.1-req.scm 1.9 Heap Allocation, ex2: vectors. Big vectors do not work, but all t… Dec 19, 2011
tests-1.9.2-req.scm more safer primitives + fixed a wrong bound in a provided vector-set … Jan 1, 2012
tests-1.9.3-req.scm
tests-2.1-req.scm
tests-2.2-req.scm 1.1 Integers Dec 14, 2011
tests-2.3-req.scm
tests-2.4-req.scm
tests-2.4.1-req.scm set! + refactoring into multiple conversions. Dec 21, 2011
tests-2.4.2-req.scm syntactic sugar for and, or, when, unless Dec 21, 2011
tests-2.6-req.scm 1.1 Integers Dec 14, 2011
tests-2.8-req.scm 1.1 Integers Dec 14, 2011
tests-2.9-req.scm free ecx and instead, use esi to backup registers, so that it is pres… Dec 30, 2011
tests-3.1-req.scm
tests-3.2-req.scm
tests-3.3-req.scm 1.1 Integers Dec 14, 2011
tests-3.4-req.scm
tests-4.1-req.scm
tests-4.1.1-req.scm
tests-4.1.2-req.scm split 4.1 tests into multiple files Dec 31, 2011
tests-4.1.3-req.scm split 4.1 tests into multiple files Dec 31, 2011
tests-4.2-req.scm macro expand inner defines using letrec Jan 1, 2012
tests-4.2.1-req.scm macro expand inner defines using letrec Jan 1, 2012
tests-4.2.2-req.scm macro expand inner defines using letrec Jan 1, 2012
tests-4.2.3-req.scm
tests-4.3-req.scm 1.1 Integers Dec 14, 2011
tests-5.1-req.scm 1.1 Integers Dec 14, 2011
tests-5.2-req.scm
tests-5.3-req.scm 1.1 Integers Dec 14, 2011
tests-5.6-req.scm 1.1 Integers Dec 14, 2011
tests-driver.scm rename compile-library to compile-lib so not to conflict with built-i… Dec 24, 2011

README.md

Inc: an incrementally developed compiler

Setup instructions for Ubuntu x86

Quick instructions to run all tests

$ petite compiler.scm
  > (compile-lib)     ;; just once
  > (test-all)        ;; run all the tests

Full original instructions

To run the tests, make sure that your compiler file is called compiler.scm, and that at the top of that file, you have: (load "tests-driver.scm") ; this should come first (load "tests-1.1-req.scm") ; and any other test files you may have.

Also, make sure that your compiler defines the function emit-program that takes an expression and uses emit to emit the appropriate instructions.

The tests-driver defines the procedure test-all that will run all the tests provided, get the output, redirect it to a file stst.s, and invokes gcc on that file as well as the startup.c file that you should have written, and the lib.s file that is generated from the compile-lib thunk, which you'll need to call once and every time you change the emit-library thunk, which you can define.

The tests-driver is written for [Petite] Chez Scheme 7. You can obtain a copy of Petite Chez Scheme from: http://www.scheme.com

The tests-driver also assumes that you have the GNU C compiler gcc already setup and added to your pathname. How you do this depends on your platform. If you have a different C compiler that you wish to use, you can edit the tests-driver yourself (look for the definition of the build procedure).

If all is well, then invoking petite on your compiler and typing (test-all) should run all the tests as in the following sample transcript.

$ petite compiler.scm
Petite Chez Scheme Version 7.0a
Copyright (c) 1985-2005 Cadence Research Systems

> (test-all)
  test 0:#f ... ok
  test 1:#t ... ok
  test 2:() ... ok
  test 3:0 ... ok
  test 4:1 ... ok
  test 5:-1 ... ok
  test 6:2736 ... ok
  test 7:-2736 ... ok
  test 8:536870911 ... ok
  test 9:-536870912 ... ok
  test 10:#\nul ... ok
  ...
  test 131:#\y ... ok
  test 132:#\z ... ok
  test 133:#\{ ... ok
  test 134:#\| ... ok
  test 135:#\} ... ok
  test 136:#\~ ... ok
  test 137:#\rubout ... ok
  passed all 138 tests
>

Enjoy.

Abdulaziz Ghuloum aghuloum@cs.indiana.edu

Something went wrong with that request. Please try again.