gulcii: graphical untyped lambda calculus interactive interpreter

[ compilers-interpreters, gpl, program ] [ Propose Tags ] [ Report a vulnerability ]

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.


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.2.0.1, 0.2.0.3, 0.3
Dependencies base (>=3 && <6), cairo (>=0.11 && <0.14), containers (>=0.3 && <0.6), filepath (>=1.1 && <1.5), gtk (>=0.11 && <0.15) [details]
Tested with ghc ==8.2.1
License GPL-2.0-only
Author Claude Heiland-Allen
Maintainer claude@mathr.co.uk
Category Compilers/Interpreters
Home page https://code.mathr.co.uk/gulcii
Source repo head: git clone https://code.mathr.co.uk/gulcii.git
this: git clone https://code.mathr.co.uk/gulcii.git(tag v0.3)
Uploaded by ClaudeHeilandAllen at 2017-10-23T21:41:52Z
Distributions
Reverse Dependencies 1 direct, 0 indirect [details]
Executables gulcii
Downloads 2696 total (4 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs not available [build log]
Last success reported on 2017-10-23 [all 3 reports]

Readme for gulcii-0.3

[back to package description]

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