Sere language

Sere is a statically typed, indentation-significant language that compiles to native code through LLVM 22. This set of pages describes the language as the compiler implements it, not as a wishlist.

A linked executable needs main. The i32 it returns is the process exit code. print is an intrinsic (a call), not a statement.

sere
def main() -> i32:
    print("hello, sere")
    return 0
powershell
sere examples\hello.sere -o hello.exe
.\hello.exe

prelude.sere is injected into every program. Other stdlib modules are opt-in (import math). A file without main still typechecks and can emit LLVM; it does not produce a C main.

How to read these pages

Start with Programs, Types, and Memory if you care about what actually hits the metal. Libraries covers .slib. Macros and The compiler are the deep cuts.

PageAbout
ProgramsEntry, init, indentation, default bindings
Lexical structureComments, keywords, literals, operators
TypesPrimitives, pointers, unions, collections
Names and bindingsLocals, static, const, decorators
ExpressionsPrecedence, range, walrus, comprehensions
StatementsControl flow, defer, with, del
FunctionsInference, generics, extern "C"
Classes, structs, enumsIdentity vs value, variants, dunders
ModulesImports, dunders, host flags
Libraries.slib, init-lib, pack, folder libs
MemoryUnique, Shared, Ptr, collectors
Collections and stringslist, array, dict, slices
Pattern matchingmatch / case, guards
Errorstry / raise, exception types
Macrosquote, match, raw, hygiene
Introspectiontypeof, sizeof, host facts
DiagnosticsCodes and # type: ignore
InteropLinking C, module init
Standard libraryPrelude and opt-in modules
The compilerFrontend, IR, runtime

Unsupported constructs diagnose (NotImplementedError and friends) instead of generating silent wrong code.