Arc Forumnew | comments | leaders | submitlogin
NewLISP anyone?
4 points by th00ster 4631 days ago | 15 comments
Alas, I am going to make myself unpopular.

Yes, I anticipated arc as much as anyone of you did. Having used both Common Lisp (excessively) and Scheme (occasionally), I recently felt the need for a more "pythonic" approach to functional programming, in the sense of "it just works the way I expect". So I stumbled upon NewLISP and was blown away. PCREs, webserver, (java-based) guiserver, utf8, readline (last three optional), superior code structuring aids such as "contexts" and so many more great language features compile to a 209k binary in 14 seconds. (Written in just about 36000 lines of pure C.)

I am now about to finish my first major project in NewLISP and it turned out to be one of my best and above all cleanest works so far. (As far as I can tell) Working with strings and regular expressions was far more enjoyable than in Python, and I think this means a lot.

So what am I missing?

I won't go as far as to say "Goodbye arc", but I fear that my subconsciousness has already done so.

So flame me to hell. But tell me what you make of newlisp first. Url is

7 points by kennytilton 4631 days ago | link

I do not see any problem with sharing word of another Lisp option in this space as long as it does not turn into a drumbeat. But what do you mean by "goodbye Arc"? It does not sound like you tried it. As for newLISP:

newLISP does not support sharing of subobjects among objects, cyclic structures, nor multiple variables pointing to the same object. Objects are (physically) copied when stored in data structures or passed to functions



2 points by th00ster 4630 days ago | link

I just seem to have found the functional programming language of my dreams, just before arc was released...

Although a lot of the issues you guys have with NewLISP sound serious enough, I admit.


2 points by tjr 4629 days ago | link

The only times I've seen folks here talk bad (or really even talk at all) about NewLISP is when someone specifically asks about it. I don't think anyone here is out to destroy NewLISP, or to stop people from using it. If it works for you, then go for it!


4 points by Jekyll 4631 days ago | link

>So what am I missing?

Well last time I looked at newLisp you were missing:



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 4631 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 4631 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?



11 points by Jekyll 4631 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 4630 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 4630 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."

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 4631 days ago | link

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


3 points by araujo 4631 days ago | link

I think there is no reason to flames here , since we always will have alternatives way to approach a language design , and at end, preferences tend to go from the objective to the subjective perspective of the programmer to choose or prefer a language over the other.

Regard the comparison of Arc with NewLisp , I think the main goal (for now) with Arc is this so-called 'exploratory' programming , where the focus is more on 'playing' with ideas and new ways of design (through a cycle of test-error), and from there on, start and continue the building of a language for 'solving' in a elegant way much of the tasks a general purpose programming language should be able to do ; this approach, opposed to the traditional way of language design where you fight against the problems right away and build the language on top of that fight, could give a sense of slowness to Arc , but at the end,it could result in something cleaner and more elegant than what it is currently offered by many other languages.

This , in no way, means we don't care about optimization of code speed, or probably library and 'real-world' application support , but these are issues coming along in the way of the core Arc design.


2 points by cadaver 4631 days ago | link states that NewLISP is licenced under the GPL. This may be an issue to some people.


1 point by th00ster 4630 days ago | link

and states nothing about licensing... Can you help me out there?


3 points by nex3 4630 days ago | link

From the copyright file in arc1.tar: "This software is copyright (c) Paul Graham and Robert Morris. Permission to use it is granted under the Perl Foundations's [sic] Artistic License 2.0."


4 points by m-i-c-h-a-e-l 4630 days ago | link

I fear further apologies from the newLISP community will not be forthcoming. Try things for yourself. I searched for many years before finding a language that felt right. No language can please everyone. Certainly don't rely on the biased views of others, no matter how well-intentioned.

m i c h a e l