Arc Forumnew | comments | leaders | submitlogin
4 points by Jekyll 6112 days ago | link | parent

>So what am I missing?

Well last time I looked at newLisp you were missing:

1)closures

2)callcc

3)pass by reference

4)macros (you've only got f-exprs)

5)argument checking for functions at run time

6)a compiler

7)Garbage collection

8)hash tables

I stopped looking after that but I'm sure other people can keep the list going...

It'd be great if I'm wrong about these things and newLisp can be taken seriously, but right now, based on the little I know, I'm not using newlisp.



10 points by dido 6112 days ago | link

I'll add one more thing: static binding. It's the only functional language/LISP dialect I've ever seen developed after the 1970's (besides Emacs Lisp) that still does dynamic binding. I decided that this would be lots of trouble for programming in the large, which is why I never decided to pursue it.

This NewLisp fragment (which is also valid Scheme) illustrates this:

  (let ((x 1))
       (let ((f (lambda (y) (+ x y))))
            (let ((g (lambda (f y) (let ((x 3)) (f y)))))
                 (g f 2))))
This form evaluates to 5 in NewLisp but 3 in Scheme. The equivalent in Arc:

  (let x 1
      (let f (fn (y) (+ x y))
             (let g (fn (f y) (let x 3 (f y)))
                 (g f 2))))
as expected evaluates to 3, so Arc also does static binding. Dynamic binding makes safe use of free variables in different contexts that much harder, and essentially makes referential transparency all but impossible. I cannot for the life of me, especially after reading Steele and Sussman's "The Art of The Interpreter", imagine why the designers of NewLISP thought it would be a good idea to use dynamic binding in their language. Static binding had a reputation in the past as carrying with it a performance hit, which is why RMS didn't use it for Emacs Lisp, but research done afterwards has shown that there are ways of doing it properly that don't sacrifice performance.

-----

1 point by sophacles 6112 days ago | link

Unless I'm not understanding something, and am not quite grokking this whole list/functional language thing (entirely possible I'm still learning).

newLisp appears to have the following from this list (by way of a quick look at the documentation on the site):

macros via define-macro and lamda-macro (and not autmatically hygenic ones...)

pass by reference.

And closures via let and lambda forms.

garbage collection

hash tables

Im really not for or against newLisp. It seems that since you last looked some of the stuff got implemented. The thing Im really not sure of is macros. It seems to me that the newLisp maros are very much the same as arc macros. If this is wrong, can someone please help me grok it?

Erich

-----

11 points by Jekyll 6112 days ago | link

One of the things I don't like about newlisp is that from their site, they appear intentionally misleading about what they can and can't do.

They don't have hash tables, this they openly admit and they make do with self balancing trees.

They don't have macros, they have f-expressions. F-exprs are strictly more powerful, but execute at run time not at definition time. This means every abstraction you use incurs a penalty fee each time it is executed, rather than just once when it is compiled. They call what them macros anyway.

They don't have garbage collection at all. The whole language is basically allocated on the stack, and objects are deleted or copied and returned when a function ends. This means they can't have true closures, or pass by reference with indefinite extent for the objects.

As far as I can tell, the hacks they suggest to get round the lack of closures won't work if you want to create and destroy many anonymous fns. bound to data with indefinite extent. They still refer to these hacks as `closures'.

Their pass by reference work around, amounts to passing symbol names from different contexts and can't do the right thing when you(for example) want to merge existing lists and then rebind one the original symbols.

Having said all that, if one of the newLisp guys wants to prove me wrong, and show something like partial application code to demonstrate that it really does have true closures, it'd be great to see, and I'd probably go back to the language and have another go with it.

-----

-1 points by newguy 6111 days ago | link

"...if one of the newLisp guys wants to prove me wrong," No, first you have to prove yourself right.

"...they appear intentionally misleading..." Intentionally? How so?

"...they still refer to these hacks as `closures'." Cite please. And "hacks"? What if I called you a jerk?

-----

9 points by Jekyll 6111 days ago | link

>No, first you have to prove yourself right.

Can't prove a negative, but I've already explained why I think I'm right.

>Intentionally? How so?

When they claim to fake closures with contexts, they're wrong. Now they're either confused or trying to confuse other people.

>Cite please.

"In newLISP lexical state-full closures are not realized using lambda closures but using lexical namespaces." http://www.newlisp.org/ExpressionEvaluation.html

It's the first hit on google for `newlisp closure'.

>What if I called you a jerk?

I would be immediately converted to newlisp by the strength of your arguments and the size of your e-penis.

-----

1 point by cooldude127 6112 days ago | link

those sound like a lot of things i want. sorry newlisp

-----