--- title: lang related: - "[nvim-lu](nvim-lu.md)" - "[yaci](yaci.md)" categories: - Languages and compilers --- **lang** is the home of **Lu**, a programming language I'm designing, and its compiler. The main repository is on [Codeberg](https://codeberg.org/hugocoto/lang); 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 - [Codeberg repository](https://codeberg.org/hugocoto/lang) - [GitHub mirror](https://github.com/hugoocoto/lang) (zlib) - [nvim-lu](nvim-lu.md): syntax highlighting for Neovim