Live data from Hacker News

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

github.com

21–30 of 45 posts

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

#21
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).

The most commonly expressed reason is that you should be able to use variable names like "list" without shadowing the list function.

Someone with insight mentioned that there was a belief that it would be easier to optimize separate namespaces, but that reality proved them wrong, but I haven't verified that claim.

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

#22
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)

No offense, but I found your example code really confusing.

For the benefit of people familiar with Common Lisp:

  * (= ...) is assignment, not equality testing
  * (map list index-list) is equivalent to (loop for index in index-list collecting (nth index list)), or in a more FP style (mapcar (rcurry #'nth list) index-list)
  * (map function list) is equivalent to (mapcar function list)
I think your example would have been less confusing if it used larger numbers to highlight where addition was happening and where indexing was happening:

  arc> (= l '(4 5 6))
  (4 5 6)
  arc> (= f [+ _ 10])
  #
  arc> (map l '(2 1 0 0))
  (6 5 4 4)
  arc> (map f '(0 1 2))
  (10 11 12)

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

#23
post #14

Earlier quoted context omitted.

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.

Is PicoLisp the same?

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

#24
post #16
post #14

Earlier quoted context omitted.

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.

that's confusing as hell. there's a reason this didn't take off (Besides the competition from clojure)

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

#25
post #17

Earlier quoted context omitted.

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.

Completing your thought (please let me know if I misunderstood you) Y _is_ up for grabs because what you wrote might macroexpand to for example (let ((y 5)) (let ((x (foo y))) (bar x))).

Where your comments falls down is that all the Lisp-2s I know allow the "function definition" of a symbol to be overriden in a similar way, e.g., in Common Lisp the macro might expand to (flet ((bar (arg) (* 5 arg))) (let ((x (foo y))) (bar x))) where FLET is a macro similar to LET but for function definitions.

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

#27
post #24
post #16

Earlier quoted context omitted.

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.

that's confusing as hell. there's a reason this didn't take off (Besides the competition from clojure)

It's kinda cool to be able to write (myarray i).

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

#28
post #17

Earlier quoted context omitted.

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.

Completing your thought (please let me know if I misunderstood you) Y _is_ up for grabs because what you wrote might macroexpand to for example (let ((y 5)) (let ((x (foo y))) (bar x))). Where your comments falls down is that all the Lisp-2s I know allow the "function definition" of a symbol to be overriden in a similar way, e.g., in Common Lisp the macro might expand to (flet ((bar (arg) (* 5 arg))) (let ((x (foo y)…

Yes, that's a good point. Multiple namespaces arose in Lisps before things like FLET and LABELS, so this particular issue is likelier to come up in Common Lisp nowadays. I think there are several historical considerations in play and https://www.dreamsongs.com/Separation.html (as mentioned) is probably the best source for more information.

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

#29
post #24
post #16

Earlier quoted context omitted.

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.

that's confusing as hell. there's a reason this didn't take off (Besides the competition from clojure)

I don't like the Arc language because it's dynamically typed and thus inherently unsafe (see other threads for this sort of discussion.)

But I like this particular feature. If you think about it, an array is a mathematical function, or map, from indices to values. So it makes sense to be able to apply it to indices to get the respective values.

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

#30
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)

Wow next time don't use

  1
and

  l
in the same code listing.
Post reply on HN