DEV Community

Cover image for Introducing Sere: a compiled language with Python-like syntax and systems-level power
jj
jj

Posted on

Introducing Sere: a compiled language with Python-like syntax and systems-level power

Today I’m launching Sere, a compiled programming language built around a simple idea:

Python-like readability shouldn’t mean giving up native performance, static typing, or low-level control.

Sere is designed to feel familiar and lightweight while still giving you the kinds of capabilities you’d normally reach for C++, Rust, or Zig to get.

A basic Sere program looks like this:

def main() -> i32:
    print("hello from sere")
    return 0
Enter fullscreen mode Exit fullscreen mode

You can define structs and methods without much ceremony:

struct Point:
    x: i32
    y: i32

    def length_sq(self) -> i32:
        return self.x * self.x + self.y * self.y

def main() -> i32:
    p = Point(3, 4)

    print(p.length_sq())
    return 0
Enter fullscreen mode Exit fullscreen mode

Under the hood, Sere is a native compiled language built on LLVM.

That means you can go from readable high-level code to actual native binaries:

sere main.sere -o main.exe
Enter fullscreen mode Exit fullscreen mode

You can also inspect LLVM IR or generated assembly:

sere --emit-llvm main.sere -o main.ll
sere --emit-asm main.sere -o main.s
Enter fullscreen mode Exit fullscreen mode

Built for more than scripting

Sere isn’t meant to be “Python with a compiler.”

The goal is to support real systems-level work while keeping the syntax approachable.

That includes explicit memory control:

owned: Unique[i32] = unique[i32](42)

*owned = 100

value: i32 = load(owned)
Enter fullscreen mode Exit fullscreen mode

Raw pointers are available when you actually need them:

ptr: Ptr[i32] = alloc[i32]()

store(ptr, 123)

print(*ptr)

free(ptr)
Enter fullscreen mode Exit fullscreen mode

And the language includes modern features like enums and pattern matching:

enum Message:
    Quit
    Move(x: i32, y: i32)

def handle(msg: Message) -> void:
    match msg:
        case Message.Quit:
            print("bye")

        case Message.Move(x, y):
            print(f"moving to {x}, {y}")
Enter fullscreen mode Exit fullscreen mode

Tooling matters too

I don’t want Sere to be one of those languages where the compiler exists but the developer experience feels like 2008.

Sere already has tooling for:

  • syntax highlighting
  • diagnostics
  • hover information
  • go to definition
  • rename
  • VS Code integration
  • project builds
  • library packaging

Libraries can be packaged into .slib files and imported into other Sere projects:

sere init-lib mathlib
sere pack
Enter fullscreen mode Exit fullscreen mode

Then:

import mathlib

def main() -> i32:
    print(mathlib.add(2, 3))
    return 0
Enter fullscreen mode Exit fullscreen mode

Native interoperability is also a major part of the project. Sere is being built with C and C++ interop in mind rather than pretending the existing native ecosystem doesn’t exist.

What Sere is trying to be

The goal is not to replace Python, C++, or Rust.

It’s to explore a different balance between them.

I want Sere to be a language where this feels normal:

items = [1, 2, 3]

for item in items:
    print(item)
Enter fullscreen mode Exit fullscreen mode

while this is still possible:

buffer: Ptr[u8] = alloc[u8](1024)
Enter fullscreen mode Exit fullscreen mode

High-level when you want it.

Low-level when you need it.

Without turning every program into a wall of syntax.

Sere is still early

Sere is actively being developed, and I’m not going to pretend otherwise.

There are still bugs, missing features, compiler edge cases, and parts of the ecosystem that need a lot more work.

But the language is at a point where people can actually download it, write code, compile native programs, build libraries, and experiment with the design.

That’s why I’m launching it publicly now.

I want feedback while the language is still flexible enough to change.

If something is confusing, awkward, broken, or just a terrible language-design decision, I want to hear about it.

Try Sere

Website:

https://sere-lang.com

GitHub:

https://github.com/Sere-Language/sere

Sere is open source, and contributors are welcome.

If you’re interested in compilers, LLVM, programming language design, systems programming, or just trying new languages, I’d love for you to give it a shot and tell me what you think.

Python-like syntax. Native compilation. Systems-level control.

That’s the direction I’m building Sere toward.

Top comments (0)