9 ms·
NewLisp
- gecko 11y agoHas anyone ever used NewLisp for something interesting? Would you mind talking about your experience? NewLisp, despite the name, is actually quite old at this point, and its release cycle has slowed down a bit over the years. I'm assuming it landed so high on the front page because people are interested, so some real-life stories would be helpful. (I have a real-life story that concludes with "so I got fed up and rewrote the thing in Python", but I'm not all convinced that the problem wasn't with me.)
- jwr 11y agoI remember looking at it 12 years ago or so, for embedded applications. For some reason I decided to go with ISLISP instead, though I no longer remember why.
- TheSmoke 11y agooh, so newlisp is not that much new then.
- nostrademons 11y agoInvented 1991 according to Wikipedia.
- 0xdeadbeefbabe 11y agoIt used to be. It's kind of a bug with new.
- dragonwriter 11y ago> oh, so newlisp is not that much new then. Well, its new compared to Lisp in general.
- namekuseijin 11y agoits features are comparable to old Lisps from the 70's, prior to Scheme and Common Lisp. Nothing really new here at all and lots of old bugs passing for features.
- a8da6b0c91d 11y ago> For some reason Wouldn't 99% of people see GPL and move on?
- jwr 11y agoYou are being downvoted, unfairly — that was probably the reason why I could not use it back then. And just to clarify, because these discussions often get sidetracked: the GPL is a problem in a commercial setting not because of the source availability requirement, but because of the anti-patent clause, which is basically a minefield.
- JeremyReimer 11y agoHi there! I fell in love with newLISP a few years ago, mostly for its clean documentation, the fact that everything seemed to make sense, and the fact that it was small and fast. I found the newLISP web framework Dragonfly and adopted it to build a prototype website for my previous company. I used Solr for the document storage engine, and used newlisp's excellent native XML conversion to convert an ugly XML feed into a newLISP list and then into individual Solr documents. Then I used Dragonfly to write a front-end searching application that was launched to a select group of our customers. newLISP made it really easy to prototype rapidly and deliver new features quickly. Dragonfly stopped being updated, so I decided I wanted to make my own web framework. That became newLISP on Rockets (www.newlisponrockets.com) and I released the source on GitHub. Although I haven't updated the newLISP on Rockets website much lately, it's mostly because I'm too busy using Rockets in my current job. I built a searching application for all our documentation, and now I'm busy building business intelligence stuff. It's nothing too fancy, and I don't consider myself a great programmer at all. But I love the fact that newLISP allowed me to make all these things quickly and with few lines of code, and it's easy for me to maintain them afterwards. That's the true value that newLISP has for me.
- oceankid 11y agoNice work on Rockets: the website feels zippy. Not something you can say of web libraries these days. What is a good starting point to pick up on newLISP for someone new with programming? I'd like to do some automation (parse lots of unstructured text) to get good data, create PDFs, accept data from email and have a lightweight web front-end.
- hilti 11y agoI recommend picking up the CodePatterns docs. They're always updated and You'll learn a lot from them. http://www.newlisp.org/CodePatterns.html http://www.newlisp.org/CodePatterns.html Then there is my original Dragonfly documentation http://dragonfly.apptruck.de/welcome http://dragonfly.apptruck.de/welcome
- JeremyReimer 11y agoI'd start with the newLISP documentation, particularly the Code Patterns page: http://www.newlisp.org/CodePatterns.html http://www.newlisp.org/CodePatterns.html This is what I learned the language from, and after I got a handle on it I just used their reference manual: http://www.newlisp.org/downloads/manual_frame.html http://www.newlisp.org/downloads/manual_frame.html I'm planning on writing some "intro to web development with Rockets" white papers, but work is keeping me really busy at the moment.
- jopython 11y agoIt is so tiny, I have easily deployed it in the form of a 300k something executable and ran across hundreds of hosts. Very good for OPS work. Excellent scripting language , IMHO.
- hilti 11y agoI've written several web applications in newLISP and the Dragonfly Framework (Disclaimer: I'm one of the developers behind the framework). Most of the web apps are running in sales companies. I think it's a very good and easy to learn language for scripting purpose. I use the built-in parallel processing support for scraping, storing data in newLISPs efficient red-black tree implementation and finally serve APIs.
- jacobush 11y agohttp://picolisp.com/ http://picolisp.com/
- amirouche 11y agoThis is an honest question: why create a lisp instead of a scheme? What is the fundamental feature that makes NewLisp a LISP more that a scheme language?
- lispit 11y agonewLISP is not a derivative of Common Lisp or Scheme or any other Lisp. It's a different language in a similar style. I wish the Common Lisp camp wasn't so insistent on equating "Lisp" to "Common Lisp." It's annoying having to tiptoe around them by saying "Lisp-like language."
- lispm 11y agoWhy would I call a 'new' language 'Lisp' when it can't run a single line of Lisp code from the past 50 years? Give it a different name. Not every random language which happens to use parentheses in some way needs to be called Lisp.
- weland 11y agoIt's very much a Lisp dialect in the sense of McCarthy's Lisp. There is some life beyond Common Lisp :).
- lispm 11y agoIt isn't. Newlisp shares that not much with McCarthy's Lisp. newlisp does not even have linked lists, it has a different evaluation model, ..., no GC. Languages like Standard Lisp, Franz Lisp, ISLisp, Eulisp, Emacs Lisp, Visual Lisp are in the Lisp tradition and share a core language. newlisp is a different language. Call it ParenthesesScript, ContextScript or something like that.
- weland 11y ago> does not even have linked lists Conses are different in newlisp, but it certainly does have linked lists: > In newLISP, there are no dotted pairs. Instead, each newLISP cell contains one object and a pointer to another object if the cell is part of a list. > different evaluation model That one is true, yes. > no GC No, but it implements McCarthy's original intent through the ORO scheme. NewLisp's ORO thing is very annoying if you ask me, but it does its job; it achieves the same thing that McCarthy mentioned in his paper: "This process [...] is more convenient for the programmer than a system in which he has to keep track of and erase unwanted lists. Its efficiency depends upon not coming close to exhausting the available memory with accessible lists etc." Let's not delude ourselves here. NewLisp is not necessarily one of the "better" Lisp implementations, but it has S-expressions, Scheme-like function application and automatic memory management. I think that's reason enough to call it SomethingLisp.
- bjourne 11y agoThe memory management scheme is very novel: http://www.newlisp.org/MemoryManagement.html http://www.newlisp.org/MemoryManagement.html I don't get how it can work since it would require most objects to be passed by value and not reference.
- kmavm 11y agoI'm not able to make sense of why it would not just be region-based memory-management. (http://www.sciencedirect.com/science/article/pii/S0890540196926139 http://www.sciencedirect.com/science/article/pii/S0890540196...). The usual way this fails is that everything ends up bubbling up to the top-most context, which is basically uncollectable. So you leak to death unless you limit yourself in awareness of this possibility. I was hoping that their might actually be a linear type system hiding out in there, but alas, such is not the case.
- kazinator 11y agoIt isn't novel. Basically, it assumes that objects are stack allocated and blows them away when expressions finish evaluating. Anything which escapes out of an expression is copied, so there is no reference graph. Copying objects to avoid lifetime computations is far, far from novel. It is ancient. Think about all the C program modules that use strdup on strings that are passed around, over the place, so that they can then `free` their copy with confidence that nobody else has a pointer to it. In C++, there are smart pointers for one-reference only, like std::unique_ptr. (Long before that became standard, C++ coders did similar things from scratch.) Stack allocation of temporaries which go away when a stack frame is blown away is certainly not new. The implementor of NewLisp just had to look to the implementation language C to get this idea. Mature Lisp implementations have this as a built-in optimization in their compilers. That is to say, recognizing non-escaping temporary objects and optimizing their reclamation, and even allocating them on the stack. ANSI Common Lisp also has the (declare (dynamic-extent ...)) declaration to manually request, or suggest that this may be done with an object. (The programmer promises not to let that object escape, and in return, the implementation can stack-allocate it.) NewLisp's claim is that the memory managent is novel in interpreters (because the author knows that Lisp compilers can identify temporary objects that don't need to be retained past the evaluation of their containing expression). Is it really novel? It might be true of the limited number of interpreters that the author knows about. If we were to exhaustively research the history of computing, we'd probably find other interpreted languages with copying memory management. Oh, here is one: GNU Bash. Look for uses of the function copy_word_list in the Bash sources. GNU Bash seems to be implementing "ORO" memory management for lists of strings passed around as arguments and other structures.
- riscy 11y agoI'm just going to list all of my criticisms after reading what's on the website: 1. Treating functions as lists effectively makes this a weakly typed language like C, whereas both Scheme and Common Lisp are both strong. 2. What advantage does having implicit function arguments (using nil if not provided, not default arguments) have at all unless if you just hate type safety and would prefer unreliable software? There are lots of other ways to maintain type safety while eliding runtime type checks in hot loops. 3. Changing the binding time for free variables within a closure would also imply that a binding by that name must be in scope at the time the function is called, no? This sounds like dynamic scoping... which is known to be difficult to use and error prone. Do you just assume 'nil' when no binding exists?
- kazinator 11y agoNewLisp was designed by a psychologist, who took meticulous care to endow it with design elements such that it would be instantly hated and denounced by anyone who has had anything to do with real Lisp, causing them to spew babble that is incomprehensible to NewLisp n00bies, save for the lingering perception that something gratuitously negative has been spoken. This, in turn, has the calculated effect of making them dig deeper into their trenches. It is best to remain silent upon the subject of the NewLisp design. Let people make their bed and lie in it. By the way, if you want to see a really crazy NewLisp zealot, search for Kazimir Majorinc. Wow ... Maybe he's quit since (and even reformed?); it's been a few years. > Changing the binding time for free variables within a closure What closure? NewLisp has done away with those, and offers "name space contexts" http://www.newlisp.org/index.cgi?page=Closures http://www.newlisp.org/index.cgi?page=Closures These are basically something like modules with static variables.
- agumonkey 11y agoHaha, indeed that pattern is fun. It reminds me of people using placeholders in BASIC source to store state. I'm not sure I'm reading right.
- JeremyReimer 11y agoI'm not sure it's fair to tar all newLISP advocates with the same brush. I understand the design choices that Lutz Mueller made, and I can understand how they might be considered unsatisfactory by other Lisp users. That's fine-- I don't expect newLISP to be everything to everybody, and I don't consider it to be the be-all and end-all of languages. I do find it to be very lightweight and flexible, with excellent documentation and a good built-in library. This makes it useful as a scripting language and for rapid prototyping. I wouldn't recommend it for very large-scale tasks or for projects developed by large teams.
- ninjakeyboard 11y agoI saw this https://news.ycombinator.com/item?id=2909881 https://news.ycombinator.com/item?id=2909881
- fao_ 11y agoI discovered this a while back, because Nearly Free Speech has it as a CGI scripting language. The details of it's GC was rather interesting -- I've been meaning to implement it in one of my lisp projects. EDIT: I just checked, apparently nfsn doesn't support that? Weird, now I have to work out what website I found it through...
- cag_ii 11y agoIt is listed as a LISP on the NFS CGI versions page: http://ultraviolet-cgi.nfshost.com/ http://ultraviolet-cgi.nfshost.com/
- fao_ 11y agoAh, that's where it got to! I was searching somewhere entirely different for some reason. Thanks.
- astine 11y agoLast time I used nfsn, they supported newLisp. It's possible that they dropped support.
- fao_ 11y agoApparently they still have it, I was just searching in the wrong place :)
- pjlegato 11y agoPeople interested in NewLisp may also like Pixie, a small Clojure-like scripting language. https://github.com/pixie-lang/pixie https://github.com/pixie-lang/pixie
- jopython 11y agoBut, newpLisp's tiny C codebase can be compiled and made to run on even obscure UNIXes like AIX, Solaris, HPUX etc without installing any dependencies which Pixie needs.
- pjlegato 11y agoOf course, Pixie is not the most appropriate tool for every possible application. How fortunate that we have so many great open source tools to choose from!
- KingMob 11y agoThere's also Planck, a Clojurescript lib that allows you to write shell scripts in Clojurescript. http://planck.fikesfarm.com/ http://planck.fikesfarm.com/
- munificent 11y agoDynamic scope. Pass everything by value. No closures. No GC. Implement almost the whole thing in one giant 7k line file[1]. I can't tell if this is a work of genius or madness. [1]: https://github.com/kosh04/newlisp/blob/develop/newlisp.c https://github.com/kosh04/newlisp/blob/develop/newlisp.c
- thegeomaster 11y agoOn a tangentially related note, there's a project that aims to redesign some of Common Lisp's semantics to be more modern [0]. Its name is CL21, as it's meant to be "Common Lisp for the 21st century", and it's written entirely in Common Lisp, relying on the kick-ass features of reader macros to introduce new syntax to the language. In my humble experience, integrating it with Shelly [1] and the large swath of Quicklisp [2] libraries can turn it into a terse and reasonably efficient scripting language. (Sadly, you still need a CL implementation and runtime, and they are mostly quite slow.) Definitely worth a look if you like NewLisp's syntax and libraries, as I can see some similarities in the philosophies. [0]: http://cl21.org/ http://cl21.org/ [1]: http://shlyfile.org/ http://shlyfile.org/ [2]: https://www.quicklisp.org/beta/ https://www.quicklisp.org/beta/
- zeveb 11y ago> Sadly, you still need a CL implementation and runtime, and they are mostly quite slow. Say what now? SBCL is normally within a factor of 2 of C, and sometimes faster than C, and the commercial Lisps are even better.
- thegeomaster 11y agoI was referring more to their startup time. The runtime introduces delay when you type in the script command on a CLI. Regardless of that, the factor-of-two-or-sometimes-faster argument sounds a little far-fetched for me, care to provide some sources on the benchmarks? Not saying it's not true, I'm just not accustomed to seeing highly extensible and dynamically-typed languages such as Common Lisp perform so fast.
- PackageUpgrades 11y agosbcl is fast, and can be really fast. Especially compared to the other cl implementations.
- dmm 11y agoCheck out the benchmark game for some decent benchmarks of various languages. Here's sbcl vs gcc c: https://benchmarksgame.alioth.debian.org/u64q/benchmark.php?test=all&lang=sbcl&lang2=gcc&data=u64q https://benchmarksgame.alioth.debian.org/u64q/benchmark.php?... On several benchmarks sbcl is less than three times slower than c. And I never noticed a startup delay with sbcl. Let's do a simple test. $ echo 'print("hello")' > test.py $ echo '(format t "hello")' > test.lisp $ time python test.py hello real 0m0.033s # 33ms user 0m0.027s sys 0m0.003s $ time sbcl --script test.lisp hello real 0m0.006s # 6ms user 0m0.000s sys 0m0.003s # I couldn't figure out how to run newlisp w/o starting # the interactive interp so I'll give it a string $ time newlisp -e '(print "hello")' hello"hello" real 0m0.002s # 2ms user 0m0.000s sys 0m0.000s So sbcl starts up about 5 times faster than python, which lots of people use for scripting. newlisp seems to startup about 4ms faster than sbcl. I really don't see a scenario where the startup time of sbcl is a problem. Just for fun let's look at java. $ java -version openjdk version "1.8.0_60" OpenJDK Runtime Environment (build 1.8.0_60-b24) OpenJDK 64-Bit Server VM (build 25.60-b23, mixed mode) $ time javac hello.java real 0m0.386s # ouch user 0m0.910s sys 0m0.040s $ time java hello hello real 0m0.066s # 66ms, once compiled user 0m0.067s sys 0m0.007s