TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

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

5 pointsby jozi9over 10 years ago
As a side project I'm planning to write a simple game in javascript, and why not learn something new?

4 comments

electricheadover 10 years ago
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
mattdwover 10 years ago
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 未加载
endemicover 10 years ago
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.
zuraover 10 years ago
Why not Dart? or at least TypeScript?
评论 #8511869 未加载