Question

Arc is built on top of Racket. Since both of them are in the Lisp family, I am curious about the the advantage of Arc over Racket, or what is the motivation of creating Arc given that Racket is available?

Was it helpful?

Solution

Writing your own language is, in a sense, empowering: you get to choose what primitives, what kinds of expressions, are convenient to write in that language. In that sense, you can look at a book like On Lisp and see that the core authors of Arc have a strong opinion on what kinds of things they'd like from a language.

If I take your question and boil it down to the essentials, it sounds like this: why should people write domain-specific languages?

(It's a separate question to consider whether the Arc folks should have re-implemented so many primitive facilities, such as their own macro and module systems, when there's already such mechanisms built into Racket. But the Arc authors are perfectly within their rights to re-invent.)

I guess one of the objections I have to Arc is this: the way they've implemented the official runtime makes it difficult to reuse the work they've done back to plain Racket. In that sense, it's effort that helps only one community, whereas it would have been nice to be able to easily benefit from the work of the Arc folks.

OTHER TIPS

Racket is a Scheme dialect while Arc is not. They are both LISP dialects though. Arc reduces the amount of parenthesis and has some fancy built in syntax to make common stuff shorter in code size. examples:

;; scheme
(if p1 c1
    (if p2 c2
        (if p3 c3 a3)))

;; arc simplifies if
(if p1 c1
    p2 c2
    p3 c3
       a3)

;; scheme
(f1(f2(f3 a b)))

;; arc simplifies cascading calls
(f1:f2:f3 a b)

;; scheme
(lambda (x) (+ x x))

;; arc simplified one argument anonymous functions
[+ _ _ ]

;; scheme array access
(vector-ref v1 5)

;; arc simplifies array access
(v1 5)

You may choose one over the other. Personally I like Arc syntax but not the fact that it is implemented as a interpreter. I wish they had implemented Arc as a Racket module language since then you could actually develope in drracket, debug and make executables. That might even allow making Racket libraries in Arc or vice versa.

If you like to make compatible code you should be more strict and use R6RS/R5RS than using racket default language or arc since then you may have code that you can run on more than just racket. In racket you may choose R5RS or use the #!R6RS as the first line in the code to force the standard. In both cases the result will be able to run under other implementations/compilers.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top