HN
Today

Show HN: Skir – like Protocol Buffer but better

Skir is a new declarative language designed to simplify defining data types and APIs, aiming to be a "better" alternative to Protocol Buffers by generating idiomatic, type-safe code across multiple languages. It sparked Hacker News discussion by directly challenging an established industry standard, prompting users to critically compare its novel approaches to schema evolution and serialization with existing battle-tested solutions. The conversation highlights the constant quest for improved developer experience and safety in distributed systems.

17
Score
19
Comments
#12
Highest Rank
14h
on Front Page
First Seen
Mar 8, 6:00 PM
Last Seen
Mar 9, 10:00 AM
Rank Over Time
1215152824191717202429302929

The Lowdown

Skir is presented as a declarative language for defining data types, constants, and RPC interfaces, generating idiomatic, type-safe code in languages like TypeScript, Python, Java, and C++. Its creator, having spent 15 years with Protocol Buffers, built Skir to address common pain points and improve developer experience.

  • Unified Schema Definition: A single .skir file acts as the source of truth for data types and API definitions, enabling code generation for various target languages.
  • Streamlined Code Generation: Emphasizes a simple workflow using one YAML configuration file and a single command, with watch mode for automatic recompilation.
  • Safe Schema Evolution: Offers built-in checks and guidelines to manage schema changes safely, preventing breaking clients or data deserialization issues in long-lived systems.
  • End-to-End Type-Safe RPCs: Supports defining API methods that invoke like local functions (a la gRPC), ensuring client and server synchronization.
  • Flexible Serialization: Provides choices between dense JSON (for efficiency), readable JSON (for debugging), and binary (for raw performance).
  • Built-in Package Management: Allows importing types directly from GitHub repositories, facilitating shared data structures.
  • Enhanced Developer Experience: Includes a VS Code extension with features like real-time validation, code completion, and auto-formatting.

In essence, Skir aims to offer a fresh perspective on data serialization and RPC, addressing perceived shortcomings of existing solutions while focusing on developer convenience and robust schema management.

The Gossip

Protocol Parallelism & Preferences

Commenters immediately drew comparisons between Skir and existing tools, primarily Protocol Buffers and its ecosystem (e.g., `buf.build`). Many questioned what truly differentiated Skir, noting that Protobuf already offers similar code generation and type-safety features. The author clarified Skir's advantages, such as built-in compatibility checks, free dependency imports, and specific language design choices around enums. Other alternatives like Cap'n Proto and OpenRPC were also brought into the discussion, highlighting a continuous search for ideal serialization and RPC solutions.

Design Debates & Developer Demands

The discussion delved into specific design decisions in Skir. Its "dense JSON" format sparked debate about readability versus efficiency, with critics highlighting potential debugging challenges. Skir's strict generated constructors, designed to prevent silent defaults, were praised by some as a superior safety mechanism compared to Protobuf, while others argued that Protobuf's approach forces better developer awareness of missing fields in distributed systems. Missing language support (Go, Rust, Swift, C#) was a common concern, which the author confirmed is actively being addressed. The ambitious tagline "like Protobuf but better" was also critiqued, with suggestions that "fresh" might be a more fitting and less presumptuous description for a new project.