Live data from Hacker News

Anarki – Community-managed fork of the Arc dialect of Lisp

github.com

11–20 of 45 posts

Re: Anarki – Community-managed fork of the Arc dialect of Lisp

#11
post #3

What are the core features that differentiate Arc from other lisp dialects?

To me, one of the most fundamental features of Arc is taking the unification of code and data much further. I don't know of other Lisps that do this! K is another language that does. arc> (= l '(1 2 3)) (1 2 3) arc> (= f [+ _ 1]) # arc> (map l '(0 1 2)) (1 2 3) arc> (map f '(0 1 2)) (1 2 3)

This was discussed a lot before (according to Queinnec book at least) but people were worried that too much overloading would yield confusing code and bugs.

Re: Anarki – Community-managed fork of the Arc dialect of Lisp

#12
post #8

Earlier quoted context omitted.

It would be more correct to say that they can be coerced to a function with a special purposes (e.g. using a set as a function is an alias for checking whether an item exists). To say they are functions would be incorrect. By the same logic, a keyword is would be a function.

They're callable as functions, i.e. they implement clojure.lang.IFn. So unless you want to shave hairs on what it means to say they're not "functions", they _are_ functions. Sets, vecs, maps, keywords, and IIRC symbols are all IFn Oh and (#{1 2} 3) is equivalent to (get #{1 2} 3) not (contains? #{1 2} 3)

I think that it depends upon what you interpret it when you say “it’s a function”; it’s data as well. Which, now that I reconsider it, was kind of the point that the parent was trying to make, that they’re also very much unified.

So point taken.

Re: Anarki – Community-managed fork of the Arc dialect of Lisp

#14
post #3

What are the core features that differentiate Arc from other lisp dialects?

To me, one of the most fundamental features of Arc is taking the unification of code and data much further. I don't know of other Lisps that do this! K is another language that does. arc> (= l '(1 2 3)) (1 2 3) arc> (= f [+ _ 1]) # arc> (map l '(0 1 2)) (1 2 3) arc> (map f '(0 1 2)) (1 2 3)

I don't know Arc, so this confuses me:

  arc> (map l '(0 1 2))
  (1 2 3)
What is the logic here? Is l made into a function that holds state and returns each element in turn (like an iterator function)? Because I would've expected:

  arc> (map l '(0 1 2))
  ((1 2 3) (1 2 3) (1 2 3))
In what way is map being applied here?

Re: Anarki – Community-managed fork of the Arc dialect of Lisp

#15
post #13

Am I understanding right that Arc is a Lisp-1, like Clojure?

Yes, or like Scheme.

I don't really get why you'd ever want a Lisp-2. Is there an argument/explanation somewhere that I could read up on?

(I've used Clojure and JS, which also seems like a "Lisp"-1 in that you can just put fns into variables and call them like 1st class fns, I just don't get why the distinction is in any way positive rather than confusing, and in Lisp-2s you now need to dereference everything all the time, like in Ruby).

Re: Anarki – Community-managed fork of the Arc dialect of Lisp

#16
post #14
post #3

Earlier quoted context omitted.

To me, one of the most fundamental features of Arc is taking the unification of code and data much further. I don't know of other Lisps that do this! K is another language that does. arc> (= l '(1 2 3)) (1 2 3) arc> (= f [+ _ 1]) # arc> (map l '(0 1 2)) (1 2 3) arc> (map f '(0 1 2)) (1 2 3)

I don't know Arc, so this confuses me: arc> (map l '(0 1 2)) (1 2 3) What is the logic here? Is l made into a function that holds state and returns each element in turn (like an iterator function)? Because I would've expected: arc> (map l '(0 1 2)) ((1 2 3) (1 2 3) (1 2 3)) In what way is map being applied here?

After RTFM, I can answer my own question:

> In Arc, data structures can be used wherever functions are, and they behave as functions from indices to whatever's stored there.

(quoted from the Arc tutorial)

So

   arc> (l 0)
   1
and so on. So the GP makes sense.

Re: Anarki – Community-managed fork of the Arc dialect of Lisp

#17
post #13

Earlier quoted context omitted.

Yes, or like Scheme.

I don't really get why you'd ever want a Lisp-2. Is there an argument/explanation somewhere that I could read up on? (I've used Clojure and JS, which also seems like a "Lisp"-1 in that you can just put fns into variables and call them like 1st class fns, I just don't get why the distinction is in any way positive rather than confusing, and in Lisp-2s you now need to dereference everything all the time, like in Ruby).

If I understand it correctly, Lisp-2 is a way (not the only way!) of maintaining more intuitive semantics in the face of macros. If I write the following:

  (your-macro
    (let ((x (foo y))
      (bar x))))
I probably don't want the meaning of FOO or BAR to be up for grabs based on the expansion of YOUR-MACRO, and certainly not LET. Lisp-1s often have hygienic macros to deal with this concern, but not always.

Re: Anarki – Community-managed fork of the Arc dialect of Lisp

#18
post #14
post #3

Earlier quoted context omitted.

To me, one of the most fundamental features of Arc is taking the unification of code and data much further. I don't know of other Lisps that do this! K is another language that does. arc> (= l '(1 2 3)) (1 2 3) arc> (= f [+ _ 1]) # arc> (map l '(0 1 2)) (1 2 3) arc> (map f '(0 1 2)) (1 2 3)

I don't know Arc, so this confuses me: arc> (map l '(0 1 2)) (1 2 3) What is the logic here? Is l made into a function that holds state and returns each element in turn (like an iterator function)? Because I would've expected: arc> (map l '(0 1 2)) ((1 2 3) (1 2 3) (1 2 3)) In what way is map being applied here?

I think the list '(0 1 2) is behaving like the function — in CL syntax, sorry, I don't know Arc — (lambda (x) (elt '(0 1 2) x)). That is, the list is being treated as a sequence, which is a function from each index to the corresponding element.

Re: Anarki – Community-managed fork of the Arc dialect of Lisp

#19
post #13

Earlier quoted context omitted.

Yes, or like Scheme.

I don't really get why you'd ever want a Lisp-2. Is there an argument/explanation somewhere that I could read up on? (I've used Clojure and JS, which also seems like a "Lisp"-1 in that you can just put fns into variables and call them like 1st class fns, I just don't get why the distinction is in any way positive rather than confusing, and in Lisp-2s you now need to dereference everything all the time, like in Ruby).

https://www.dreamsongs.com/Separation.html

Re: Anarki – Community-managed fork of the Arc dialect of Lisp

#20
post #13

Earlier quoted context omitted.

Yes, or like Scheme.

I don't really get why you'd ever want a Lisp-2. Is there an argument/explanation somewhere that I could read up on? (I've used Clojure and JS, which also seems like a "Lisp"-1 in that you can just put fns into variables and call them like 1st class fns, I just don't get why the distinction is in any way positive rather than confusing, and in Lisp-2s you now need to dereference everything all the time, like in Ruby).

Yes, JavaScript also has a single namespace, like a Lisp-1.

The advantage of a Lisp-2 is that it makes macro writing easier; you can include calls to known functions in the expansion without having to deal with the possibility that those names have been shadowed.

Post reply on HN