Skip to content
ufraan
← Back

Tail

A tiny language that turns function calls inside out - arguments first, function name last. C11, zero dependencies.

CLanguageInterpreter
Aug 2026GitHub

Tail is a small language with one opinionated idea: the function call is written backwards. Instead of calling print on a hello world string, you write the hello world string first and print as the argument - the arguments come first and the function name goes last, in parentheses.

Task scheduler with retry and DLQ flow
Task scheduler with retry and DLQ flow

So hello world followed by print gives you print of hello world, and ten and twenty followed by add gives you add of ten and twenty. Chaining falls out of the syntax for free: each call's result becomes the next argument, so squaring twice reads as two calls in a row and gives you sixteen, and upper followed by print works the same way.

Unquoted text is a string literal, so hello world needs no quoting ceremony at all. There are five built-ins covering print, square, add, concat and upper, hash starts a comment, and every top-level expression prints its result.

The implementation is entirely from scratch in C11 - a hand-written lexer, a parser that builds an AST, and a tree-walking interpreter - with zero dependencies beyond the standard library. It compiles to a single native binary, runs a source file or reads from stdin, and ships with a test suite. Built as an exercise in writing a language end to end without reaching for a parser generator.