-
Notifications
You must be signed in to change notification settings - Fork 1
Home
Familiar syntax. Static types. Native performance. Low-level control.
Sere is a statically typed, compiled programming language that combines the expressive syntax of Python with native compilation, LLVM, explicit memory management, macros, generics, and native interoperability.
Sere is designed to live in the space between high-level productivity and low-level control.
Familiar | Native | Powerful | Low-Level -- | -- | -- | -- Python-inspired syntax | LLVM backend | Static typing | Raw pointers Indentation-based | Native executables | Generics | Manual allocation Familiar control flow | Optimized builds | Pattern matching | load / store Classes & functions | Native linking | Macros | External functionsSere is an actively developed language.
The compiler already includes substantial functionality across:
β Lexing
β Parsing
β Static type checking
β Type inference
β Generics
β Classes
β Structs
β Enums
β Pattern matching
β Pointers
β Ownership types
β Memory allocation
β Macros
β Imports
β LLVM code generation
β Native linking
β Standard library
β Project management
β Language Server
β VS Code tooling
β Compiler tests
Some language constructs remain intentionally unsupported or are still evolving.
For the authoritative state of a feature, refer to the compiler documentation and tests rather than assuming that syntax being recognized by the lexer means it is fully implemented.
Want to help build Sere?
Start with:
Then check the repository's CONTRIBUTING.md.
Whether you're interested in language design, compiler engineering, LLVM, runtime development, tooling, or the standard library, there are plenty of places to get involved.
Python-like syntax.
Static types.
Native code.
Low-level control.
Β© Sere Language Project Β· Built with LLVM
# π SereFamiliar syntax. Static types. Native performance. Low-level control.
Sere is a statically typed, compiled programming language that combines the expressive syntax of Python with native compilation, LLVM, explicit memory management, macros, generics, and native interoperability.
ββββββββββββββββββββββββββββ
β Sere Source β
β .sere β
ββββββββββββββ¬ββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββ
β Lexer β
ββββββββββββββ¬ββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββ
β Parser β
ββββββββββββββ¬ββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββ
β Macros + Type Checker β
ββββββββββββββ¬ββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββ
β LLVM IR β
ββββββββββββββ¬ββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββ
β Native Executable β
ββββββββββββββββββββββββββββ
Sere is designed to live in the space between high-level productivity and low-level control.
| π Familiar | β‘ Native | π§ Powerful | π§ Low-Level |
|---|---|---|---|
| Python-inspired syntax | LLVM backend | Static typing | Raw pointers |
| Indentation-based | Native executables | Generics | Manual allocation |
| Familiar control flow | Optimized builds | Pattern matching |
load / store
|
| Classes & functions | Native linking | Macros | External functions |
Write code that feels high-level. Compile code that isn't.
A Sere program can look familiar immediately:
def greet(name: str) -> void:
print(f"Hello, {name}!")
def main() -> i32:
greet("world")
return 0
Compile it:
sere hello.sere -o helloRun it:
./helloThat's it.
No interpreter is required at runtime.
Sere provides a real static type system while keeping type annotations optional where inference is sufficient.
count: i32 = 42
ratio: f64 = 3.14
name: str = "Sere"
values: list[i32] = [1, 2, 3]
Primitive types include:
bool
i8 i16 i32 i64
u8 u16 u32 u64
f32 f64
str
byte
void
Sere also supports:
- Generic types
- Generic functions
- Union types
- Structs
- Classes
- Enums
- Pointers
- Ownership types
- Collections
Structs are value types designed for lightweight data representation.
struct Point:
x: i32
y: i32
p: Point = Point(10, 20)
print(p.x)
print(p.y)
Copies of structs are independent values:
a: Point = Point(1, 2)
b: Point = a
b.x = 100
# a.x is still 1
Sere also supports classes with identity, methods, and inheritance.
class Animal:
name: str
def __init__(self, name: str) -> void:
self.name = name
def speak(self) -> void:
print(self.name)
Classes provide a familiar object-oriented programming model while still compiling down to native code.
Enums can represent both simple variants and data-carrying variants.
enum Message:
Quit
Move(x: i32, y: i32)
Write(str)
Pattern matching makes handling them concise:
match message:
case Message.Move(x, y):
print(x, y)
case Message.Write(text):
print(text)
case Message.Quit:
print("goodbye")
case _:
pass
Sere doesn't force every program into one memory-management model.
You can work at a high level:
numbers: list[i32] = [1, 2, 3]
Or go directly to memory:
ptr: Ptr[i32] = alloc[i32]()
store(ptr, 42)
value: i32 = load(ptr)
free(ptr)
Sere provides several memory abstractions:
| Type | Purpose |
|---|---|
Unique[T] |
Exclusive ownership |
Shared[T] |
Reference-counted ownership |
Ptr[T] |
Raw pointer |
alloc[T]() |
Allocate memory |
load(ptr) |
Read memory |
store(ptr, value) |
Write memory |
free(ptr) |
Release memory |
For applications that need it, the runtime also provides facilities for garbage collection, arenas, and memory pools.
High-level when you want it. Low-level when you need it.
Generic code lets you write reusable, type-safe abstractions.
def first[T](items: list[T]) -> T:
return items[0]
Use it with different types:
numbers = [1, 2, 3]
names = ["Ada", "Grace", "Linus"]
first(numbers)
first(names)
Sere supports compile-time macros.
macro twice(x):
quote:
($x) + ($x)
Then:
result = twice!(value)
Macros operate before type checking, allowing compile-time transformations while keeping the compiler pipeline explicit.
Sere can call functions provided by native libraries.
extern "C" "native_add"
def add(left: i32, right: i32) -> i32
Additional libraries can be passed to the linker:
sere program.sere --link my_library.libThis makes it possible to combine Sere with existing native ecosystems and platform APIs.
Sere uses LLVM as its native compilation backend.
Sere
β
βΌ
Type Checked AST
β
βΌ
LLVM IR
β
βΌ
LLVM Optimizer
β
βΌ
Native Machine Code
This gives Sere access to LLVM's mature optimization and code-generation infrastructure while keeping the language frontend independent from the target architecture.
The sere executable isn't just a compiler.
It provides the core development workflow for the language.
sere init myappsere buildsere runsere cleansere shellsere hello.sere -o hellosere --analyze hello.seresere --emit-llvm hello.sere -o hello.llsere --emit-asm hello.sere -o hello.sSere includes a Language Server Protocol implementation.
Start it with:
sere --lspThe language server provides features such as:
- π Diagnostics
- π‘ Completion
- π Hover information
- π Go-to-definition
- βοΈ Rename
- π¨ Semantic tokens
- π Folding
A VS Code extension is included in the repository as well.
Sere comes with a growing standard library.
| Module | Description |
|---|---|
io |
Input/output |
fs |
Filesystem operations |
path |
Path manipulation |
os |
Operating-system functionality |
env |
Environment variables |
sys |
System/process functionality |
string |
String utilities |
bytes |
Byte manipulation |
encoding |
Encoding utilities |
regex |
Regular expressions |
math |
Mathematics |
vec |
Vector operations |
matrix |
Matrix operations |
hash |
Hashing |
random |
Random numbers |
time |
Time utilities |
log |
Logging |
gc |
Garbage collection |
heap |
Arenas and memory pools |
inspect |
Introspection |
ml |
Machine-learning functionality |
gl |
OpenGL |
qt6 |
Qt 6 integration |
windows |
Windows-specific functionality |
The standard library also integrates with the language's prelude and built-in functionality.
Sere's compiler is organized into a conventional but extensible compilation pipeline.
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Sere Source β
βββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Lexer β
βββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Parser β
βββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Import Resolution β
β + Prelude β
βββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Macro Expansion β
βββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Type Checker β
βββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β LLVM Backend β
βββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Native Executable β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
The frontend is shared by several parts of the ecosystem, including compiler analysis and language-server functionality.
Start here if you're new to Sere.
Learn the language itself.
- Language Reference
- Types
- Functions
- Classes
- Structs
- Enums
- Pattern Matching
- Generics
- Memory and Pointers
- Macros
- Modules and Imports
- Exceptions
Explore the built-in libraries.
Want to hack on Sere itself?
ββββββββββββββββ
β Home β
ββββββββ¬ββββββββ
β
ββββββββββββββββββββΌβββββββββββββββββββ
β β β
βΌ βΌ βΌ
βββββββββββββ βββββββββββββ βββββββββββββ
β Learn β β Build β β Develop β
β Sere β β with β β Sere β
βββββββ¬ββββββ β Sere β βββββββ¬ββββββ
β βββββββ¬ββββββ β
βΌ βΌ βΌ
Language Projects Compiler
Types CLI Frontend
Functions Stdlib Backend
Classes LSP Runtime
Memory Native Testing
Macros Interop Extending
The repository contains deeper documentation for contributors and compiler developers.
Sere is an actively developed language.
The compiler already includes substantial functionality across:
- β Lexing
- β Parsing
- β Static type checking
- β Type inference
- β Generics
- β Classes
- β Structs
- β Enums
- β Pattern matching
- β Pointers
- β Ownership types
- β Memory allocation
- β Macros
- β Imports
- β LLVM code generation
- β Native linking
- β Standard library
- β Project management
- β Language Server
- β VS Code tooling
- β Compiler tests
Some language constructs remain intentionally unsupported or are still evolving.
For the authoritative state of a feature, refer to the compiler documentation and tests rather than assuming that syntax being recognized by the lexer means it is fully implemented.
Want to help build Sere?
Start with:
Then check the repository's [CONTRIBUTING.md](https://github.com/Sere-Language/sere/blob/main/CONTRIBUTING.md).
Whether you're interested in language design, compiler engineering, LLVM, runtime development, tooling, or the standard library, there are plenty of places to get involved.
Python-like syntax.
Static types.
Native code.
Low-level control.
[GitHub Repository β](https://github.com/Sere-Language/sere)
[Language Reference β](https://github.com/Sere-Language/sere/blob/main/docs/language.md)
[Compiler Architecture β](https://github.com/Sere-Language/sere/blob/main/docs/architecture.md)
Β© Sere Language Project Β· Built with LLVM