Est. 2004 Advanced

Wrapl

Raja Mukherji's one-man language: Icon-style goal-directed evaluation, Modula-3 modules and Cecil-style multiple dispatch, compiled straight to x86 machine code in memory by a loader called Riva - built and rebuilt from 2003, released as 1.0 in 2008, and quiet since 2019

Created by Raja Mukherji

Paradigm Multi-paradigm: goal-directed (Icon-style generators and backtracking), object-oriented with multiple inheritance, multiple dispatch, functional closures, modular
Typing Dynamic, strong; every value is an object whose type is known at run time
First Appeared 2004 (SourceForge project registered September 2003; first download named wrapl November 2005)
Latest Version Wrapl 2.1 build 1147 (20 December 2010) was the last packaged release; development continued in Git until November 2019

Wrapl is a dynamically typed, goal-directed, multiple-dispatch programming language written largely by one person, Raja Mukherji, over roughly sixteen years. It is unusual twice over. First, it took Icon’s most distinctive idea - that an expression may produce no values, one value, or a stream of values, and that failure downstream can resume a generator upstream - and grafted it onto a modular, class-based, multiply-dispatching object system of the kind Modula-3 and Cecil supplied. Second, it never had a bytecode interpreter: Wrapl source is compiled to x86 machine code in memory by a loader called Riva, which also loads native shared libraries and a custom binary module format of the author’s own design.

Almost nothing about Wrapl was ever written by anyone but its author. There are no papers, no conference talks, no third-party implementations, and, so far as the public record shows, no users apart from Mukherji himself. What survives is a documentation site, a SourceForge file archive whose dates run from 2004 to 2010, a Git repository whose commits stop in November 2019, and a name whose expansion the author explained himself.

History and Origins

The name is an acronym with an apology attached. From the pre-2008 website:

The rapl in Wrapl stand for Raja’s Attempt at a Programming Language and is simply my attempt at designing and implementing my own programming language. The extra w stands for Was and is simply there to avoid confusion with an existing language called RAPL.

The same page is the clearest statement of the language’s parentage that exists:

The current and most likely final version of Wrapl gets its goal directed evaluation and high level data types from the Icon programming language, while it gets its modularity from Modula-3. Both languages were used to implement a Wrapl compiler at some stage. Although multiple dispatch in Wrapl was conceived and implemented independently, it was refined after using Cecil to implement a compiler for Wrapl.

That sentence also explains why the language’s dating is so slippery. Wrapl was not designed once and implemented once. It was implemented in Modula-3, then in Cecil, then - in a rewrite announced on 3 April 2006 with a promise that it was “my final complete rewrite, I promise” - in C. Each implementation left marks on the design: the compiler host language kept becoming the next source of ideas.

The public traces begin in September 2003, when the SourceForge project was registered, and become visible in 2004, when the project website first appears in the Internet Archive and the first file lands in the download area. The first download actually named wrapl is version 0.0.2, uploaded on 17 November 2005 - a version number that tells you exactly how the author regarded the state of the system at that point.

The 2006 rewrite is the hinge of the project. It produced Riva, and Riva is really the reason Wrapl looks the way it does. The old system had built types and functions into the compiler and could only load .dll or .so modules, which meant a memory indirection on every use of an imported symbol. The new one moved every type out of the compiler into binary modules, and, according to the 2006-2007 news log, experimented with NASM’s RDOFF format (via a patched assembler, because Wrapl symbols may contain characters NASM would not accept, and a patched build of David Lindauer’s cc386 to emit suitable sources), and then discarded that in favour of a purpose-built .riva file format with multiple code and data sections, per-module import tables, and a linker, rlink, that eats ordinary GCC object files.

By 30 November 2006 development had moved from Windows to Ubuntu Linux on a Pentium M, rlink understood ELF, a GTK+ binding was under way, and the author had set himself a milestone: finish the binding, release 1.0. He hit it in 2008, in a burst that took the language from 0.9.3 in June to 1.1.5 in September. Releases continued through 2009 and 2010, ending with 2.1, build 1147, on 20 December 2010 - after which the language kept being developed for nine more years without ever being packaged again.

Design Philosophy

The website reduces Wrapl to five bullets: object-oriented, multiple-dispatch, pass-by-reference, functional closures, goal-directed. The last is the one that reorders everything else.

Expressions produce streams, not values. In Wrapl there is no boolean type doing the work of control flow. Comparison operators succeed and return their second argument, or fail:

--> 10 < 20;
20
--> 10 > 20;
failure

An expression may also produce several values in succession - 10 | 20 produces 10, then 20 if resumed - and ALL expr collects everything an expression can produce into a list. Put the two together and comparison becomes a filter:

--> 10 < (5 | 15);
15
--> 10 > (5 | 15);
5

BACK is the expression that produces nothing at all, and conditionals are written cond => expr1 // expr2, with either arm optional and BACK supplied for the missing one. This is Icon’s success/failure model essentially intact, including the backtracking: if a later part of an expression fails, an earlier part may be resumed, and evaluation restarts from there.

Everything that is not a declaration is an expression. Loops are REP body, terminated by EXIT value expressions inside the body; WHILE cond and UNTIL cond are defined as sugar for cond // EXIT NIL and cond => EXIT NIL, and STEP restarts the iteration. The loop itself produces the value the EXIT produced.

Dispatch is on the types and values of every argument. Methods are not owned by classes. METH :method(sig) IS expr - the older spelling is TO - adds an implementation for a signature in which each position is either @type (match a type) or =value (match a specific value). Types form a multiple-inheritance hierarchy, and because dispatch is symmetric across arguments, extending an operator to a new type is a matter of adding a method with the appropriate signature, from anywhere.

Exceptions are just messages, and are not only for errors. SEND value transfers control to the current handler; RECV name DO expr installs one for the enclosing block. Entering a handler restores the previous handler, so a handler that does not recognise a message re-sends it. The documentation’s own example catches Symbol.NoMethodMessageT to give a string conversion a fallback.

Key Features

FeatureForm
ModuleMOD Name;END Name. - one source file, one Riva module
ImportIMP IO.Terminal USE Out;, or IMP Dir.File AS Name;
Exporta trailing ! on the declaration: DEF f!(x) …
DeclarationsVAR x <- v; (assignable, NIL by default), DEF k <- v; (constant, initialiser required)
Assignmentx <- v and the reverse form v -> x; $ inside the right-hand side denotes the current value
Functions<x, y> x + y - first class, closing over enclosing scopes for both reading and writing
Generationexpr1 | expr2, ALL expr, UNIQ expr, SUSP, EVERY, SKIP
Conditionalscond => then // else
LoopsREP (…) with EXIT, WHILE, UNTIL, STEP
MethodsMETH :name(a @ T, b @ T) expr (multiple dispatch; TO is the older keyword)
Type literalDEF T! <- <[Parent] field, field>;
Conversion10 @ String.T, "123" @ Integer.T
Type query?expr
Identityexpr1 == expr2 and expr1 ~== expr2, which succeed by returning the second operand
MessagesSEND value, RECV name DO expr
Aggregates[a, b, c] lists (1-based, negative indices, assignable references), {k IS v} tables

Keywords are all upper case and reserved: VAR, DEF, REP, EXIT, STEP, YIELD, WHILE, UNTIL, ALL, EVERY, DO, IS, RET, SUSP, NIL, BACK, FAIL, IMP, USE, AS, IN, OF, MOD, TO, RECV, SEND, NOT, WHEN, END, SKIP, WITH, UNIQ, SUM, PROD, COUNT. Integers are arbitrary precision, courtesy of GMP; reals are 64-bit; strings support interpolation in single quotes, so '10! = {Fact(10)}' is a formatted line.

From version 1.2.7 (August 2009) the loader also accepted Unicode spellings of several keywords and operators - the set-membership sign for IN, a left arrow for <-, the empty set for NIL, the multiplication and division signs for * and / - with wredit converting the ASCII forms as you typed them.

Two short programs give the flavour. Hello world, in full:

MOD Hello;

IMP IO.Terminal USE Out;

Out:write("Hello world!");

END Hello.

And the generator from the samples page that produces every prime number, a sieve written as a single resumable expression:

DEF Primes() (
	WITH store <- [] DO EVERY store:put(SUSP 2:up \ NOT ($ % store:values = 0));
);
--> ALL 10 OF 10 SKIP Primes();
[31, 37, 41, 43, 47, 53, 59, 61, 67, 71]

The site’s own comment on that one is “How it works is left as an exercise to the reader :)”.

Riva and the Toolchain

Wrapl is one component of a system that is mostly infrastructure. The pieces, all documented on the site:

  • riva - the module loader and the program you actually run. It loads .riva binaries, native shared libraries, and directories (as modules exporting their contents), and additional loaders can register themselves for other file types: the Wrapl loader compiles .wrapl source on demand, and a Glade loader turns GTK+ UI files into modules. Its behaviour comes from a riva.conf beside the executable - search path, preloaded modules, arbitrary key/value configuration readable at run time from Sys.Config.
  • wrapl - the REPL, built on Wrapl.Loader.SessionT, with a line editor, _ bound to the last result, and the ability to act as, or connect to, a session server over a socket or a Unix socket file.
  • rlink - the linker that produces .riva binaries from GCC object files and libraries. Its scripts are Lua programs with predefined export, import, module, prefix, require and include functions.
  • wrpp - a preprocessor written in Wrapl, whose full source the samples page prints.
  • wredit - the GTK+ editor written in Wrapl.
  • rabs - the build system, added in 2018, scripted in Minilang.

Because the interpreter generates machine code rather than bytecode, the build has an unusual shape: it needs NASM or YASM, GCC, Lua (both the interpreter, to generate the runtime assembler with DynASM, and liblua, for rlink), gperf for the scanner, and libbfd from binutils for the linker. The build then downloads and builds its own copies of the Boehm-Demers-Weiser garbage collector, GMP, Boost, udis86, igraph, Tecla and the FastCGI development kit, and links them for Wrapl’s use alone.

Platforms

The documentation is unusually candid here, and its statement should be taken as the limit of what can be claimed. The download page says that Wrapl “only builds on 32 bit versions of Linux, but will run on most 64 bit versions of Linux once built with proper multilib support”, and lists the distributions it has been tested on as Manjaro and Arch, Ubuntu, Red Hat Enterprise Linux and Fedora. The same page’s binary section is marked obsolete, notes that no binary packages are currently available, and describes the Windows package - built with Cygwin, without the GTK+ modules - as experimental. Historically, .deb packages and a Windows .exe installer were published on SourceForge between 2008 and 2010, and the 2006 news log states there were never plans to target any architecture other than x86. The Dockerfile in the repository, which was read but not built for this page, builds inside a 32-bit Debian image and ships the result on top of a 64-bit Debian with i386 libraries.

Evolution

The release record divides cleanly in three.

2003-2007, the rebuilds. No stable artefact, a language implemented three times in three host languages, and one public download numbered 0.0.2. The interesting output of this period is not a release but an architecture: Riva, the .riva format, and rlink.

2008-2010, the releases. At least twelve dated packaged versions in thirty months, from 0.9.3 to 2.1 (the jump from 1.0.1 to 1.0.8 suggests a few more that the file archive does not record). This is when Wrapl acquired most of what a working language needs: the GTK+ bindings that were the stated precondition for 1.0, an editor, a preprocessor, a library tree spanning Agg, Alg, DB, Fmt, Gcc, Gir, Gmp, Html, IO, ML, Math, Net, Num, Snd, Stat, Std, Sys, Util, Web and Wrapl namespaces, bignums, threads, MySQL and FastCGI bindings, and lazy relocation of module text sections, which the news log describes as avoiding the loading of modules reached only through uncalled methods.

2011-2019, the private decade. A bare handful of news items in nine years. No packaged release after December 2010. And yet the Git history shows the most intense development of the project’s life in 2018 and 2019 - 389 commits across those two years, nearly all of them titled simply “Updates” - along with a move to GitHub, a new build system, GObject-introspection-generated bindings, and Docker images including a Jupyter notebook kernel. The work continued; the releasing stopped.

Current Relevance

Wrapl is dormant. The last commit on master is dated 22 November 2019, the documentation site has not been rebuilt since July 2019 and still carries a 2008-2018 copyright line, the news page ends in 2018, and the last packaged release is nearly sixteen years old. The GitHub repository has a handful of stars. Category:Wrapl on Rosetta Code holds seven tasks.

What did not stop is the surrounding tooling. Rabs, written to build Wrapl and then deliberately generalised, and Minilang, the small embeddable imperative language extracted from it, are both still maintained in the same GitHub organisation; Minilang was receiving commits in September 2026, has attracted noticeably more attention than Wrapl ever did, and is positioned as an embeddable scripting language for C and C++ applications with a safe VM, source-level debugging and stackless execution. Minilang makes no claim to be Wrapl’s successor, and its syntax is not Wrapl’s. But the shape of the career is legible: the author spent some sixteen years building a large, ambitious, x86-only language of his own, and then turned to the small, portable, embeddable piece of it that other people could actually use.

For anyone wanting to see the language today, the practical route is the wrapl/wrapl Docker image published by the project in November 2019, or a build from source on a 32-bit-capable Linux toolchain - with the caveat that a build which downloads and compiles seven third-party libraries against a 2019 Debian is not a casual undertaking in 2026.

Why It Matters

Wrapl is a data point about a rare design combination and about a rarer kind of project.

The combination is goal-directed evaluation plus multiple dispatch. Icon’s generators and failure-driven control flow have been borrowed many times - Unicon, Object Icon, Converge, Python’s generators at one remove - but almost always into languages whose object model, if they have one, dispatches on a single receiver. Wrapl instead made dispatch symmetric across all arguments and made every expression a potential stream, so that a method call is simultaneously a generator and a multi-method. That the resulting semantics could be compiled directly to machine code, without a bytecode interpreter in between, is a genuinely interesting claim; that the compiler only ever targeted x86 is the price of it.

The project is the more instructive part. Wrapl was built in public for sixteen years by one person who wrote not just a language but a loader, a binary format, a linker, an editor, a preprocessor, a build system, GTK+ bindings and a Jupyter kernel for it, and who was honest throughout about what it was: “Raja’s Attempt at a Programming Language”. It is a complete example of the class of language that fills the long tail of any encyclopedia - too finished to be a toy, too personal to be adopted, and eventually abandoned not because it failed but because its author’s attention moved to the one piece of it that was small enough to travel.

Timeline

2003
The Wrapl project is registered on SourceForge on 16 September 2003, with Raja Mukherji and Cian O'Flynn as its developers and a one-line summary - "Very high level modular programming language with multiple dispatch, object-oriented programming, functional closures and goal-directed programming" - that the project would still be carrying two decades later
2004
The project website at wrapl.sourceforge.net first appears in the Internet Archive on 9 June 2004; the page design carries a 2004 copyright. The oldest file in the project's download area, YAR-1.4.2.tar.gz, is dated 6 September 2004
2005
The first download actually named wrapl - version 0.0.2, as a tarball and a zip - is uploaded on 17 November 2005
2006
On 3 April 2006 Mukherji announces that he has rewritten the whole system, this time in C, "for portability", and names the new loader Riva. The language itself, he writes, "has not changed at all, so I've finally reached some degree of stability". Riva introduces the custom .riva binary module format and the rlink linker that produces it. A source-level debugger is previewed on 18 May 2006
2006
A news item of 30 November 2006 records that development has moved from Windows to Ubuntu Linux, that rlink now accepts ELF object files from GCC, and that a GTK+ binding has been started - completing it, Mukherji writes, would be the trigger for a 1.0 release. The same item states flatly that there are "no plans to target any architecture other than x86"
2008
The website is rebuilt on 23 May 2008 as static HTML generated by Wrapl scripts. A rapid run of releases follows - 0.9.3 and 0.9.4 in June, 1.0.1 in July, 1.0.8, 1.0.9 and 1.1.0 in August, 1.1.5 in September - taking the language past the 1.0 mark it had been aiming at since 2006
2009
Version 1.2.7, released 27 August 2009, adds Ctrl+C interruption to the interactive interpreter and a table of Unicode equivalents for keywords and tokens, so that IN may be written as the set-membership sign, <- as a left arrow, NIL as the empty set and ~= as the not-equals sign. A source editor, wredit, written in Wrapl on the GTK+ bindings with syntax highlighting and autocompletion, arrives alongside it
2009
On 30 November 2009 the versioning scheme changes to major.minor.revision, where the revision is the Subversion revision number - which is why later downloads carry names such as wrapl-1.9.1074 and wrapl-2.1-1147. A fortnight later, on 15 December 2009, text sections in .riva modules become relocatable on first use, so that a module referenced only by an uncalled method is never loaded at all
2010
Version 1.7 is released 25 February 2010 and 1.9 on 30 May 2010, the latter with an updated Windows port. Version 2.1, build 1147, is uploaded on 20 December 2010; it is the last file the SourceForge project ever receives
2017
The project moves to GitHub. The wrapl/wrapl repository, created in August 2016, absorbs the Subversion history in a run of commits titled "Import into git" and "Still importing from SVN" between January and March 2017, and the documentation site is re-hosted at wrapl.github.io
2018
A news item of 19 March 2018 records that "the build process for Wrapl has been simplified after switching to a new build system called rabs" - Rabs being a general-purpose parallel build tool that Mukherji wrote for Wrapl, scripted in a small imperative language of his called Minilang. It is the last entry the news page ever gets
2019
The busiest years of the Git repository are 2018 (231 commits) and 2019 (158), almost all of them under the message "Updates". The last commit on master is dated 22 November 2019; Docker images wrapl/wrapl and wrapl/jupyter are pushed the same week, and the repository is last pushed to on 14 January 2020

Notable Uses & Legacy

MusicDisruption

The language's own home page states that "the entire backend for the online music creation and sharing platform MusicDisruption is written in Wrapl". This is the author's claim about his own project and the only application of Wrapl named anywhere on the site

wredit, the Wrapl editor

A GTK+ source editor written in Wrapl itself on the language's own GTK+ bindings, with syntax highlighting via GtkSourceView, autocompletion, and automatic conversion of ASCII sequences into the Unicode operator forms the language accepted from version 1.2.7 onwards. It was reportedly distributed as a separate package alongside the interpreter during the 2009-2010 release run

wrpp, the Wrapl preprocessor

A template preprocessor written in Wrapl and distributed with it; the samples page reproduces its entire source. It embeds a Wrapl session in a text stream, which is how the project's own static website was generated from 2008 onwards

Rabs and Minilang

Rabs, an imperative parallel build system, was written to build Wrapl and then generalised - "Rabs was designed from the ground up to be completely agnostic to any programming language or use case" - and its scripting language, Minilang, was extracted as an embeddable language in its own right. Both outlived Wrapl: Minilang, in the same GitHub organisation, was still receiving commits in September 2026

Rosetta Code

Wrapl has a small presence in the comparative-programming corpus: Category:Wrapl holds seven article-space pages of task solutions, which are for many readers the only Wrapl code they will ever encounter

Language Influence

Influenced By

Icon Modula-3 Cecil

Running Today

Run examples using the official Docker image:

docker pull wrapl/wrapl:latest

Example usage:

docker run --rm -it wrapl/wrapl wrapl
Last updated: