Jump to content

lang

From Hugo's wiki

lang is the home of Lu, a programming language I'm designing, and its compiler. The main repository is on Codeberg; GitHub has a mirror.

Note Work in progress. Sorry, I like macros.

A taste of Lu

extern printf: int => int;
intern print_num: int => int;

0 -> (i: int) => { i -> print_num };

Values flow left to right through -> into functions (x -> f). Functions are lambdas ((a: Int) => { ... }), and a block of LLVM IR can be written inline to define a function. The design sketches in the repository (hello*.lang) also explore tagged unions, typed lists and maps, and multiple assignment.

Repository layout

Path Contents
compiler/ The compiler, with example .lu programs
docs/ Documentation, in Typst
damerau_levenshtein.c Suggests the closest word from a list; meant for compiler error hints
hello*.lang Snippets used to model the language (6 is the best)

See also