Skip to content

Installation ​

One package, linnet-lang, holds the linnet compiler, its standard library and the Python package linnet. Install it with uv:

bash
uv add "linnet-lang[torch]"
uv run linnet --version

Pick the extras for the frameworks you use:

ExtraAdds
torchlinnet.torch: load, train and export in PyTorch, and linnet.serve
jaxlinnet.jax: load, train and export in JAX
flaxlinnet.jax.load_nnx
onnxlinnet.onnx; add onnxruntime, or onnxruntime-gpu for CUDA and TensorRT, to run models
nestlinnet.nest: models from Nest and the Hugging Face Hub
servelinnet serve: PyTorch, the Hub and a tokenizer, to serve a model with OpenAI's API
allall of them

Outside a uv project, uv pip install "linnet-lang[torch]" installs into the active environment, and uv run --with "linnet-lang[torch]" python script.py runs one script. pip install works the same way.

The wheels for Linux (x86_64, aarch64), macOS (arm64, 14 or newer) and Windows (x64) carry the compiler. On another platform, build the compiler from source and point LINNET_BIN at it.

From source ​

You need CMake 3.25 or newer, Ninja, and a C++23 compiler (GCC 13, Clang 19 or MSVC 2022).

bash
git clone https://github.com/franknoh/Linnet.git
cd Linnet
cmake --preset release
cmake --build --preset release
ctest --preset release          # optional

The executable is build/release/linnet and finds stdlib/ in the checkout. Elsewhere, pass --std <dir> or set LINNET_STD. To use it from the Python package, set LINNET_BIN=build/release/linnet. In python/linnet, uv sync --all-extras installs the package with every backend and test dependency.

Editors ​

The editors run the language server, linnet lsp.

VS Code ​

Install Linnet from the Visual Studio Marketplace, or from Open VSX in VSCodium and Cursor. The builds for Linux, macOS (Apple silicon) and Windows carry the compiler and need nothing else. The releases page has the same .vsix files for code --install-extension.

linnet.path picks another compiler (in a uv project, .venv/bin/linnet), and linnet.stdRoot passes --std. Run Linnet: Restart Language Server after changing the compiler. From a checkout:

bash
cd editors/vscode && npm install && npm run check
npx @vscode/vsce package
code --install-extension linnet-*.vsix

Neovim and Vim ​

bash
mkdir -p ~/.local/share/nvim/site/pack/linnet/start
ln -s "$PWD/editors/vim" ~/.local/share/nvim/site/pack/linnet/start/linnet
lua
vim.api.nvim_create_autocmd("FileType", {
    pattern = "linnet",
    callback = function(args)
        vim.lsp.start({
            name = "linnet",
            cmd = { "linnet", "lsp", "--stdio" },
            root_dir = vim.fs.root(args.buf, { "linnet.toml", ".git" }),
        })
    end,
})

gq formats through linnet fmt -.

Other editors ​

Run linnet lsp --stdio from any Language Server Protocol client. For highlighting, use the TextMate grammar editors/textmate/linnet.tmLanguage.json.

Next: the Quickstart, or Coming from PyTorch if you already have models.

Released under the MIT License.