Quark

A Functional

Purely Homoiconic

Concatenative Language

Quark is a microscopic stack based programming language with a focus on minimalism and flexibility. Quark is concatenative and functional like Factor, has pattern matching and symbols like Erlang, and has a syntax that is completely homoiconic like Lisp. Quark's core principle is to bootstrap as much of the language as possible. Thus the entire language is currently described by a mere, 22 functions.

Quark is a language for recreational programming. It doesn't attempt to solve any particular problem, instead Quark optimizes for code beauty. You won't get better performance, enhanced readability, or type checked safety by using Quark. However Quark allows for the specification of computation in a compact and highly elegant manner.

Quark doesn't have subtraction by default, here's how it's implemented in the Prelude:

[ -1 * + ] :- def

Also, unlike its concatenative neighbors Factor or Joy, Quark doesn't have stack manipulation functions built in. Instead it defines them in itself with pattern matching quotes:

[ x | ] :drop def
[ x | x x ] :dup def
[ x y z | z x y ] :rot def

Here's the "if" function definition from the Prelude:

[ [ :true x | x call ] [ z x | ] ] :if mdef

Quark currently has implementations in Haskell and Ruby. The Haskell interpreter serves as the official reference implementation.

Quark (Haskell)

github →

RQuark (Ruby)

github → or install with rubygems: gem install rquark