Arc Forumnew | comments | leaders | submit | lboard's commentslogin
1 point by lboard 6234 days ago | link | parent | on: Poll: Where are you from ?

India

-----

1 point by lboard 6242 days ago | link | parent | on: Poll: What do you edit Arc code with ?

Using emacs with quack.el (scheme mode) and set the default program to mzschme -d path_to_as.scm

in my ~/.emacs added these lines

  (require 'quack)
  (global-set-key [f12] 'run-scheme) ; to run arc by pressing f12


"I use emacs bcoz it is programmable with programmable programming language."

-----

2 points by lboard 6244 days ago | link | parent | on: How to achieve your goal for Arc

This is from pg's essay

The plan was (a) to make a crappy initial version of Arc, (b) use that for a while in real applications, then (c) go back and write a complete, cleaned up language spec, and (d) use that as the basis of a fairly good implementation.

I'm in phase (c) now. I don't know how much longer it will take to finish the spec. It turns out to be quite hard, though very interesting.

- its really hard to manage

-----

13 points by pg 6244 days ago | link

That's pretty obsolete. When I wrote that I was in the middle of trying to write a new Arc whose source was as clean as formal semantics but was actual working code. That turned out not to work because the resulting language was so slow I didn't want to use it for anything, and without applications to drive me I stopped caring about the language. What eventually happened after various experiments was that Robert and I wrote a new implementation that was a compromise between cleanness and practicality.

So now instead of starting with cleanness and trying to achieve practicality, the plan is to always work on practical stuff (like "always have running code") but constantly push the source toward cleanness. I feel like a lot of the definitions in arc.arc for example are close to final form.

-----

2 points by lojic 6244 days ago | link

http://www.paulgraham.com/ilc03.html

from October 2003

-----

2 points by lboard 6245 days ago | link | parent | on: generating sql query for c# with arc

i think destructuing will help a lot for these kind of things. I learned from u, thanks.

-----

5 points by kennytilton 6243 days ago | link

Isn't destructuring cool? We take an anonymous list and quickly associate useful names with what otherwise would be car, cadr, and caddr, etc.

In common lisp when we use destructuring-bind we can have optional /and/ keyword arguments, so you can plan ahead and create an adhoc list like (1 2 :height 3 :width 4) and let :weight default to 42:

  (destructuring-bind (x y &key (height )(width 0)(weight 42))
      ..etc with x, y, height, width, and weight...)
Hmmm, I think I did that for my Arc implementation of defun...shuffle, shuffle, dig..ah:

   (mac defun (name params . body)
  (w/uniq (rtargs)
    `(def ,name ,rtargs
       (withs ,(with (reqs nil key? nil opt? nil keys nil opts nil without)
                (each p params
                  (if (is p '&o) (do (assert (no opt?) "Duplicate &o:" ',params)
                                     (assert (no key?) "&k cannot precede &o:" ',params)
                                   (= opt? t))
                    (is p '&k) (do (assert (no key?) "Duplicate &k:" ',params)
                                   (= key? t))
                    key? (push-end p keys)
                    opt? (push-end p opts)
                    (do (assert (~acons p) "Reqd parameters need not be defaulted:" p)
                        (push-end p reqs))))
                (with (n -1 kvs (uniq))
                  (+ (mappend [list _ `(nth ,(++ n) ,rtargs)] reqs)
                    (mappend [list (carif _) `(or (nth ,(++ n) ,rtargs)
                                                ,(cadrif _))] opts)
                    (list kvs `(pair (nthcdr ,(++ n) ,rtargs)))
                    (mappend [list (carif _)
                               `(or (alref ,kvs ',(carif _))
                                       ,(cadrif _))] keys)
                    )))
         ,@body))))
I'll carve out a dsb tomorrow.

-----