Skip to main content

Command Palette

Search for a command to run...

How to install PicoLisp

A whole new world in a 1.1 MB tar ball

Published
4 min read
How to install PicoLisp

This is the first part of the "Getting Started with PicoLisp"-Series.


Installing PicoLisp is easy and doesn't require much space on the system: 3.2 MB to be exact (plus obviously some space for your fancy new PicoLisp programs).

System requirements

Note: This post covers pil21 only.

Let's quickly go through the installation requirements file:

PicoLisp needs a POSIX compatible system and the LLVM infrastructure.

In simple words, you need a unix-like system: If you are using Linux or MacOS, you should be fine. "Normal" Windows will not work unfortunately, but since Windows 10, you can install the "Windows Subsystem for Linux" (WSL), which runs a Linux distribution directly in Windows.

It supports two installation strategies: Local and Global. [...]

Global means that the picolisp code can be accessed from anywhere in the system, while local installation means that it will be only be accessible by relative path names. It is also possible to have both in coexistence (for example for different versions).


Windows Users: Pre-requirement - Installing the WSL

I don't use Windows very often, but for testing purposes I installed the Windows Subsystem for Linux (WSL) today with help of this installation guide and it was fairly easy. If you don't want to sign up for the "Windows Insiders" Program, you can do it like me and go for the manual way, which includes a few powershell commands and an upgrade of Windows 10 to the newest available system (can take a while). After you have finished all the steps, you can search for Linux in the Windows Store and choose between several distributions. If you choose Ubuntu or Debian Linux, you should be able to follow along the PicoLisp installation instructions below.

  • Update 30. May 2022: Apparently Ubuntu works better, because the Debian version comes with a very old LLVM version which can lead to trouble (see also update below in the installation requirements for Linux).

microsoftstore.PNG

After installation, you will be presented a terminal window to create a new user account for your Linux system. After that, you can interact with it just like with a "normal" Linux system via the command line. There is also support for the graphical user interface since April 2021 (GUI), but it's currently still in test mode.


MAC-OS

If you are using MAC-OS, follow along these instructions.

  • Update 30. May 2022: It seems the installation instructions on the link above do not work for all configurations. It might be worth searching the IRC channel or mailing list if you have trouble, for example this thread: https://www.mail-archive.com/picolisp@software-lab.de/msg11079.html

Debian-systems: The easy way

If you are using a debian-based Linux system, like Linux Mint, Ubuntu or Kali Linux, you can install it globally by

sudo apt-get install picolisp

and then you're done. However, the version you will get is most probably not the most recent one.

Note: If your WSL installation is brand new, you might see an error message such as E: Unable to locate package picolisp. In this case, execute sudo apt update first. Some more hints are available in this article: Install PicoLisp on Windows 10

Manual Installation

The following steps are also for a Debian-based system, but should be available with similar syntax in other Linux systems as well.

  1. Download the tar-file

    The code is available as tar.tgz-file on the PicoLisp Download page or alternatively on this git-Repository.

    install-1.png

  2. Install required packages by typing:

    $ sudo apt install make clang llvm libreadline-dev libffi-dev libssl-dev pkg-config
    

    (Note: The "$"-sign does not need to be typed, it symbolizes that it is a shell-command).

  • Update 30. May 2022: Note that the minimum required LLVM-version is 7.0. Some systems, like Debian on WSL, might come with a much older version, so it might make sense to check that if you have installation problems.
  1. Unpack the tarball:

    $ tar xfz pil21.tgz
    
  2. Change the directory

    $ cd pil21
    
  3. Compile the PicoLisp interpreter

    $ (cd src; make)
    

    Congratulations, now you have pico lisp installed locally! Now you can run picolisp scripts by pil [myFirstPicoLispProgram.l] from the pil21/-Folder.

  4. Make the installation global

    This step is optional, but if you want to make the installation globally available, you can create a symbolic link from /usr/lib and /usr/bin to a local installation directory:

    $ sudo ln -s /<path>/pil21 /usr/lib/picolisp
    $ sudo ln -s /usr/lib/picolisp/bin/picolisp /usr/bin
    $ sudo ln -s /usr/lib/picolisp/bin/pil /usr/bin
    

    For additional access to the man pages and some examples:

    $ sudo ln -s /<path>/pil21/man/man1/picolisp.1 /usr/share/man/man1
    $ sudo ln -s /<path>/pil21/man/man1/pil.1 /usr/share/man/man1
    $ sudo ln -s /<path>/pil21 /usr/share/picolisp
    

That's all!

In the upcoming articles of this series, we will learn how how to play with your brand new picoLisp installation. Stay tuned!


Sources

https://software-lab.de/down.html
https://git.envs.net/mpech/pil21
https://git.envs.net/mpech/pil21/src/branch/master/INSTALL
https://picolisp.com/wiki/?WSL
https://docs.microsoft.com/en-us/windows/wsl/install-win10
https://docs.microsoft.com/en-us/windows/wsl/tutorials/gui-apps
https://picolisp.com/wiki/?alternativeMacOSRepository

G

I was attracted to PicoLISP because a long interest in LISP and it is built using llvm which is used to build FreeBSD. Having trouble getting going on FreeBSD. Lots of Linux/GNU (GNU is Not Unix) idiosyncrasies. I'll get there.

M
Mia Temma2y ago

Hi Geoff, thanks a lot for your comment! please share if you manage to get it running, or feel free to post in the mailing list / IRC if you have any questions

M
Mia Temma2y ago

Update: FreeBSD install should work now.

M

One thing with WSL(Ubuntu in my case) when running GUI apps, by default it sets an environment variable $NAME to the machine name, the same environment variable is used in picolisp for httpGateway. This will cause apps not running as expected. CSS won't load, etc...

Running pil from the prompt like this worked "NAME= pil ....." solved the issue.

Thanks to Abu for debugging this out .

1
M
Mia Temma3y ago

thanks a lot for sharing!

Getting Started with PicoLisp

Part 13 of 13

This is for users who want to start with PicoLisp from scratch. This series will cover installation, basic concepts, syntax, how to use the REPL, create simple scripts, read the docs and debug.

Start from the beginning

Levelling up - 2: Use the debugger

Beware of bugs in the above code; I have only proved it correct, not tried it. (Donald Knuth)

More from this blog

F

Functional Programming with PicoLisp

131 posts

A blog about the whole ecosystem of PicoLisp - tutorials, real-world projects, functional programming theory.

Check out https://gitlab.com/picolisp-blog for sources and more.