MyNixOS website logo
Description

graphical untyped lambda calculus interactive interpreter.

GULCII is an untyped lambda calculus interpreter supporting interactive modification of a running program with graphical display of graph reduction.

See README.md for the user manual.

GULCII

GULCII is an untyped lambda calculus interpreter supporting interactive modification of a running program with graphical display of graph reduction.

Syntax

Lambda calculus terms with some sugar coating:

term ::= variable                    -- free or bound
     | '\' var+ strategy term        -- lambda abstraction
     | term+                         -- application
     | '(' term ')'
     | integer
     | list
variable ::= [a-z][A-Za-z0-9]*
strategy = '.' | '!' | '?'           -- lazy | strict | copy
integer ::= [0-9]+                   -- uses Scott-encoding
list ::= '[' (term (, T)*)? ']'      -- uses Scott-encoding

There are three variants of lambda abstraction: lazy, strict, and copy:

\x . f x x    -- x is evaluated lazily with sharing
\x ! f x x    -- x is evaluated strictly and shared
\x ? f x x    -- x is copied before any evaluation

There is additional syntax sugar for natural numbers and lists, using http://en.wikipedia.org/wiki/Mogensen%E2%80%93Scott_encoding#Scott_encoding:

[0,1,2,3]

There is a small standard library based loosely around the Haskell Prelude:

:load prelude
:browse

If you define a term using free variables, they can be modified while the program is running, but sharing is lost. If you define a term as a fixed point (perhaps with Y-combinator) then sharing works (to some extent), but you can't modify the code while it is running any more.

Meta Commands

To exit type:

:quit

Entering a term evaluates it.

Terms can be bound to names, stored in a global dictionary:

foo = bar

The global dictionary can be listed or wiped clean:

:browse
:clear

Installed files can be loaded:

:load church

Machine-readable node statistics are output to stdout, as well as when free variables are instantiated by looking up their definitions. These are intended to be used for sonification, for example with Pure-data:

pd extra/gulcii.pd &
sleep 5
gulcii | pdsend 8765

The sonification is controlled by two commands:

:start
:stop

Settings

There are some runtime adjustable settings:

:get NewsOnTop
:set NewsOnTop
:unset NewsOnTop
:toggle NewsOnTop

Where NewsOnTop is a setting. Settings include:

TraceEvaluation
CollectGarbage
RealTimeDelay
RealTimeAcceleration
RetryIrreducible
EmitStatistics
EmitRebindings
EchoToStdOut
EchoToGUI
SaveImages
NewsOnTop
Metadata

Version

0.3

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows