TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show HN: js.spec, a JavaScript implementation of clojure.spec

96 点作者 prayerslayer超过 8 年前

3 条评论

moxious超过 8 年前
I think of dynamic typing in a language as a big pro and a big con at the same time, but it&#x27;s one of the things that makes a language like JavaScript or closure what it is.<p>I love typing systems too, there are compelling advantages...and disadvantages.<p>I guess sometimes what seems strange is attempts to bolt type systems on to fundamentally dynamic languages, like adding two extra wheels to a motorcycle, extra fairing, and then calling it a car.<p>I don&#x27;t fault anyone for wanting a car. But if you wanted a car, why not start off with a statically typed language? Why bolt this stuff on really in contravention to what the dynamic languages are trying to be?<p>Perhaps this is JavaScript fatigue in a new guise? If everything has to be JavaScript (for whatever reason) then having no static typing ever may be hard to live with?<p>Am I missing something or does the motorcycle with two extra wheels seem destined to be clunkier and less flexible than a proper car?
评论 #13067355 未加载
评论 #13067578 未加载
评论 #13067661 未加载
评论 #13067512 未加载
评论 #13067764 未加载
rattray超过 8 年前
Seems cool.<p>Also worth checking out: tcomb[0] which can let you use your Flow types at runtime for eg; pattern matching.<p>[0] <a href="https:&#x2F;&#x2F;github.com&#x2F;gcanti&#x2F;tcomb" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;gcanti&#x2F;tcomb</a>
评论 #13069076 未加载
dwwoelfel超过 8 年前
Have you used js.spec or clojure.spec in production? Has it helped you catch bugs that you would have otherwise missed? How does the runtime-only limitation work out in practice?<p>I know that flow has prevented me from checking in bugs, because I&#x27;ve tried to push up code with e.g. misspelled property names and the pre-push hook stopped me.
评论 #13067330 未加载
评论 #13069079 未加载