Skir is a declarative language designed for defining data types, constants, and APIs effortlessly. With a single schema file, generate type-safe code across languages like TypeScript, Python, Java, and more, while ensuring end-to-end type safety. Elevate productivity with seamless integration and powerful features like GitHub imports and safe schema evolution.
Skir is an innovative declarative language crafted for the efficient definition of data types, constants, and APIs. By utilizing a simple .skir file, developers can effortlessly generate idiomatic, type-safe code across multiple languages, including TypeScript, Python, Java, Go, and C++.
[User|user_id], enabling rapid key-based lookup APIs.// 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 ready for usage:
# my_project.py
from skirout.shapes_skir import Point # Generated Python module from Skir
point = Point(x=3, y=4, label="P")
# Round-trip serialization to JSON
point_json = Point.serializer.to_json(point)
restored = Point.serializer.from_json(point_json)
assert(restored == point)
| Language | Documentation | Example |
|---|---|---|
| 🟦 TypeScript | Documentation | Example |
| 🐍 Python | Documentation | Example |
| ⚡ C++ | Documentation | Example |
| ☕ Java | Documentation | Example |
| 💜 Kotlin | Documentation | Example |
| 🦀 Rust | Documentation | Example |
| 🐹 Go | Documentation | Example |
| 🎯 Dart | Documentation | Example |
| 🐦 Swift | Documentation | [Example](https://github. |
No comments yet.
Sign in to be the first to comment.