» I love the syntax of Python, but crave the simplicity and power of Lisp.«
fix: remove the default to *shell* to avoid sending commands to an unexpected process
note wisp--eval-with-geiser in changes
update NEWS for wisp--find-begin-and-end-of-block-around-region

heads

tip
browse log
v1.0.12
browse .tar.gz

clone

read-only
https://hg.sr.ht/~arnebab/wisp
read/write
ssh://hg@hg.sr.ht/~arnebab/wisp

#Wisp: Whitespace to Lisp

define : hello                    (define (hello)
  display "Hello World"     ⇒        (display "Hello World"))

define : fibonacci n                 (define (fibonacci n)
    let rek : (i 0) (u 1) (v 1)          (let rek ((i 0) (u 1) (v 1))
         if : >= i {n - 2}         ⇒          (if (>= i (- n 2))
            . v                                    v
            rek {i + 1} v {u + v}                 (rek (+ i 1) v (+ u v)))))

Wisp turns indentation based syntax into Lisp. The conversion is homoiconic[^h], generic[^g], and backwards-compatible[^b]. It is inspired by project readable, but tries to keep itself simple (and stupid: just add parens for indentation).

More information is available on the wisp-website, and code in the wisp-repository

For a short presentation, see Why Wisp?

Note that this is full-fledged scheme, with all its capabilities like hygienic macros (programmable syntax!) and full tail recursion.

#Requirements

#Setup

From the repository:

  • Get wisp: hg clone http://hg.sr.ht/~arnebab/wisp (needs Mercurial)
  • Bootstrap: cd wisp && autoreconf -i && ./configure && make

From a release:

  • Get a release from the wisp-website: draketo.de/english/wisp
  • Unpack and build: tar xf [release].tar.gz; cd [release]; ./configure; make

#Install

Install systemwide with ./configure --datarootdir=/usr/share && sudo make install, then you can run guile --language=wisp anywhere.

Install in your home folder with ./configure --datarootdir=$HOME/.local; make install. Use guile -c '(import (language wisp spec))' to get rid of auto-compile errors. You might need to set the module paths in ~/.bash_profile:

export GUILE_LOAD_COMPILED_PATH=${HOME}/.local/lib/guile/2.2/site-ccache{GUILE_LOAD_COMPILED_PATH:+:}${GUILE_LOAD_COMPILED_PATH}
export GUILE_LOAD_PATH=${HOME}/.local/share/guile/site/2.2/${GUILE_LOAD_PATH:+:}${GUILE_LOAD_PATH}

#More

Run tests with make check. Distribute your own version with make distcheck.

If your Guile is installed in your home, you might need to use ./configure PKG_CONFIG_PATH=$HOME/.local/lib/pkgconfig/ and make distcheck PKG_CONFIG_PATH=$HOME/.local/lib/pkgconfig/

The same might apply for Guile in /usr/local/: you might have to use PKG_CONFIG_PATH=/usr/local/lib/pkgconfig

#Usage

  • Preprocess files: ./wisp2lisp infile.wisp > outfile.scm
  • Wisp at the REPL: guile -L . --language=wisp # in the wisp-folder
  • The files in examples/ show how to make executable wisp programs.

#Wisp and curly infix (SRFI-105)

Wisp treats braces "{}" the same as parentheses "()" and square brackets "[]", so you can use it with curly infix (SRFI-105) to get more customary math expressions. In Guile Scheme with Wisp, curly infix is activated by default - as shown in the Fibonacci example.

If you want to use a curly-infix expression starting a line, you have to prefix it with a dot:

. {1 + 1}
; = 2

#License

Wisp as project is licensed under the GPLv3 or later. See COPYING for details. This explicitly includes the files examples/* and emacs lisp files.

The implementation of wisp as language and implementation of SRFI-119 as well as the tests and supporting files are licensed under the lax expat-license: wisp-guile.w, wisp-scheme.w, wisp-reader.w, Makefile.am, configure.ac, bootstrap.sh, bootstrap-reader.sh, systaxtestsreader.sh, syntaxtests.sh, tests/*, testrunner.w, README.md, and other files required to use wisp as the language.

Providing wisp the language under the expat-license to make it easier to embed wisp in games that use Guile.

#Notes

Standardization: Wisp is standardized as SRFI 119[^srfi][^ess].

[^srfi]: SRFI is the abbreviation of Scheme Request for Implementation. It is the official schemisch way of suggesting new features. SRFIs are maintained at srfi.schemers.org/.

[^ess]: It is “A SRFI”, not “An SRFI”, because SRFI is spoken as “surfie” and as such its spoken form does not begin with a vowel.

Copyright: 2013--2021 Arne Babenhauserheide

License: GPLv3 or later, except where noted differently in the source files. wisp-scheme.w, wisp-guile.w and wisp-reader.w are licensed under the expat license. Wisp as complete project is under the GPLv3 or later.

(function(i){var f,s=document.getElementById(i);f=document.createElement('iframe');f.src='//api.flattr.com/button/view/?uid=ArneBab&button=compact&url='+encodeURIComponent(document.URL);f.title='Flattr';f.height=20;f.width=110;f.style.borderWidth=0;s.parentNode.insertBefore(f,s);})('fb82u31');

[^h]: Wisp is homoiconic because everything you write gets turned into lisp which is homoiconic.

[^g]: Wisp is generic, because it works for any language which uses brackets to start a function call - which is true for most lisps. You simply get rid of the speerwall of parentheses without losing their power.

[^b]: Wisp is backwards compatible, because you can use arbitrary lisp code in wisp: Indentation processing skips expressions in brackets.