Hacker News

Show HN:Skir – 类似于 Protocol Buffer,但更好

评论

6 最小阅读量

Mewayz Team

Editorial Team

Hacker News

Skir 简介:下一代模式定义

在现代软件开发领域,数据是服务、应用程序和微服务之间流动的命脉。多年来,Protocol Buffers (Protobuf) 一直是定义结构化数据的事实上的标准,提供了一种语言中立、平台中立的数据序列化机制。它是一个功能强大的工具,但随着系统变得越来越复杂,开发人员经常发现自己希望得到更直观、更具表现力、而且只是……更好的东西。这正是我们建造 Skir 的原因。将其视为为更具动态的开发环境而重新构想的协议缓冲区,旨在消除样板文件并提高清晰度。

在 Mewayz,我们不断构建和集成复杂的系统。我们的模块化商业操作系统依靠其各个组件之间的无缝数据交换而蓬勃发展。我们发现,虽然 Protobuf 完成了 80% 的工作,但剩下的 20% 涉及与工具对抗或编写过多的粘合代码。 Skir 的出现源于我们对模式定义语言的需求,它感觉像是我们开发过程的自然延伸,而不是一个单独的、繁琐的步骤。它是为了使数据契约像它们支持的业务逻辑一样干净且可维护。

为什么要超越协议缓冲区?

无可否认,Protocol Buffer 是成功的,但它们也有自己的局限性。该语法虽然高效,但可能会让人感觉过时且冗长。对预编译步骤的要求增加了开发周期的摩擦。更重要的是,Protobuf 的类型系统虽然强大,但可能具有限制性。例如,表示复杂的约束或自定义验证逻辑通常需要外部文档或后处理,从而打破了“单一事实来源”的理想。 Skir 通过在不牺牲性能或互操作性的情况下提供对开发人员更加友好的体验来正面解决这些痛点。

让裙子闪闪发光的核心特征

Skir 不仅仅是对现有标准的轻微调整;这是一个深思熟虑的演变。我们设计它时注重表现力、简单性和无缝集成。

丰富的原生类型系统:超越基本原语。 Skir 支持联合类型、内置日期/时间处理,甚至允许直接在模式定义中使用轻量级验证规则。

零样板代码生成:Skir 的代码生成器旨在为各种语言生成干净、惯用的代码。告别混乱,迎接手写的类和结构。

一流的 JSON 模式支持:虽然 Skir 拥有自己的紧凑语法,但它包含 JSON 模式的通用性,允许轻松转换并与庞大的工具生态系统进行互操作。

💡 您知道吗?

Mewayz在一个平台内替代8+种商业工具

CRM·发票·人力资源·项目·预订·电子商务·销售点·分析。永久免费套餐可用。

免费开始 →

集成文档:文档不是事后的想法。 Skir 模式允许您将 Markdown 文档直接嵌入到您的类型定义中,将您的 API 契约及其解释保存在一处。

“Skir 从根本上改变了我们团队在 API 设计方面的协作方式。这些架构非常具有可读性,可以作为活文档,大大减少了最终确定数据合同所需的来回次数。” – Mewayz 的首席后端工程师。

Skir 和 Mewayz 生态系统:完美契合

对于像 Mewayz 这样充当企业模块化操作系统的平台来说,干净可靠的数据合约是不容协商的。我们的 CRM、项目管理和计费模块需要完美沟通。在内部采用 Skir 让我们的团队能够更快地迭代新功能。现在,为新集成或模块更新定义数据结构只需编写几行清晰的 Skir 代码即可。生成的代码直接插入我们的服务中,确保类型安全并减少运行时错误。它增强了 Mewayz 理念核心的敏捷性,使企业能够

Frequently Asked Questions

Introducing Skir: The Next Generation of Schema Definition

In the world of modern software development, data is the lifeblood that flows between services, applications, and microservices. For years, Protocol Buffers (Protobuf) have been the de-facto standard for defining structured data, offering a language-neutral, platform-neutral mechanism for serializing data. It's a powerful tool, but as systems grow more complex, developers often find themselves wishing for something more intuitive, more expressive, and simply... better. That's precisely why we built Skir. Think of it as Protocol Buffers reimagined for a more dynamic development landscape, designed to eliminate boilerplate and enhance clarity.

Why Move Beyond Protocol Buffers?

Protocol Buffers are undeniably successful, but they come with their own set of limitations. The syntax, while efficient, can feel dated and verbose. The requirement for pre-compilation steps adds friction to the development cycle. More importantly, Protobuf's type system, while strong, can be restrictive. For instance, representing complex constraints or custom validation logic often requires external documentation or post-processing, breaking the "single source of truth" ideal. Skir addresses these pain points head-on by offering a more developer-friendly experience without sacrificing performance or interoperability.

Core Features That Make Skir Shine

Skir isn't just a slight tweak to an existing standard; it's a thoughtful evolution. We've designed it with a focus on expressiveness, simplicity, and seamless integration.

Skir and the Mewayz Ecosystem: A Perfect Fit

For a platform like Mewayz, which acts as a modular operating system for businesses, clean and reliable data contracts are non-negotiable. Our modules for CRM, project management, and billing need to communicate flawlessly. Adopting Skir internally has allowed our teams to iterate faster on new features. Defining the data structure for a new integration or a module update is now a matter of writing a few lines of clear Skir code. The generated code plugs directly into our services, ensuring type safety and reducing runtime errors. It enhances the agility that is core to the Mewayz philosophy, allowing businesses to adapt their OS without being hamstrung by data silos or brittle interfaces.

Getting Started with Skir

Ready to see the difference for yourself? Skir is an open-source project, and we invite the developer community to try it out. You can find the compiler, documentation, and examples on our GitHub repository. Start by defining a simple schema, generate code for your favorite programming language, and experience the reduction in cognitive overhead. We believe that once you use Skir to define your data, you'll wonder how you ever managed without it. It's not just a tool for serialization; it's a tool for clear thinking and robust system design.

Build Your Business OS Today

From freelancers to agencies, Mewayz powers 138,000+ businesses with 208 integrated modules. Start free, upgrade when you grow.

Create Free Account →

免费试用 Mewayz

集 CRM、发票、项目、人力资源等功能于一体的平台。无需信用卡。

立即开始更智能地管理您的业务

加入 30,000+ 家企业使用 Mewayz 专业开具发票、更快收款并减少追款时间。无需信用卡。

觉得这有用吗?分享一下。

准备好付诸实践了吗?

加入30,000+家使用Mewayz的企业。永久免费计划——无需信用卡。

开始免费试用 →

准备好采取行动了吗?

立即开始您的免费Mewayz试用

一体化商业平台。无需信用卡。

免费开始 →

14 天免费试用 · 无需信用卡 · 随时取消