Skip to content
jj edited this page Aug 23, 2026 · 1 revision

πŸͺΆ Sere

A Python-inspired systems programming language built for native code.

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.


✨ Why Sere?

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

🧭 Project Status

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.


🀝 Contributing

Want to help build Sere?

Start with:

  1. Architecture

  2. Frontend

  3. Backend

  4. Testing

  5. Extending Sere

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.


🌐 Sere

Python-like syntax.

Static types.

Native code.

Low-level control.

Build something that feels like a scripting language β€” and runs like a compiled one.

GitHub Repository β†’

Language Reference β†’

Compiler Architecture β†’


Β© Sere Language Project Β· Built with LLVM

# 🐍 Sere

A Python-inspired systems programming language built for native code.

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 Source       β”‚
             β”‚         .sere             β”‚
             β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                          β”‚
                          β–Ό
             β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
             β”‚          Lexer           β”‚
             β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                          β”‚
                          β–Ό
             β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
             β”‚         Parser           β”‚
             β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                          β”‚
                          β–Ό
             β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
             β”‚   Macros + Type Checker  β”‚
             β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                          β”‚
                          β–Ό
             β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
             β”‚        LLVM IR           β”‚
             β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                          β”‚
                          β–Ό
             β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
             β”‚   Native Executable      β”‚
             β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

✨ Why Sere?

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

The idea is simple:

Write code that feels high-level. Compile code that isn't.


πŸš€ Quick Start

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 hello

Run it:

./hello

That's it.

No interpreter is required at runtime.


πŸ”₯ Language Features

πŸ“ Static Typing

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

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

🧬 Classes

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 & Pattern Matching

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

🧠 Memory Management

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.


🧩 Generics

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)

πŸͺ„ Macros

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.


πŸ”Œ Native Interoperability

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.lib

This makes it possible to combine Sere with existing native ecosystems and platform APIs.


βš™οΈ LLVM

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 Toolchain

The sere executable isn't just a compiler.

It provides the core development workflow for the language.

Create a project

sere init myapp

Build

sere build

Run

sere run

Clean

sere clean

Open a project shell

sere shell

Compile a source file directly

sere hello.sere -o hello

Analyze without generating an executable

sere --analyze hello.sere

Emit LLVM IR

sere --emit-llvm hello.sere -o hello.ll

Emit assembly

sere --emit-asm hello.sere -o hello.s

πŸ§‘β€πŸ’» Editor Support

Sere includes a Language Server Protocol implementation.

Start it with:

sere --lsp

The 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.


πŸ“¦ Standard Library

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.


πŸ§ͺ Compiler Architecture

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.


πŸ“š Learn Sere

🟒 Getting Started

Start here if you're new to Sere.

πŸ”΅ Language

Learn the language itself.

🟣 Standard Library

Explore the built-in libraries.

πŸ”΄ Compiler Development

Want to hack on Sere itself?


πŸ—ΊοΈ Documentation Map

                         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                         β”‚     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

πŸ“– Repository Documentation

The repository contains deeper documentation for contributors and compiler developers.

Document Description
[docs/language.md](https://github.com/Sere-Language/sere/blob/main/docs/language.md) Language reference
[docs/architecture.md](https://github.com/Sere-Language/sere/blob/main/docs/architecture.md) Compiler architecture
[docs/frontend.md](https://github.com/Sere-Language/sere/blob/main/docs/frontend.md) Frontend internals
[docs/backend.md](https://github.com/Sere-Language/sere/blob/main/docs/backend.md) LLVM backend
[docs/lsp.md](https://github.com/Sere-Language/sere/blob/main/docs/lsp.md) Language Server
[docs/stdlib.md](https://github.com/Sere-Language/sere/blob/main/docs/stdlib.md) Standard library
[docs/testing.md](https://github.com/Sere-Language/sere/blob/main/docs/testing.md) Compiler testing
[docs/packaging.md](https://github.com/Sere-Language/sere/blob/main/docs/packaging.md) Packaging
[docs/extending.md](https://github.com/Sere-Language/sere/blob/main/docs/extending.md) Extending the compiler

🧭 Project Status

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.


🀝 Contributing

Want to help build Sere?

Start with:

  1. Architecture
  2. Frontend
  3. Backend
  4. Testing
  5. Extending Sere

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.


🌐 Sere

Python-like syntax.

Static types.

Native code.

Low-level control.

Build something that feels like a scripting language β€” and runs like a compiled one.

[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