Show HN: 为什么系统建模应该像代码,而不是PPT

1作者: twopowerX8 个月前
系统工程师使用各种工具对价值数十亿美元的航天器、救生医疗设备和自动驾驶汽车进行建模,但这些工具甚至无法进行像样的 diff/merge/版本控制,即使配备了昂贵的基础设施。 我构建了 Sylang 来解决这个问题。 什么是 Sylang? 一种基于文本的语言,用于对复杂系统进行建模。编写声明式代码,自动获得可视化图表、可追溯性矩阵、FMEA 分析和合规性报告。与 Git、VSCode 和 AI 代码助手配合使用。 示例: ``` def requirement BrakeActivation description "系统应在 100 毫秒内激活制动器" safetylevel ASIL-D testedby ref testcase EmergencyBrakeTest derivedfrom ref safetygoal PreventCollision allocatedto ref block BrakeController ``` 这会生成: - 架构图(分解图、内部模块图) - 可追溯性矩阵(需求 ↔ 测试 ↔ 模块 ↔ 安全目标) - 覆盖率分析(哪些需求缺少测试?) - 合规性报告(功能安全、ASPICE 等) 为什么基于文本的建模有效: 您的 AI 代码助手(Cursor、GitHub Copilot、Claude、Gemini)可以: - 从安全目标生成需求 - 从需求创建测试用例 - 从架构草拟 FMEA 分析 - 通过语义理解在文件之间进行重构 - 建议缺失的关系 真正有效的 Git 工作流程: ``` git diff requirements.req # 查看更改内容 git merge feature/new-sensors # 合并架构分支 git blame safety-goals.sgl # 谁定义了这个安全目标? ``` 没有 XMI。没有数据库导出。没有 PowerPoint。只有可读的文本,可以生成您所需的一切。 您将获得: 23 种文件类型,涵盖完整的工程生命周期: - 产品线和变体 (.ple, .fml, .vml) - 架构 (.blk, .fun, .ifc) - 需求和测试 (.req, .tst) - 行为模型 (.ucd, .seq, .smd) - 安全分析 (.haz, .sgl, .sam, .flr, .fta) - 仪表板和规范 (.dash, .spec) - 自动化 (.agt, .spr) 所有文件都会自动生成可视化图表:特征模型、分解图、序列图、状态机、可追溯性矩阵。 当前状态: - 语言稳定 (v0.9.27) - VSCode 扩展可用(在扩展中搜索“Sylang”) - 与 Cursor、GitHub Copilot、Claude、Gemini 代码助手配合使用 - 图表渲染、可追溯性、覆盖率分析工作正常 - 独立开发者,兼职,公开构建 下载地址: [https://marketplace.visualstudio.com/items?itemName=balaji-embedcentrum.sylang](https://marketplace.visualstudio.com/items?itemName=balaji-embedcentrum.sylang) 网站:[https://sylang.dev](https://sylang.dev) GitHub:[https://github.com/balaji-embedcentrum/sylang](https://github.com/balaji-embedcentrum/sylang) 欢迎反馈——特别是来自希望他们的建模工具能像他们的代码编辑器一样工作的工程师。
查看原文
Systems engineers model billion-dollar spacecraft, life-saving medical devices, and autonomous vehicles in tools that can&#x27;t even do a proper diff&#x2F;merge&#x2F;version control even with large expensive infrastructure.<p>I built Sylang to address that.<p>What is Sylang?<p>A text-based language for modeling complex systems. Write declarative code, get visual diagrams, traceability matrices, FMEA analyses, and compliance reports automatically. Works with Git, VSCode, and AI code assistants.<p>Example:<p><pre><code> def requirement BrakeActivation description &quot;System shall activate brakes within 100ms&quot; safetylevel ASIL-D testedby ref testcase EmergencyBrakeTest derivedfrom ref safetygoal PreventCollision allocatedto ref block BrakeController </code></pre> This generates:<p>- Architecture diagrams (decomposition, internal block diagrams) - Traceability matrix (requirement ↔ test ↔ block ↔ safety goal) - Coverage analysis (which requirements lack tests?) - Compliance reports (functional safety, ASPICE, etc.)<p>Why text-based modeling works:<p>Your AI code assistant (Cursor, GitHub Copilot, Claude, Gemini) can: - Generate requirements from safety goals - Create test cases from requirements - Draft FMEA analyses from architecture - Refactor across files with semantic understanding - Suggest missing relationships<p>Git workflows that actually work:<p><pre><code> git diff requirements.req # See what changed git merge feature&#x2F;new-sensors # Merge architecture branches git blame safety-goals.sgl # Who defined this safety goal? </code></pre> No XMI. No database exports. No PowerPoint. Just readable text that generates everything you need.<p>What you get:<p>23 file types covering the full engineering lifecycle: - Product lines &amp; variants (.ple, .fml, .vml) - Architecture (.blk, .fun, .ifc) - Requirements &amp; tests (.req, .tst) - Behavioral models (.ucd, .seq, .smd) - Safety analysis (.haz, .sgl, .sam, .flr, .fta) - Dashboards &amp; specs (.dash, .spec) - Automation (.agt, .spr)<p>All auto-generating visual diagrams: feature models, decomposition diagrams, sequence diagrams, state machines, traceability matrices.<p>Current state:<p>- Language stable (v0.9.27) - VSCode extension available (search &quot;Sylang&quot; in Extensions) - Works with Cursor, GitHub Copilot, Claude, Gemini code assistants - Diagram rendering, traceability, coverage analysis working - Solo dev, part-time, building in public<p>Download at:<p><a href="https:&#x2F;&#x2F;marketplace.visualstudio.com&#x2F;items?itemName=balaji-embedcentrum.sylang" rel="nofollow">https:&#x2F;&#x2F;marketplace.visualstudio.com&#x2F;items?itemName=balaji-e...</a><p>Website: <a href="https:&#x2F;&#x2F;sylang.dev" rel="nofollow">https:&#x2F;&#x2F;sylang.dev</a><p>GitHub: <a href="https:&#x2F;&#x2F;github.com&#x2F;balaji-embedcentrum&#x2F;sylang" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;balaji-embedcentrum&#x2F;sylang</a><p>Feedback welcome—especially from engineers who&#x27;ve wished their modeling tools worked more like their code editors.