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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Ask HN: CoffeeScript or ClojureScript for writing a game in JS?

5 点作者 jozi9超过 10 年前
As a side project I'm planning to write a simple game in javascript, and why not learn something new?

4 条评论

electrichead超过 10 年前
From my experience, coffeescript won't teach you anything new and won't give you any performance improvents. In fact, it will make you scratch your head a lot and will make you do a mental js-coffee conversion each time. You might end up liking it, but I think that clojurescript is the better bet here for performance gains as well as better coding in general, since its focus on functional programming is more concrete and inherent in it. Functional programming in coffeescript is exactly the same as in js ie. GIGO
mattdw超过 10 年前
If your game is at all taxing in terms of performance, you may find that neither give you enough visibility into, or control over, allocations and garbage collection.<p>I suspect particularly that ClojureScript (which would otherwise be my choice), with its use of persistent&#x2F;immutable types and collections, might burden the GC quite heavily for a game.<p>CoffeeScript, IMO, offers so little over JS that it&#x27;s not really worth the trouble.
评论 #8511897 未加载
endemic超过 10 年前
If you use CoffeeScript, you might have to watch out for unexpected variables being created by the transpiler. For example, if you write a method that ends with a `while` loop, CoffeeScript will actually return an array with the evaluated results of the loop. Normally not a big deal, but when doing games in JS you need to watch out for excess memory use, since your framerate will tank if the GC runs too long&#x2F;frequently.
zura超过 10 年前
Why not Dart? or at least TypeScript?
评论 #8511869 未加载