wisp
 

Wisp: Whitespace to Lisp

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

Changes (full changelog)

(Arne Babenhauserheide)
2016-06-08: note that this uses linear approximation tip

note that this uses linear approximation

(Arne Babenhauserheide)
2016-06-08: can calculate the cell-idx for each lat-lon combination.

can calculate the cell-idx for each lat-lon combination.

(Arne Babenhauserheide)
2016-06-07: d20world: add map from cellidx to dienumber

d20world: add map from cellidx to dienumber

(Arne Babenhauserheide)
2016-06-07: update examples/d20world to use the wisp reader

update examples/d20world to use the wisp reader

Branches

(Arne Babenhauserheide)
stable: Backed out changeset eac6ca6ea803: no development on stable. 2015-11-02

Backed out changeset eac6ca6ea803: no development on stable.

(Arne Babenhauserheide)
default: note that this uses linear approximation tip 2016-06-08

note that this uses linear approximation

Tags

(Arne Babenhauserheide)
v0.9.0: merge starting from wisp.scm stable 2015-09-24

merge starting from wisp.scm

(Arne Babenhauserheide)
v0.8.7: prepare wisp 0.8.7 2015-09-24

prepare wisp 0.8.7

(Arne Babenhauserheide)
v0.8.6: prepared for release 0.8.6 2015-09-12

prepared for release 0.8.6

(Arne Babenhauserheide)
v0.8.5: merge : . and SRFI-119. stable 2015-07-28

merge : . and SRFI-119.

(Arne Babenhauserheide)
wisp-mode-0.2.1: wisp-mode 0.2.1 2015-06-23

wisp-mode 0.2.1

(Arne Babenhauserheide)
v0.8.4: merge no longer wrapping blocks in begin, wisp-mode without electric stable 2015-06-23

merge no longer wrapping blocks in begin, wisp-mode without electric indent and examples newbase60 and cli.

(Arne Babenhauserheide)
v0.8.3: merge source-properties and d20world experiment. stable 2015-04-11

merge source-properties and d20world experiment.

(Arne Babenhauserheide)
v0.8.2: merge SRFI draft, curly-infix by default, REPL delayed output fix, stable 2015-03-19

merge SRFI draft, curly-infix by default, REPL delayed output fix, examples, tests and generalized shell-call.

(drak)
v0.8.1: merge for release: reader execution and SRFI. stable 2014-11-19

merge for release: reader execution and SRFI. - wisp-reader: fix wisp-scheme code-tree evaluation - SRFI: lots of polish.

(Arne Babenhauserheide)
v0.8.0: full featured wisp using the scheme (read) which passes the stable 2014-11-06

full featured wisp using the scheme (read) which passes the testsuite. Requires curly infix now.

(Arne Babenhauserheide)
v0.6.6: hotfix bootstrap.sh stable 2014-10-16

hotfix bootstrap.sh

(Arne Babenhauserheide)
v0.6.5: v0.6.5 now uses the clean scheme read using wisp in the REPL. stable 2014-10-16

v0.6.5 now uses the clean scheme read using wisp in the REPL.

(Arne Babenhauserheide)
v0.6.4: this is the actual wisp-scheme. stable 2014-09-02

this is the actual wisp-scheme.

(Arne Babenhauserheide)
v0.6.3: increment version for Makefile fix. stable 2014-09-02

increment version for Makefile fix.

(Arne Babenhauserheide)
v0.6.2: release 0.6.2 - mainly an actually working wisp implementation for stable 2014-09-02

release 0.6.2 - mainly an actually working wisp implementation for scheme (only) which uses the guile reader. This should be actually correct for scheme. And match-magic ☺

(Arne Babenhauserheide)
v0.6.1: merge default for release: simpler unicode handling and honor stable 2014-08-07

merge default for release: simpler unicode handling and honor --quiet for bootstrapping.

(Arne Babenhauserheide)
v0.6.0: merge default into stable for release: stable 2014-07-14

merge default into stable for release: - Better performance - Support for SRFI-105 - Working syntax highlighting in export via wisp-mode.el - Wisp can now execute wisp-files directly via guile -L . --language=wisp file.w. - Icosahedric Advection-Diffusion example: examples/d20world.w - Draft for an SRFI - Presentatien: Why Wisp? - Working autoreconf -i; ./configure; make distcheck - Real Testsuite (./runtests.sh . .)

(Arne Babenhauserheide)
wisp-mode-0.2: release wisp-mode 0.2: Fixed the regular expressions. Now org-mode stable 2014-03-12

release wisp-mode 0.2: Fixed the regular expressions. Now org-mode HTML export works with wisp-code.

(Arne Babenhauserheide)
v0.5.11: merge default into stable stable 2014-02-23

merge default into stable

(Arne Babenhauserheide)
v0.5.10: mark bug as resolved 2014-02-08

mark bug as resolved

(Arne Babenhauserheide)
v0.5.9: merge default into stable stable 2014-01-22

merge default into stable

(Arne Babenhauserheide)
v0.5.8: merge default into stable stable 2014-01-22

merge default into stable

(Arne Babenhauserheide)
v0.5.7: merge default into stable. stable 2014-01-22

merge default into stable.

(Arne Babenhauserheide)
v0.5.6: merge repl into stable. stable 2014-01-22

merge repl into stable.

(Arne Babenhauserheide)
v0.5.5: merge default into stable for release. stable 2014-01-22

merge default into stable for release.

(Arne Babenhauserheide)
v0.5.4: we now have a real testsuite. 2014-01-22

we now have a real testsuite.

(Arne Babenhauserheide)
v0.5.3: Integrated bootstrapping with autotools. 2014-01-08

Integrated bootstrapping with autotools.

(Arne Babenhauserheide)
v0.5.2: make files containing only a hashbang work 2014-01-07

make files containing only a hashbang work

(Arne Babenhauserheide)
v0.5.1: resolved bug for general paren-prefixes (since it’s solved). 2014-01-07

resolved bug for general paren-prefixes (since it’s solved).

(Arne Babenhauserheide)
v0.5: remove debugging output. 2013-09-13

remove debugging output.

(Arne Babenhauserheide)
v0.4: aside from some necessary workarounds (check for FIXME in the file), 2013-09-10

aside from some necessary workarounds (check for FIXME in the file), wisp-guile.w can now parse itself: python3 wisp.py wisp-guile.w > wisp-guile.scm && guile wisp-guile.scm wisp-guile.w > 1 guile 1 wisp-guile.w > 2 diff 1 2 YAY

(Arne Babenhauserheide)
v0.3.1: FIX: comments containing a closing parenthesis could break the 2013-08-08

FIX: comments containing a closing parenthesis could break the parser → the linebreak-killing-code in brackets had to be aware of comments.

(Arne Babenhauserheide)
v0.3: increase wisp-multiline version to 0.3 2013-07-24

increase wisp-multiline version to 0.3

(Arne Babenhauserheide)
v0.2: take code from stdin with the argument - and save it to a file with 2013-03-26

take code from stdin with the argument - and save it to a file with the option -o FILE.

(Arne Babenhauserheide)
v0.1: added inline : to the example. 2013-03-21

added inline : to the example.

Readme

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 homoiconic3, generic4, and backwards-compatible5. 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

Usage

  • Get wisp: hg clone http://draketo.de/proj/wisp
  • Bootstrap: cd wisp && autoreconf -i && ./configure && make
  • Preprocess files: guile ./wisp.scm infile.wisp > outfile.scm
  • Wisp at the REPL: guile -L . --language=wisp # run this in the wisp-folder

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

Notes

Standardization: Wisp is standardized as SRFI 11912.

Copyright: 2013--2015 Arne Babenhauserheide

License: GPLv3 or later


  1. 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/

  2. 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. 

  3. Wisp is homoiconic because everything you write gets turned into lisp which is homoiconic. 

  4. 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. 

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