Hacker News new | past | comments | ask | show | jobs | submit login
A site for Picolisp, a very true Lisp (picolisp.org)
59 points by duncanj on Nov 26, 2009 | hide | past | favorite | 33 comments



I'm highly skeptical.

An interpreter-only implementation that performs better than compiled implementations?... Oh, but wait, it says it's better than "some" compiled implementations, so I guess if it beats "some" shitty compiled implementations that's true... How does it compare to, say, SBCL?

As for the "As a consequence [of being interpreter-only], Pico Lisp is the most dynamic Lisp in existence today." part, I don't really see what notable advantages an interpreter-only implementation would have over a proper compiler-implementation in flexibility, given that it's Lisp we're talking about. Unless you wanted to muck with the deep internals or something... Also, I'm in the process of making my homebrewed web framework more flexible by making use of more compilation, thus making it less of an interpreter.


This could make sense. In a sufficiently complex language, a single "VM" instruction translates to many native instructions. If you compile a program in such a language into native code, the size of the code explodes, resulting in really poor cache utilization. A tight interpreter on a modern processor (heavy cache fault penalties + branch prediction) can very well perform better than a natively compiled program. Performance is a very tough problem, unfortunately it's very difficult to find a "superior" solution - it just depends on far too many variables.


If memory serves me, there are also cases where information available at run-time can allow better optimizations than could normally be done at compile-time--I think the JVM has some tricks along those lines for JITing bytecode into native instructions, but I suppose the same principle could apply elsewhere.


Nothing stopping you doing these kinds of optimizations on Lisp code again at runtime when you have the extra info. Just automatically recompile if you know it will save you enough time to be worth it (which is a more difficult problem, of course...)


Regarding the quote below... I don't get it. Cells are a linked list spread randomly throughout your address space. Processors don't love that at all.

"A cell is a cell in the same way it was with the original Lisp, consisting on a head and the rest, that is, a CAR part (which may be either a number, a symbol, or a pointer to another cell), and a CDR part (also a number, symbol or cell). As a consequence, it is incredibly memory efficient, and there is little to none memory fragmentation. Processors cache "loves" our interpreter."


Let's just say I wouldn't use the spread of allocations across address space as a PRNG. Depends on your allocator of course, but you should normally see some fairly linear patterns. The allocator can be very simple if all (or almost all) allocations are the same size, so you can easily optimise for cache efficiency.

I suspect the cache angle they're playing up refers to memory footprint of each cell. I don't know how big their cells are, they could be anything from 2 machine words up. Integers are supposedly directly represented, and if they've embedded their GC liveness info into spare bits (or stored it elsewhere entirely) then that makes it extremely compact and thus cache friendly.


Gee, what a great interpreter to embed in a program... that's GPLed. Nice option for that niche, I suppose.


There are lots of GPL programs around, not really a "niche" anymore ;)


You missed his statement about it being embedded into other programs. You see when you embedded a gpl scripting language into a larger program the entire program becomes gpl. This makes it a very bad embeddable program.


That makes it a very good embeddable program, but then I do like Free Software.


Why would this be bad? If you are developing commercial software you want to keep closed-source, look for a commercial closed-source license.


IIRC, there is another license (guile, maybe?) that's identical to GPL except it doesn't affect the outer program.


MIT license is far less restrictive.


Of course, but if you want to go with the GPL, you can use exceptions and protect just the part you want.


That's the LGPL, used in the GMP library for example.



You're right - Guile has its own license. The LGPL has similar concessions to linking to non-GPL programs, though.


Good for dual licensing: free for GPL use, commercial license needed for otherwise.


Picolisp was a major inspiration for me to start writing my own lisp --- I love the idea of removing lambda in favor of quote. I was constantly frustrated by the dynamic binding, though, and the lack of idiomatic macros --- I guess you can't have everything you want unless you do it yourself.


eight looks really cool!!


Uh, a small warning, some of the functions in picolisp are a bit "buggy" or at least I wouldn't use them: http://stackoverflow.com/questions/1630352/picolisp-language...


Hey, it's a Lisp that allows something akin to [false become: true] in Smalltalk. That's awesome.


For some values of true.

While PicoLisp is certainly interesting, the bulk of Lisp and Scheme (and Dylan) implementations since the early 1980's have gone into a different direction.

For me, true Lisps are languages like T, EuLisp, Dylan, Goo and CL of course (their kernels are mostly equivalent, and can be compiled to run well on existing (virtual) machines.)


I call it "true" mainly because it faithfully represents the code/data unification in lisp. In picolisp, there is no lambda, because the representation of a function is a list, and can be quoted directly.


I have a copy of an great-but-ancient book called "Functional Programming: Application and Implementation" (Peter Henderson, edited by CAR Hoare).

If you're interested in this implementation, you'll find that book very interesting, and quite similar I think (based on reading the link).

(The book has a now-amusing appendix too where it lists the "object" code for the compiler in sexp-syntax, presuming that you'd have no other way to bootstrap other than typing that in :)


Also check out the author's site for picolisp: http://www.software-lab.de/down.html


"Pilog -- PicoLisp Prolog"

I see it obeys the law that every Lisp implementation must have an implementation of Prolog embedded in it.


No (non-Cygwin) Windows binary :-(


I call it a feature.

Cygwin is the first thing I install on a Windows desktop. At least it makes it look like a civilized environment.


Mingw makes Windows civilized AND non-slow.


MinGW is a compiler set. Cygwin gives me a full Unix-like environment on top of Windows. It's not an apples to apples comparison.


Look into CoLinux, I like it a lot more then Cygwin. http://en.wikipedia.org/wiki/Cooperative_Linux


That's MSYS in MinGW world.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: