public
Description: Arc Lisp to C compiler
Homepage:
Clone URL: git://github.com/sacado/arc2c.git
arc2c /
name age message
file LICENSE Wed Aug 13 13:42:30 -0700 2008 new file: LICENSE [sacado]
file NOTES Thu May 08 21:39:34 -0700 2008 NOTES: some documentation changes [AmkG]
file README Fri Jun 06 16:06:00 -0700 2008 README: random doodles [AmkG]
file a2c.c Thu Jul 31 06:24:36 -0700 2008 a2c.c: corrected garbage collector handling of ... [AmkG]
file a2c.h Thu Jul 31 04:20:55 -0700 2008 a2c.h, a2c.c, codegen: added support in the tar... [AmkG]
directory arc2c-tests/ Thu Jul 31 08:20:29 -0700 2008 arc2c-tests/: added long 'ccc test and 'symeval... [AmkG]
file arc2c.arc Wed Apr 09 07:57:10 -0700 2008 lib-ac: Created file for functions defined in a... [AmkG]
file closures.arc Wed Jul 23 04:36:08 -0700 2008 closures: closure conversion now preserves cont... [AmkG]
file codegen.arc Thu Jul 31 08:19:41 -0700 2008 xe, codegen: fixed bugs related to 'symeval [AmkG]
file cps.arc Wed Jul 23 04:31:35 -0700 2008 cps, codegen: now adds a tag for continuation f... [AmkG]
file in-global.arc Wed Apr 09 06:05:56 -0700 2008 Added global function inlining [AmkG]
file lib-ac.scm.arc Sat Jun 07 20:29:09 -0700 2008 Added support for 'apply [AmkG]
file make-eval.arc Fri Jun 06 03:26:01 -0700 2008 Minor change in naming of function [AmkG]
file rm-global.arc Sat Jun 07 20:29:09 -0700 2008 Added support for 'apply [AmkG]
file sharedvars.arc Fri Jun 06 15:17:40 -0700 2008 Added TODO note [AmkG]
file structs.arc Wed Apr 09 15:33:25 -0700 2008 Changed quote AST: quoted field is now in separ... [AmkG]
file utils.arc Mon Apr 07 07:14:47 -0700 2008 Unused globals are now removed Globals that ... [AmkG]
file xe.arc Thu Jul 31 08:19:41 -0700 2008 xe, codegen: fixed bugs related to 'symeval [AmkG]
README
                _
    .-.   --\  /    arc2c
   /   \  --/  \_

This is the Arc to C compiler.

Arc is the new Lisp from Paul Graham (http://arclanguage.org). It's official release is currently implemented as an 
interpreter above mzscheme.

Here, we are trying to make a compiler translating Arc code to C code, written in Arc. The goal is to see if (and how) a 
dynamically typed language conceived for exploratory programing and protoyping can be compiled efficiently. The current 
implementation is based on a tutorial proposed by Marc Feeley : The 90 Minute Scheme to C compiler 
(http://www.iro.umontreal.ca/~boucherd/mslug/meetings/20041020/minutes-en.html).

Currently, the compiler implements numerical operations on fixnums (+, -, *, <, >, <=, >=, is, isnt), comparison on 
symbols (is, isnt), comparison on characters (is, isnt), comparison and modification on strings (is, isnt, sref), 
annotations (type, rep, annotate) and cons cells construction, deconstruction and comparison (cons, car, cdr, is, isnt). 
All values can be printed with pr or prn. Unicode is supposed to be fully supported. The language supports first class 
continuations (with ccc) and is tail-recursive/tail-call-optimizing. Memory is managed via a home-made GC.

The let, set, sref, and fn syntaxes are partially implemented.  quote and if syntax are fully implemented. Symbols, 
numbers, and cons cells of symbols, numbers and cons cells can be quoted. Primitive operations cannot be overriden. If 
you call an undefined global function, the compiled program will silently crash (many but NOT all such errors are caught 
by the compiler). Some primitive operations expect certain type guarantees and do not check for correct types. There are 
probably bugs in every part of the program...

Use freely, at your own risk. If you want to improve the tool with us, send mail to sacado.sacado@gmail.com.

To use the compiler, in arc :

(load "arc2c.arc")
(compile-file "foo.arc")

Notes about the compiler's output code is available in the NOTES file.