PicoLisp Programming simplified!

PicoLisp introductory overview

Numbers

(+ 1 2 3) -> 6

Variables

(setq Foo (1 2 3)) Foo -> (1 2 3) (and Foo (reverse @) (cons 4 @)) -> (4 3 2 1)

Conditional statements

(if (= 'this 'that) "This is that" "This isn't that") -> "This isn't that" (let (Foo "bar") (cond ((not Foo) "No foo for you") ((lst? Foo) (map 'my-list-function Foo)) ((= Foo "bar") "Foobar") "Nothing is true" ) ) -> "Foobar"

Create functions

(de hello () (prin "Hello, world.") ) (hello) -> Hello, world. (de double (Number) (* 2 Number)) -> double (double 12) -> 24

Load libraries

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

Serve 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")

Install PicoLisp

Install on Linux

$ sudo apt-get install picolisp

Install on Windows Sybsystem for Linux (WSL)

Install on macOS

PicoLisp features

An integrated database Awesome C / Java interop It's really simple

Integrated Distributed Database Engine

Native C calls and Java interop

# 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"

# 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) )

Simplicity

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

Flexibility

Expressiveness

Efficiency

Download

$ sudo apt-get install picolisp

Learn more - documentation overview

PicoLisp is a programming language, or really a programming system, including a built-in database engine and a GUI system!It's simple and lightweight and encourages clean, concise code - just like every other language.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:and check out the tutorial Otherwise, grab the latest version - [picoLisp.tgz] - unpack it, follow the instructions from the INSTALL file, andcheck out the tutorial See here: Install PicoLisp on Windows 10 It is not possible to install picolisp on macOS, or even to build it without significant modifications to the code. The easiest way to access it on your machine is to install it on a lightweight Linux system and to remotely access it with ssh or similar solutions.Maybe you like to do a little research before diving in. In that case...Besides, it's free (MIT/X11 License). The documentation is pretty great, too.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.The intention of PicoLisp is towriting 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.Interface directly to a running JVM, giving you dynamic access to everything Java.Now that's swingin' harder than a Charlie Parker record!See the article Interfacing with Other Software for details.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 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!It's lisp, afterall. It's a language best suited for reprogrammingInto 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.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 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.If the following command makes sense for your setup, go ahead and run it.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.The documentation page has many examples and tutorials to get you started.

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