4 ms·
I'm learning Scala (coursera, twitter) to write game servers that can handle lots of request simultaneously. What's another good language for this? So far, Scal
by quantumpotato_ 13y ago
I'm learning Scala (coursera, twitter) to write game servers that can handle lots of request simultaneously. What's another good language for this? So far, Scala seems rather powerful.
- ivanplenty 13y agoI love Scala as a language and would encourage you to learn it on the way to becoming a more rounded programmer. It does have its warts, and compile times kill me. On HN the two common recommendations are: * Go * Node.JS (with Promises while we wait for generators!) I personally use node for large-scale stuff since more people know JS, but a lot of this comes down to personal preference.
- quantumpotato_ 13y agoThank you for your response. Node seems promising (it's not techncially multi-threaded though?) I wrote a little command-line RPS game playable over a local network in node: https://github.com/quantumpotato/node-rps https://github.com/quantumpotato/node-rps Didn't realize Go was good for many-connections, will have to check that out. TY
- nickik 13y agoNode only runs on one core, you can start it more then once. This only works if the request well don't have to coordinate over the hole address space. You need to care all the shared state in a database, witch you don't really want to do. Go, is pretty good for that and it helps to think about it. You can start on thread of control per request, like with Scala where you might start one actor per request but the difference is that you have first class channels to communicate. Witch is pretty powerful. One the JVM you can do this CSP style where well with Clojure (https://github.com/clojure/core.async https://github.com/clojure/core.async). Interesting video why CSP is best: > http://www.infoq.com/presentations/clojure-core-async http://www.infoq.com/presentations/clojure-core-async
- nickik 13y agoIts interesting that you use Go (CSP) and Node.js (callback) and like them both. Generally CSP people belive that the Node.js approach leads straight to hell. Rich Hickey is really good about why Callbacks are terrible (and that's why he implemented CSP in clojure): > http://www.infoq.com/presentations/clojure-core-async http://www.infoq.com/presentations/clojure-core-async > https://github.com/clojure/core.async https://github.com/clojure/core.async
- ivanplenty 13y ago"Like" is relative and based on tradeoffs. Loved Rick's talk, thanks. This last year I worked on a project with people from the valley, we used Go, and everyone contributed quality code. This is because people in SF area know Go. A year ago I worked on a project with people from the midwest, we used node, and got the same quality. Much fewer people in the midwest know Go. Independent of my feelings about both environments, CSP, callback hell, etc, at the end of the day my team and I have to build a product, and I try to pick the tool that best matches our combined skillsets.
- nickik 13y agoAbsolutly. For some stuff node.js works perfectly well and knowlage is often the hardest thing to come by.
- deleted 13y ago[deleted]
- jhaywood 13y agoThis is always a canonical example for Erlang. For example the game servers for Call of Duty rely on Erlang. http://www.slideshare.net/eonblast/an-erlang-game-stack http://www.slideshare.net/eonblast/an-erlang-game-stack
- anonymoushn 13y agoMost languages can do this. Some of them come with models for doing it (like Scala, Go, or Erlang) and others are best used with an existing eventing library like libevent or libuv (like Node).
- bad_user 13y agoFor high performance/throughput, the JVM beats both Go and Node.js. As an anecdote, I implemented a web service that was handling about 6000 requests per second of real traffic, per EC2 c1.medium server instance. In terms of dealing with concurrency, I/O, reactive stuff and everything else related, you've got: - Actors (local or remote): http://akka.io/ http://akka.io/ - STM: http://nbronson.github.io/scala-stm/ http://nbronson.github.io/scala-stm/ - Futures/Promises in the standard library: http://docs.scala-lang.org/overviews/core/futures.html http://docs.scala-lang.org/overviews/core/futures.html - Async (e.g. C#'s async): https://github.com/scala/async https://github.com/scala/async - RxJava Observables: https://github.com/Netflix/RxJava https://github.com/Netflix/RxJava - Iteratees: http://www.playframework.com/documentation/2.2.1/Iteratees http://www.playframework.com/documentation/2.2.1/Iteratees - Scalaz Streams: https://github.com/scalaz/scalaz-stream https://github.com/scalaz/scalaz-stream And the list can go on.
- aurelius 13y agoC++.
- eternalban 13y agoJava.
- pjmlp 13y agoErlang, it is being used by a few game companies. http://de.slideshare.net/wooga/erlang-the-big-switch-in-social-games http://de.slideshare.net/wooga/erlang-the-big-switch-in-soci... http://de.slideshare.net/eonblast/an-erlang-game-stack http://de.slideshare.net/eonblast/an-erlang-game-stack http://vimeo.com/26307654 http://vimeo.com/26307654