Monday, October 24, 2011

PicoLisp: The Scalpel of Programming

PicoLisp: The Scalpel of Programming A Radical Approach to Software Development If some programming languages claim to be the "Swiss Army Knife of Programming", then PicoLisp may well be called the "Scalpel of Programming": Sharp, accurate, small and lightweight, but also dangerous in the hand of the inexperienced. Less is more! - The maxim is: Keep it simple, and the programmer in control! Why PicoLisp? Short answer: Because PicoLisp has two characteristic features, which are not found to that extent in other languages: An integrated database Equivalence of code and data These two features, and how they are used in combination, make it worth to take a closer look at PicoLisp. Besides this, PicoLisp is a very simple and succinct, yet expressive language. And it is free (MIT/X11 License). Integrated Database Database functionality is built into the core of the language. PicoLisp is a database query and manipulation language. Database entities are first class objects. They are called "external symbols", because they are automatically fetched from database files when accessed, but otherwise behave like normal symbols. This fetching from external files is completely transparent, the symbols "are just there", and there is no need (or even a function) to read or write them explicitly. Pilog (a built-in Prolog engine) is used as a query language. It is possible with PicoLisp to build large multi-user databases, distributed across many machines or in a cloud. Such a database system can be optimally fine-tuned, because all its levels are under the developer's control. Equivalence of Code and Data This is actually a feature of Lisp in general. However, PicoLisp really lives it. It makes it easy to write things like the HTML, PostScript or TeX libraries, exploring a syntax of nested function calls. This results in very succinct and precisely expressed programs. For a closer explanation, see the article The Equivalence of Code and Data. Expressiveness PicoLisp is a very expressive language. Programs are often much shorter and concise than equivalent programs written in other languages. Examples of various programming tasks and their solutions can be found at rosettacode.org. Efficiency PicoLisp uses (at least when compared to other Lisps) very little memory, on disk as well as in memory (heap space). For example, the installation size in the OpenWRT distribution is only 575 kB (uncompressed), where the statically linked interpreter with 296 kB takes the largest part. Yet, it includes the full runtime system with interpreter, database, HTTP server, XHTML and JavaScript application framework, watchdog, and the debugger, PostScript and XML libraries. PicoLisp has no compiler, everything starts up very quickly, and code dynamically loaded at runtime (e.g. GUI pages) is immediately ready. Yet, the interpreter is quite fast, usually three times a fast as Python, for example. See also the article Need For Speed.

No comments: