Luce Base
LuceSourceLuciaOS

The Luce Base Guide

Luce Base is a compiled systems language. Its syntax will look familiar if you know Python: blocks are indented, loops read for item in items, and conditions use and, or and not. What happens underneath is closer to C: values are laid out in memory the way C lays out structs, you allocate and free memory yourself, and programs compile to native executables.

Install#

On macOS or Linux:

curl -fsSL https://luce.luciaos.com/install.sh | sh && . "$HOME/.local/luce/env"

On Windows, in Command Prompt:

curl -fsSLo "%TEMP%\luce-install.cmd" https://luce.luciaos.com/install.cmd && "%TEMP%\luce-install.cmd"

or in PowerShell:

irm https://luce.luciaos.com/install.ps1 | iex

This installs the compiler, luce-base, and the project tool, luc. On Windows that is all you need: the compiler assembles and links programs itself, so there is no Visual Studio, MinGW or other C toolchain to install. On macOS and Linux it uses the system's C toolchain for that step. Chapter 1 of the Tour covers what you need and a first program.

The documentation#

The documentation comes in three parts.

The Tour is an introduction in ten short chapters, each built around programs you can run. It starts from a first print and ends with calling C. Read it in order.

The Guide covers one topic per chapter in full: types, memory and allocators, errors, modules and packages, generics, threads, C interop, building and debugging. Gotchas lists the things most likely to surprise you, each linked to where it is explained.

The Reference is the language specification: every rule, with the reasoning behind it. The Tour and the Guide link to it where the exact wording matters.

The programs in this documentation are compiled and run as part of the compiler's tests, so their output is what the current compiler prints.