Libraries

The stdlib ships with the compiler. Your own code packs into a .slib you drop in libs/. A package manager is not here yet.

.slib

Create a library, pack it into one file, copy that file into another project. Folder libraries work too if you do not want to pack.

powershell
sere init-lib mathlib
cd mathlib
sere pack
copy dist\mathlib.slib ..\myapp\libs\
main.sere
import mathlib

def main() -> i32:
    return mathlib.add(2, 3)

What gets packed

The entry, the local modules it actually imports, and compiled native objects. Unused files next to the library stay out.

Folder form

libs/mylib/lib.sere or mylib.sere, plus optional .c / native/. Same import, no pack step.

Libraries in the docs

Standard library

Prelude is always there. Everything else is import.

prelude

Always injected: print, abs, min, max, Int / Float, dbg!.

io

read_line, eprint — extra I/O on top of the print intrinsic.

fs / path / os / env / sys

Files, paths, process, and the host.

string / bytes / encoding / regex

Text and binary. Backtick literals type as regex.

math / vec / matrix / ml / arrays

Numeric work and linear algebra.

hash / random / time / log / bit

Utilities you reach for in a real binary.

gc / heap / memory

Collectors, arenas, pointer vocabulary.

inspect

label and describe — not the builtin typeof / dir.

html_lang

html: raw macro plus the Html wrapper.

windows / gl / qt6

Win32, OpenGL 2.1+, Qt widgets (stub if missing).

requests

HTTP client: get, post, put, delete.

wsgi

Blocking HTTP server. Subclass Handler and implement handle.