Learn
Learn Loment
There are three places to look, and the strongest one is a toolchain that explains itself: it can print the whole language, list every built-in function there is, and tell you what any error code it gives you means. This page gives the order that makes sense, and puts what each step is missing next to the step.
What is missing is teaching, not material. The manual is a reference rather than a tutorial, and it is written in Chinese; so are the design records. Where a resource below is incomplete, or has never been used the way you are about to use it, this page says so rather than letting you find out.
Run something before you read anything
Nothing here needs to be understood first. Install the package from the latest release — on Windows take the zip, not the installer — and the command that writes you a starting point is itself a Loment program:
$ loment new hello # writes hello.lomt; it will not overwrite one$ loment run hello.lomt # compile, link, run — the exit code is the program's
The compile-and-run path needs no Python, no clang and no WSL. What it produces and why is on Get started; the two kinds of program it can produce are on the front page.
The language, in one sitting
The whole language is available as one commented file, and the command that prints it ships with the toolchain rather than living on this website. Read it top to bottom once and you have seen every construct there is — the language was built to survive that, rather than to be learned a feature at a time.
There is also a written guide, and it is self-contained on purpose: the copy inside the installed package is the same file as the one in the repository, so it can be read with no network, and the project's criterion is that the two stay identical.
$ loment example tour # the language as one commented source file$ loment skill --print # the written guide, printed in full
Two things about that first command, before you run it. The comments in the tour are in Chinese, and on the currently published release that particular file does not link — it is a known defect in the self-hosted linker, and the four programs on the examples page are the ones verified to run. The guide printed by the second command is in English.
Look things up without leaving the terminal
This is the part that is genuinely unusual, and it is worth trying even if you have no intention of using the language. The toolchain is the reference. Every one of these reads from the installed package, so they work with no network, and they answer about the version you actually have rather than about whatever the website last said.
$ loment cheat # the whole language on one page$ loment syntax # the syntax on one page$ loment builtins # every built-in function there is$ loment keywords # the reserved words$ loment explain E4 # what a diagnostic means, and what to change
The last one is the one to remember. An error code on its own is a number; the toolchain
holds the sentence that goes with it, and will tell you what the compiler was objecting to
and which way to move. loment help with no argument lists the rest, and the
wiki has the long form.
Look things up in writing
The manual
Built from the compiler and the bundled examples, and shipped in the repository: the specifications, and an API reference for every example module. It is written in Chinese, and it is a reference rather than a tutorial — it tells you what a thing is, not what to do with it.
The wiki
The same material as this site, arranged as an encyclopedia of the language: syntax, types, the built-in table, the reclamation tiers, the error codes, and what is deliberately different from other languages. English, and the place to go when you want one page about one thing.
The design records
Every decision in this language has a numbered document behind it, arguing the case and naming what it cost. They are written in Chinese, and they are not written for learners — but when a page here or on the wiki says "the design says so", this is where that is.
Learn by reading code
The repository carries a corpus of example programs, and the toolchain can print any of them without you opening a browser:
$ loment examples # what is bundled$ loment example demo # print one of them in full
For a gentler start, the four programs on this site are short and each one shows the output it actually produced. The full corpus is in the repository under loment/examples/, and not every file in it links today.
Let the editor help you
The VS Code extension is on the marketplace, as
hooyan2022.loment
— search Loment in the extensions panel. What the language server does is
real: diagnostics from the checker as you type, completion, go to definition, and
formatting, through the separate formatter rather than by the server itself. There are files
for Vim too, and the server speaks LSP over stdio, so any editor with a client can attach.
The extension is a client, not a compiler. It carries no toolchain: the language server, the build and the debugger all run programs out of a Loment checkout, found by walking up from the folder you have open. Install it and open a file with no checkout nearby, and you get highlighting and nothing else — worth knowing before you conclude that the extension is broken.
Three gaps worth knowing before you rely on it. There is no cross-file symbol index, so completion and go-to-definition see the current document only. The server does not declare a formatting capability; formatting is a separate program. And the project's own notes say the server has never been driven inside a real editor by hand — its tests call the same request handler directly. The debugger has gaps of its own: no conditional breakpoints, no expression evaluation, and locals are registers rather than names. The editor page on the wiki lists them in full.