Getting Started‎ > ‎

Installing Arc

Please note that the installing Arc instructions at Arc Forum | Install are currently out of date. Disregard that and any instructions that come together with the specification that Arc can be run only on MzScheme v. 372. The current version of Arc, version 3.1, runs on the latest versions of MzScheme. MzScheme is a legacy component of Racket Lisp (itself formerly known as PLT Scheme), and is automatically installed with Racket.

Also note that the command line for starting Arc has changed with current versions of MzScheme as against what was necessary for v. 372:  Currently the -m flag must be dropped from the command line.


Windows XP (An Arc Forum thread with instructions primarily covering Windows XP; Mac OS is also covered to an extent.)


1) Install Racket

  • The easiest way to install Racket is via the Ubuntu Software Center. After opening the USC, search for 'racket' which will show up as 'extensible programming language in the scheme family'.
  • If you prefer installing Racket from the command line:          
$ sudo apt-get install racket

Arch Linux
  • Install Racket using pacman: 
$ sudo pacman -S racket

Usually installation via the above methods also updates paths to the installed program. After installation is complete, racket, drracket, gracket, mzscheme, etc. should all be callable from the command line without requiring specific path references. If that's not the case for you, at the command line you can invoke 'racket -v' or 'mzscheme -v' to check the version installed (especially if you have multiple installs of Racket), and 'which racket' or 'which mzscheme' to determine the location of those executables in your system.  

2) Install Arc

There are three versions of Arc that we will cover here: Arc itself, Arc/Nu, and Anarki (an extension of Arc open to community contribution without moderation).

Arc/Nu: If you want a quick, no fuss, easily installed Arc REPL on which to play right away, with built-in Readline support, Arc/Nu is perfect.
  • Go to Arc/Nu and follow the install instructions.
  • Open a terminal window and run the following commands (sets Arc/Nu as the current working directory and runs it):
$ cd /path/to/arc-nu 
$ ./arc 

And that's it. You should have a fully functioning Arc REPL. There is no need to run MzScheme or configure its flags as Arc/Nu call the Racket runtime directly. (quit) or Ctrl-D to exit the REPL.

arc> (prn "Hello, World!")
Hello, World!
"Hello, World!"
arc> (+ 3 1 5)
arc> (sqrt (expt 9 3))
arc> (quit)

Anarki: For a bleeding-edge version of Arc, try Anarki, the community 'wiki' codebase.
  • Under the section 'current branch' in the GitHub window, select 'stable' to get the Anarki version closest to Arc or 'master' to get the bleeding edge containing the latest contributions, and click the Zip tab to begin the download.
  • Untar the downloaded file, and rename the untarred directory to 'anarki'.
  • Open a terminal window and run the following commands (sets anarki as the current working directory and runs it):
$ cd /path/to/anarki 
$ racket -f as.scm

You should now have an Arc repl running on Anarki code. Anarki is bleeding edge and adds to the functionality of Arc - check out the /anarki/lib folder and read the source files to explore these additions. Submit a pull request to receive commit privileges.

Arc: To run Paul Graham and Robert Morris' pure Arc: 
  • Download the current version of Arc 
  • Untar the downloaded file, and rename the untarred directory to 'arc'.
  • Open a terminal window and run the following commands (sets arc as the current working directory and runs it):
$ cd /path/to/arc
$ mzscheme -f as.scm

You should now have a repl running on pure Arc. Ctrl-C or (quit) to close the repl in Arc 3.1:
arc> (quit) 

3) Simplify start up

The above configurations are bare bone. You will want to set up Arc with scripts to simplify the start up process and shorten path references when running your Arc programs.

arc> (load "foo.arc") ; this will run if foo.arc is in the Arc program root file (/arc-nu, /arc or /anarki as the case may be)

arc> (load "/path/to/myarc/foo.arc") ; required if foo.arc is in a folder '/path/to/myarc' holding your arc scripts 

    a) To get around having to enter path references in the repl, you can start Arc with these commands:

$ cd /path/to/myarc ; change current working to the folder 'myarc' containing foo.arc

$ /path/to/arc-nu/arc ; start Arc/Nu repl

$ mzscheme -f /path/to/anarki/as.scm ; start Anarki repl

Running Arc/Nu and Anarki Arc the above way, (load "foo.arc") will work within the repl as '/path/to/myarc' operates as the current working directory. At present pure Arc 3.1 appears to require /path/to/arc as the working directory, thus requiring a full path specification for loading foo.arc. [This will be explored further and updated.]

    b) The process can be eased further by placing the above command lines in a shell script, one each for arc, arc-nu and anarki.

    c) If you plan to run multiple implementations of Arc, it may be helpful to create a single folder entitled arc, with arc3.1, arc-nu, anarki (perhaps as an-stable and an-master) installed in their own sub-folders. The release of newer versions of these Arc variants can be conveniently installed in this one folder, with your shell scripts being adjusted for each version.

4) Adding Readline functionality

If you are running the Arc repl from a standard terminal, Readline support may not be available (ie. you have to key in every command in the repl without recourse to a command line history). This can quickly be a bummer, except in the case of Arc/Nu which has built-in Readline support. To work around this for pure Arc and Anarki, you can install rlwrap and then update your start up scripts to wrap the command line with rlwrap:

$ sudo apt-get install rlwrap ; install rlwrap
$ rlwrap mzscheme -f /path/to/anarki/as.scm ; start Anarki with rlwrap
$ rlwrap mzscheme -f as.scm ; start Arc with rlwrap

You can then scroll through your command history with the up/down arrow keys.

If you are undecided about which editor to use, Gnu Emacs is still a great choice, with an excellent Lisp pedigree. Install and run Emacs, M-x (ie. press Alt-x), and key in 'shell' to get the command prompt. Start Arc as described above, and you will have Alt-p and Alt-n to scroll through the previous/next commands in your command history. No need for rlwrap, plus Emacs comes with customisable modes which highlight and indent text automatically in conformity with Lisp standards, in addition to many really powerful built in features.  

Finally, do note that there will be differences in the Arc/Nu and Anarki implementations of Arc. In fact Paul Graham has said that Arc itself will not guarantee backward compatibility from version to version. At this stage of its development Paul wants to ensure that Arc is built on a strongly axiomatic framework, in much the same way that John McCarthy designed or rather, discovered, the original Lisp.  In order to do that he reserves the option to change anything, and asks of you your tolerance. So keep that in mind - Arc is very much a work in progress. 

Happy hacking. May your Arc-fu be strong!