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.
def main() -> i32:
print("hello, sere")
return 0sere examples\hello.sere -o hello.exe
.\hello.exeprelude.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.
| Page | About |
|---|---|
| Programs | Entry, init, indentation, default bindings |
| Lexical structure | Comments, keywords, literals, operators |
| Types | Primitives, pointers, unions, collections |
| Names and bindings | Locals, static, const, decorators |
| Expressions | Precedence, range, walrus, comprehensions |
| Statements | Control flow, defer, with, del |
| Functions | Inference, generics, extern "C" |
| Classes, structs, enums | Identity vs value, variants, dunders |
| Modules | Imports, dunders, host flags |
| Libraries | .slib, init-lib, pack, folder libs |
| Memory | Unique, Shared, Ptr, collectors |
| Collections and strings | list, array, dict, slices |
| Pattern matching | match / case, guards |
| Errors | try / raise, exception types |
| Macros | quote, match, raw, hygiene |
| Introspection | typeof, sizeof, host facts |
| Diagnostics | Codes and # type: ignore |
| Interop | Linking C, module init |
| Standard library | Prelude and opt-in modules |
| The compiler | Frontend, IR, runtime |
Unsupported constructs diagnose (NotImplementedError and friends) instead of generating silent wrong code.