<div align="center"> <h1>Skir</h1> <p><strong>Like Protocol Buffer, but better.</strong></p>
npm install skirLike Protocol Buffer, but better.


Skir is a universal language for representing data types, constants, and RPC interfaces. Define your schema once in a .skir file and generate idiomatic, type-safe code in TypeScript, Python, Java, C++, and more.
- π Single source of truth - Define your data types and APIs once and share them between your backend, frontend, and microservices.
- π Multi-language - First-class support for TypeScript, Python, C++, Java, Kotlin, and Dart.
- βοΈ Idiomatic code gen - Generates code that feels native to each language.
- π Effortless serialization - Skir generates functions to serialize your data to JSON or binary, so you never have to write parsing code manually.
- π¦ Schema evolution - Simple guidelines and built-in checks to evolve your schema without breaking backward compatibility.
- π€ RPCs with end-to-end type safety - Like tRPC, but for every language. Call your backend functions directly from your frontend or microservices with full compile-time safety.
- π οΈ Delightful developer experience - Automatic recompilation in watch mode, built-in code formatter, official VSCode extension.
- π¦ Built-in package manager - Import types from other GitHub repositories to easily share common data structures across projects.
- π Easy setup - Get started with npx skir init, manage your entire project configuration from a single YAML file.
``d
// shapes.skir
struct Point {
x: int32;
y: int32;
label: string;
}
struct Shape {
points: [Point];
/// A short string describing this shape.
label: string;
}
const TOP_RIGHT_CORNER: Point = {
x = 600,
y = 400,
label = "top-right corner",
};
/// Returns true if no part of the shape's boundary curves inward.
method IsConvex(Shape): bool = 12345;
`
Skir compiles these definitions into native, type-safe code you can use in your project:
`pythonmy_project.py
from skirout.shapes_skir import Point # Python module generated by Skir
point = Point(x=3, y=4, label="P")
assert(restored == point)
``
- Getting started: setup & workflow
- Language reference
- Serialization
- Schema evolution
- RPC services
- External dependencies
- Coming from Protocol Buffer
| Language | Documentation | Example |
| :--- | :--- | :--- |
| π¦ TypeScript | Documentation | Example |
| π Python | Documentation | Example |
| β‘ C++ | Documentation | Example |
| β Java | Documentation | Example |
| π Kotlin | Documentation | Example |
| π― Dart | Documentation | Example |