Languages Zoo
As long as I can remember I have loved the process of defining, designing, and implementing my own programming languages. I’ve created so many languages that you could say that I’ve created something of a programming languages zoo. Below you’ll find a list of the languages that I’ve created over the years and those that I’m thinking about currently.
Active projects
Project | Status | Synopsis | Impl langs | Next Goals |
---|---|---|---|---|
Clojure | maintainer | The Clojure programming language | Java + Clojure | [ ] keep rockin’ |
Cribbaj | delimiting | An implementation of Forth with IDE and VM | C + Ruby + Cribbaj | [ ] kernel-forth definition |
Folog | prototyped | An Prolog implementation | Common Lisp | [ ] port to CLJ |
Quincunx | prototyped | A small functional language with FEXPRs | Clojure -> C | [ ] read and annotate Shutt |
Incal | documenting | Minimal implementation of the J language | C | [ ] org-mode babel |
Ix | dev | An OO language with production rules | C + Ix | [ ] test harness [ ] vectors |
Juxt | prototyped | A functional concatenative language | Java + Juxt | [ ] reader impl |
Lithp | released | An implementation of McCarthy’s original LISP w/ macros | Python + Lithp | [ ] perpetual hacking |
Minderbinder | prototyped | An RPN command line calculator with units of measure | Python / Clojure | [ ] define uom specs |
µPy | dev | A very small implementation of Python | C + Python | [ ] decorators |
Clojure
I’ve been a full-time member of the Clojure core team for two-years and have worked to maintain, fix, and enhance the language and ecosystem. I certainly would not say that Clojure is “my” language, not even a little bit, but I have contributed enough to warrant mention. Perhaps one day when the Clojure history book is written I will get a paragraph.
Cribbaj
Cribbaj is a Forth implementation that’s intended to start with the Forth-83 spec and expand into a more modern and portable implementation. The ideas that I would like to explore with Cribbaj are meta-compilation, meta-programming, kernel-Forths, IDE design, and batteries-included language implementation. The historical precedents for Cribbaj include: KAMAS, Forth-83, MMSForth, FIG Forth, and colorForth.
Some references that I’m using for design include:
- Thinking Forth (pdf) by Brodie
- Threaded Interpretive Languages by Loeliger
- Forth: A Text and Reference by Kelly and Spies
- Designing & Programming Personal Expert Systems by Townsend Feucht
- Object-Oriented Forth: Implementation of Data Structures by Pountain
- “Programming a 144-computer chip to minimize power” by Chuck Moore
- “Moving Forth” by Brad Rodriguez
- “Dynamic Typing and NaN Boxing” by Leonard Schütz
Some thoughts and ideas about the direction that I’ll take Cribbaj is found in my thunks repo.
Folog
Folog started as a fork of Hideyuki Nakashima’s PPiCL – an elegant and mind-warping little interpreter. I added extensions such that I could in turn implement a little LISP in the language but I have not taken it further. Eventually I would like to port the original logic to Clojure and occasionally hack on it toward that goal.
Quincunx
Quincunx is currently implemented as a mini interpreter written in Clojure. The purpose was to better understand FEXPRs, and while I think that goal was achieved, it would be nice to take it further. The natural path is toward the Kernel language, but some study needs to happen on my part before I can proceed. I would like to create a small interpreter in C and explore simple GCs, but that is further in the future.
Some references that I’m using for design include:
- LISP 1.5 Programmer’s Manual (pdf) by McCarthy, et al.
- “vau-calculi and the theory of fexprs” by John Shutt
- “The Theory of Fexprs is Trivial” by Mitchell Wand
- John Shutt’s blog archive
- “Small objects and pointer tagging by Max Bernstein
Incal
This started as the original C implementation, J Incunabulum but I took the effort to translate the code into a style that fits my own style. Many similar efforts have since happened over the years but this one is mine. I would like to eventually make a literate version of this.
Ix
Ix is a language that I’ve been hacking on for 20 years. The seed of Ix is found in CLIPS, especially in the COOL subsystem. The central conceit of Ix is this: can we mitigate the complexity of object-oriented programming by describing and scoping instance mutation in-terms of production rules?
Some references that I’m using for design include:
- Expert Systems: Principles and Programming by Giarratano and Riley
- Smalltalk-80: the language and its implementation (pdf) by Goldberg and Robson
- Object-oriented Programming with ANSI-C (pdf) by Axel-Tobias Schreiner
- Semantic Web for the Working Ontologist by Deam Allemang
- Efficient Polymorphic Calls by Karel Driesen
- “Smalltalk-72 Instruction Manual” (pdf) by Goldberg and Kay
- “Production Matching for Large Learning Systems” by Robert Doorenbos
Ix has been rewritten no less than three times and has gone from a Smalltalk-like system to a Lisp-like system to something in-between. I will probably hack on this until I die… in fact, it might kill me.
Juxt
Juxt is very much inspired by Joy but I would like to incorporate some of the ideas in Clojure. A prototype was written in a weekend and allows code such as below:
/swoncat (A B : B A)! cat/
/Y ($cons) swoncat $cons i/
The code above implements the Y combinator and if you know Joy then you’ll understand that the functions cat
and $cons
are list manipulation operators. Indeed, Juxt (like Joy) uses quotations as its lambda representation, which are simply lists that may or may not have some context attached to them. If I were to describe Juxt in one sentence it would be: a homoiconic, functional, stack-based, concatenative programming language with: lexical scope, closures, tail-recursion, a stack-effects mini-language, first-class environments, destructuring, modules, metaprogramming support, dynamic type checking, and Java interoperability. The simplicity of the language is such that the kernel was written in a weekend and further features like modules, recursion, lexical binding, and shuffle operators were written over time in Juxt.
Some references that I’m using for design include:
- “Recursion Theory and Joy” by Manfred von Thun
- “The Algebra of Joy” by Manfred von Thun
- Arrows, Structures and Functors: The Categorical Imperative by Michael Arbib
- The Architecture of Symbolic Computers by Peter Kogge
- To Mock and Mockingbird by Smullyan
- “Can Programming be liberated from the von Neumann Style?” by J.W. Backus
- “Clean — a Language for Functional Graph Rewriting” by van Leer and Plasmejer
Lithp
Lithp is an implementation of an interpreter for the original LISP as described by John McCarthy and the macro system described later by Timothy Hart. The interpreter implements the following seven functions:
atom
car
cdr
cond
cons
eq
quote
and also two special forms:
label
lambda
Using these functions I also implemented a Lithp interpreter in Lithp itself that implements the same 9 features and also added a macro
special form.
Minderbinder
Minderbinder started as a Clojure library of the same name providing unit of measure conversions. However, over time it took on a life of its own and has since morphed into a command line RPN calculator supporting bignums and unit of measure awareness. It’s not a general solution yet and needs some work to be usable by someone other than myself.
Some references that I’m using for design include:
µPy
µPy is a spike of tinypy by Phil Hassey that I at one time considered for the front end to Ix (mentioned above). However, I never went that far and instead left in some of the features that Ix and later Python had, including:
- Tuples
- MOP
- Advice
- A very hacky form of predicate dispatch
I don’t know how far I will go with this.
Some references that I’m using for design include:
- The Art of the Metaobject Protocol by Kiczales, des Rivieres, and Bobrow
Paused projects
Project | Status | Synopsis | Implementation | Eventual Goals |
---|---|---|---|---|
370 ASM | lost | An assembler for a subset of IBM 370 assembly | C | [ ] invent time machine |
Baysick | released | A embedded BASIC DSL | Scala | [ ] make work in Scala.latest |
Eleusis | prototyped | An implementation of microKanren | Clojure | [ ] speed up unification |
Mouse | lost | An implementation of the Mouse programming language | C64 BASIC | [ ] invent time machine |
Pascal | lost | A compiler for a subset of Pascal that targets a simple VM | C | [ ] invent time machine |
Russ-Forth | released | A teeny-tiny Forth-esque | Ruby | [ ] stdlib |
Tori-Lisp | released | Small functional programming language | JavaScript + Tori-Lisp | [ ] in-broswer IDE |
μLithp | released | A micro LISP implementation in 24 lines | Ruby | [ ] interop |
370 ASM
This was an IBM System/370 assembler that I wrote in college. It has been lost to the dustbin of history.
Baysick
Baysick is a Scala DSL that allows embedded BASIC-like syntax. It worked on a version of Scala circa 2009 but has not been maintained since.
Eleusis
Like everyone in the Clojure community, I also created an embedded microKanren library. Eleusis was slightly different in that I also implemented a REPL that read microKaren forms and executed them.
Some references that I’m using for design include:
- “µKanren: A Minimal Functional Core for Relational Programming” by Hemann and Byrd
- “A Gentle Introduction to MicroKanren” by Erik Derohanian
Mouse
Possibly my first language was a janky implementation of the Mouse programming Language on my old Commodore 64. I doubt that I implemented the whole language but the parts that I did were simple because the language can be implemented by simply walking an array of bytes and calling dispatch subroutines for each byte. In all likelihood I only implemented the mathematical operators and possibly variables.
Pascal
Also in college I implemented a 1-pass Pascal compiler that targeted an intermediate quadruple language and a little interpreter for that IL.
Russ-Forth
I implemented Russ-Forth years ago after being nerd-sniped by my old-friend Russ Olsen.
Tori-Lisp
Tori-Lisp is a code riff that I created from from Mary Rose Cook’s lovely Little Lisp. The central conceit was: what would you need in a Lisp that didn’t have macros but felt like it did?
μLithp
μLithp was an experiment to see if I could create a Lisp-like interpreter in less than 30 lines of Ruby. It took 24.
There are certainly more than those listed above, but any additional exist only on dusty archives and not in my brain case. I can only hope that they bubble to the surface one day.
:F
4 Comments, Comment or Ping
Kartik Agaram
Regarding Quincunx
10 years ago I implemented Wart[1] after reading Shutt’s thesis and having a long conversation on the Arc Forum[2] about it. Wart supports f-exprs. Macros are first class, there’s syntax to specify for each arg of a function whether you want it evaluated or not.
However, I went in the opposite direction from Kernel in one important way. Kernel is super concerned about hygiene and got rid of backquote and unquote. I am supremely unconcerned about hygiene and strongly encourage the syntax for backquote and unquote; keeping them lets Wart be smarter than Kernel in some corner cases. Where Kernel considers
apply
a pure applicative, Wart can pass macros to apply (called@
). The result is a language that radically encourages any symbol to be rebound and renamed and overridden, while hiding the parts that can’t be rebound behind special punctuation: quote, unquote, backquote, backquote-splice, and apply (which I call splice).Anyways, it’s around if you’re interested, and I’d love to have you poke holes at it.
[1] https://github.com/akkartik/wart
[2] http://arclanguage.org/item?id=15659
Jun 2nd, 2023
Stefane Fermigier
Is there a public repo for µPy ?
I’d be interested in checking it out.
Jun 8th, 2023
fogus
@Fermigier there is not public repo currently. the effort started as a way to plug the Ix class system into tinypy and so it’s a huge mess. in practice it’s likely less useful than modern versions of tinypy.
Jun 9th, 2023
Egg Syntax
‘The central conceit of Ix is this’
What a great bit of usage! I’ve never seen anyone choose ‘conceit’ for that, but it’s an excellent fit.
If you’re planning to annotate Shutt for public consumption, I’d be happy to be a beta reader. I’ve been intermittently interested in fexprs and Kernel for some years now, but have never taken that interest very far.
Jun 13th, 2023
Reply to “Languages Zoo”