| arcc is an arc-to-mzscheme compiler, which is written in arc3.1 (as distributed by pg) and which should be completely compatible with pg's arc. It is available as a branch on anarki: ~$ git clone git://github.com/nex3/arc.git -b arcc
~$ cd arc
It is also available as a tarball, to be unpacked into the arc directory: ~$ cd arc3.1
~/arc3.1$ wget http://www.rntz.net/files/arcc.tar.gz
~/arc3.1$ tar xzf arcc.tar.gz
All arcc-specific files are in a directory called arcc. To run arcc, first you have to use pg's arc compiler to compile arc.arc and arcc/ac.arc. I've provided an mzscheme script for doing this, arcc/boot.scm: # I here assume you have plt 4. The command-line arguments will
# differ slightly if you use mzscheme v372.
~/arc$ mzscheme --script arcc/boot.scm
This compiles arc.arc to arc.arc.scm and arcc/ac.arc to arcc/ac.arc.scm. Once you have these files, you can use arcc/run.scm to run an arcc REPL. ~/arc$ rlwrap mzscheme --no-init-file --repl --load arcc/run.scm
Welcome to MzScheme v4.2.2 [3m], Copyright (c) 2004-2009 PLT Scheme Inc.
Use (quit) to quit, (_tl) to return here after an interrupt.
arc> (ac '(+ 2 3))
(ar-funcall2 _+ 2 3)
arc>
That's pretty much all there is to it. To compile arcc using itself (bootstrapping proper), you can run the arc script arcc/reboot.arc. Since pg's arc3.1 and arcc should be compatible, this is unnecessary; but it does show that arcc can be self-hosting.arcc is a fairly straightforward translation of pg & rtm's ac.scm and is, as I said, intended to be fully compatible with pg's arc; it does not support any anarki extensions. It can compile and load arc.arc, all the files in libs.arc, and itself; and running (asv) produces the desired hello world page. I have not tested it with the arc news server, and I would be pleased to hear of any bugs or incompatibilities. As a self-hosting arc compiler, arcc is a fairly obvious starting point for extending and fiddling with the arc compiler itself. Redefining any of the functions used in arcc/ac.arc (most of which are prefixed with ac-) will change the way the compiler behaves when compiling future expressions. As a simple example, it is trivially easy to break the REPL: ~/arc$ mzscheme --no-init-file --repl --load arcc/run.scm
Welcome to MzScheme v4.2.2 [3m], Copyright (c) 2004-2009 PLT Scheme Inc.
Use (quit) to quit, (_tl) to return here after an interrupt.
arc> (def ac x `'nil)
*** redefining ac
#<procedure: ac>
arc> 2
nil
arc> (def foo (x) x)
nil
arc> (fn)
nil
|