One Picolisp Snippet.






One Picolisp Snippet

 

I had presentation on Picolisp in Hacklab "Mama" in Zagreb few weeks ago.




 Not that I'm expert in Picolisp, but I think I understand it well enough for short introduction. Picolisp is somehow Spartan dialect of Lisp - for example, it doesn't support floating point numbers, and it is not available on Windows - except by using VirtualBox or something like that. But it is dynamically scoped, and it supports some powerful and interesting features as fexprs, coroutines and anonymous symbols, integrated Prolog and database. It is particularly interesting that Picolisp doesn't have strings - the symbols are used for that purpose. On the first sight, absence doesn't look like advantage, but it is, because all usual functions defined on strings now work directly on symbols, without need for conversion.

As a bonus, Picolisp might be the fastest Lisp interpreter, written entirely (in 64 bit version) in assembly language.

The author of Picolisp is Alexander Burger; as Picolisp is, in spirit, very similar to Newlisp, we can almost speak about German school of Lisp. OK, maybe another similar Lisp "made in Germany" is needed for that.

The reactions on Picolisp and presentation were positive; Zagreb is one of the places where Lispers encourage each other, no matter of dialect. We had three days of "Clojure Fest" few months ago (unfortunately collided with swine flue fest.)

I don't want to allow you to go home without any code, so this was the most liked example from presentation.

: (setq my '(list 1 2))
-> (list 1 2)
: (intern (name (zap 'list) "popis")) # not a string
-> popis
: (popis 1 2 3)
-> (1 2 3)
: my
-> (popis 1 2)

No comments:

Post a Comment