I'm designing a game, but this question is applicable to any situation that requires bidirectional communication between nodes in a cluster and a main server. I am pretty new to clusters, but I actively program in Go and occasionally in D.
I really want to use a modern language (not C/C++), so I've chosen these two languages because:
- Array slices
- Good concurrency support
- Cross platform & compiles natively (with multiple compiler implementations)
- GC (both working on a precise GC)
I've read https://stackoverflow.com/questions/3554956/d-versus-go-comparison and The D Programming Language for Game Development.
At a high level, my game will do most of the processing server side, with the client just rendering the game state from their perspective. The game is designed to scale, so it will need to act in a cluster. Components are mostly CPU bound, and update to a main server asynchronously, which shares game state with clients. Most computation depends on user input, so these events need to be sent down to individual components (hence bi-directional RPC).
Reasons I like D:
- Manual memory management
- Templates/CTFE
- Code safety (@safe, contracts, in/out)
Reasons I like Go:
- Standard library (pprof, RPC)
- Go routines
go
tool (esp.go get -u
to install/update remote dependencies)
The client will likely be written in D, but that shouldn't have an impact on the server.
I am leaning towards D because manual memory management is baked into the language. While it doesn't have the nice libraries for RPC, I could theoretically implement that, but I cannot as elegantly implement manual memory management in Go.
Which would you use for this problem given the choice between the two languages?