PicoLisp

medLogo

programming simplified



PicoLisp is a programming language. It's simple and lightweight and encourages clean, concise code - just like every other language!

Seeeee?

With PicoLisp you can do all the things.

   (+ 1 2 3)

   -> 6

Numbers!

   (setq foo (1 2 3))

   foo

   -> (1 2 3)

Variables!

   (and foo (reverse @) (cons 4 @))

   -> (4 3 2 1)

Conditional statements!

   (de hello ()
      (prin "Hello, world.") )

   (hello)

   -> Hello, world.

Functions!

You can even load libraries and make web pages!

   (load "@lib/http.l" "@lib/xhtml.l")


   (de hello-web ()
      (html 0 "Hello Web" "@lib.css" NIL
         (<h1> NIL "Hello, web")
         (<p> NIL
            "This is my first PicoLisp website" ) ) )


   (server 8080 "!hello-web")

That's all the code you need.

apt-get yourself some PicoLisp!

You came here to play with another programming language, right? If you're using a Debian-based Linux (like Ubuntu or Mint), simply install it with:

   $ sudo apt-get install picolisp

and check out the tutorial PicoLisp in 10 minutes.

Otherwise, grab the latest version - [picoLisp.tgz] - unpack it, follow the instructions from the INSTALL file, and then check out the tutorial PicoLisp in 10 minutes.

Or maybe you like to do a little research before diving in. In that case...

Keep Scrollin'

PicoLisp has a few features that make it especially nifty.
  1. An integrated database
  2. Awesome C / Java interop
  3. It's really simple
Besides, it's free (MIT/X11 License). The documentation is pretty great, too.

Integrated Database

Build large, distributed databases with fewer headaches and fewer dependencies
Database functionality is built into the core of the VM, making PicoLisp a language for querying and manipulating databases.

For that, PicoLisp includes a built-in application framework and Prolog engine so you can create, organize, inspect and change (and even build a fancy UI for) your data - all with a uniform and concise syntax.

And when it's time to scale, PicoLisp has you covered - creating networks of distributed databases is built into the core as well. It's simple and powerful, and makes few assumptions about your application architecture.

Native C calls and Java interop

The intention of PicoLisp is to avoid writing extensive libraries. So we give you easy, transparent access to all your favorite software.

Leverage any C library function, manipulate C data structures in memory, call lisp functions from your C code - all that interactively from the REPL.

   # call the 'MD5' function from 'libcrypto.so'

   (let Str "The quick brown fox jumped over the lazy dog's back"
      (pack
         (mapcar '((B) (pad 2 (hex B)))
            (native "libcrypto.so" "MD5"
               '(B . 16) Str (length Str) '(NIL (16)) ) ) ) )

   -> "E38CA1D920C4B8B8D3946B2C72F01680"

PicoLisp can even interface directly to a running JVM, giving you dynamic access to everything Java.

   # a simple Swing UI

   (let [Frame (java "javax.swing.JFrame" T "Bye-Frame")
         Button (java "javax.swing.JButton" T "OK") ]
      (java Frame 'add "South" Button)
      (java Button 'addActionListener
         (interface Button "java.awt.event.ActionListener"
            'actionPerformed '((Ev) (bye)) ) )
      (java Frame 'setSize 100 60)
      (java Frame 'setVisible T) )

Now that's swingin' harder than a Charlie Parker record!

See the article Interfacing with Other Software for details.

Simplicity

PicoLisp is easy to understand and adapt.

Beneath the surface of the language lies the PicoLisp virtual machine. At the lowest level, the VM operates on a single data structure - the cell.

      +-----+-----+
      | CAR | CDR |
      +-----+-----+

A cell is just a pair of pointers, 'CAR' and 'CDR'.

All functions and data in the system are stored in cells, which simply point to each other to form arbitrarily complex structures.

From these cells, we contruct three base data types - Numbers, Symbols, and Lists - and from those, the rest of our universe.

So once you grok the underlying cell structure (which you pretty much already have), you just need to explore a small but powerful set of functions that do cool things with those cells.

It's that simple!

Other Features

Flexibility
It's lisp, afterall. It's a language best suited for reprogramming itself.

Into functional programming? Rock on. OOP? PicoLisp has an elegant, unobtrusive, totally optional object system. Explore a syntax of nested function calls, bend the language to the task at hand, metaprogram yourself to the moon. We'll help you build a rocket.

Expressiveness
PicoLisp programs are often much shorter than equivalent programs written in other languages. Examples of various programming tasks and their solutions can be found at rosettacode.org.

Efficiency
PicoLisp uses very little memory, on disk as well as in memory (heap space).

The tarball size of the whole system - including the interpreter, database, HTTP server, HTML and JavaScript application framework, and the debugger - is just a few hundred kilobytes.

Download

If the following command makes sense for your setup, go ahead and run it.

   $ sudo apt-get install picolisp

If not, you'll have to build it from source. But that's easy, too!

Grab the tarball - [picoLisp.tgz] - unpack it, and follow the instructions from the INSTALL file.

Learn More!

The documentation page has many examples and tutorials to get you started.



http://picolisp.com/wiki/?home

31mar16   erik