Arc (programming language)
|This article relies on references to primary sources. (March 2011)|
|Paradigm(s)||multi-paradigm: functional, procedural, reflective|
|Designed by||Paul Graham and Robert Morris|
|Stable release||3 (July 13, 2009)|
|Typing discipline||dynamic, strong|
|OS||Cross-platform, runs on the Racket compiler|
|License||Perl Foundation's Artistic License 2.0|
|Usual filename extensions||.arc|
In 2001 Paul Graham announced that he was working on a new dialect of Lisp named "Arc". Over the years since, he has written several essays describing features or goals of the language, and some internal projects at Y Combinator have been written in Arc, most notably the Hacker News web forum and news aggregator program.
In the essay Being Popular Graham describes a few of his goals for the language. Among the claimed design goals are that "Arc should be hackable" and "there should be good libraries"; Graham also proposes:
It would not be far from the truth to say that a hacker about to write a program decides what language to use, at least subconsciously, based on the total number of characters he'll have to type. If this isn't precisely how hackers think, a language designer would do well to act as if it were.
Paul Graham suggests John McCarthy's original Lisp to have been built wholly on a small set of "axioms", and maintains that Arc ought to be constructed in a similar way, even when that means the language may not have features that large organizations want. Specifically, Graham feels that object-orientation is not useful as OO methods and patterns are just "good design," and he sees the language features used to implement OO as partially mistaken.
A controversy among Lisp programmers is if, and how much, the S-expressions of the language should be complemented by other forms of syntax. Graham feels that additional syntax should be used in situations where pure S-expressions would be overly verbose, saying, "I don't think we should be religiously opposed to introducing syntax into Lisp." Graham also feels that efficiency problems should be solved by giving the programmer a good profiler.
Hello world in Arc :
(prn "Hello, World")
A program used by Paul Graham to illustrate Arc's terseness. It produces at the url "/said" a form with one field. When the form is submitted, it leads to a page with a link that says "click here", which itself leads to a page with the value of the original input field.
(defop said req (aform [onlink "click here" (pr "you said: " (arg _ "foo"))] (input "foo") (submit)))
The first publicly released version of Arc was made available on 29 January 2008, implemented on top of Racket ("MzScheme" at that time). The release comes in the form of a .tar archive, containing the Racket source code for Arc. A tutorial and a discussion forum are also available. The forum uses the same program that news.ycombinator.com does, and is itself written in Arc.
Due to the slow development of the official Arc branch, some members of the Arc community started unofficial repositories with unofficial emendations, extensions and libraries. One version, Anarki, permits anyone to submit changes to the project. The community-managed wiki is a better source of information than the official site at this point.