Alexander Ryzhov
Jan 11, 2025

Choose right tool for the job

In context of programming it’s a real problem when something is used not by initial intention. Most popular example - JavaScript. Developed initially to create dynamic and interactive web sites, nowadays it is used for everything from servers to even embedded stuff (i recall some arduino product was developed to run js). That’s crazy, and produces slow and unreliable software. I won’t say that dereferencing pointers in C is totally reliable thing, but at least we have control of what we’re doing.

JS is OK solution for browsers (though modern sites are written like i’m supposed to have NASA computer), if used by intention - control the DOM, send requests, etc. No more than that.

I was developing Python web-backends for a long time. The choice of this interpreted language was justified by having deeply integrated (i mean coupled) pytorch code which we needed to support for our computer vision tasks.

I don’t want to say that Python-written web-backend was a disaster, compared to usual simplicity of the web it’s pretty decent solution, but in our case an improvement could be made. Not so hardcore as going C or Rust (which i consider not the right tools for average web applications), but more restrictive when it comes to types than Python, something that is: simple, compiled, preferably garbage collected, and with reliable and convenient parallelization (mainly for I/O). The choice was great and obvious: Go. Now i consider this language as the top solution to my web-related tasks, with decent simplicity for fast iteration, no redundancy, simple error handling, brilliant goroutines and solid platform for supporting bigger codebases.

I leave Python for several other categories, which i consider it’s great for:

  • Scripting: Call this and that, merge the result, send somewhere.
  • Web integration testing: a special case of scripting: send requests here and there, validate the result. Pytest is a great library for this.
  • Prototype: Do some proof of concept, if the idea verifies, rewrite to an appropriate language.
  • Data science: Not my field, but i guess possibility of fast prototyping is good when you need to process data in different ad-hoc ways.

And of course, for gamedev, it’s a long (and often painful) story. Games need to work with memory in most efficient and convenient way. De-facto standard for now is C++, but after some research of the language i don’t feel it’s going towards simplicity, which is crucially required for fast development cycles. All these std::unique_ptr drive me crazy. Ideally i want a language with ideally one true way of doing the thing.

I always can comeback to favourite never-dying C, but some concepts, like headers, seem too nasty to me, such i don’t want to implement big projects with it. I can comeback writing C from time to time, maybe some researching projects, or old-systems programming, but for serious stuff i think we need to move on. To choose more modern approach.


What do we have today for gamedev amongst new languages?

I can speculate only about languages i’ve tried for something beyond Hello World. If i haven’t tried something yet, i will mark this explicitly:

  • C#: Garbage collected - no way. Exceptions - no way. Plus C# buys too much into ideas of structuring the program into classes, which causes, as i can see, too much redundancy combined with namespacing. We like clear uncoupling of the data from functions.
  • Java: don’t say this combination of letters again.
  • Go: Good for web as i’ve said above, but garbage collected, which is no way for gamedev.
  • Rust: IMHO too high-friction for gamedev, even for web it feels too restrictive. We want to reduce cost of development, and something that increases it should be a clear win for us.
  • Jai: Haven’t tried this yet, but according to what i see, this might be a big win for gamedev. Cannot use it for now since it’s in closed beta, but i’m looking forward access or public release.
  • Zig: That’s interesting approach, which might be suitable for gamedev. No GC, clean error handling, high control of the memory, compatible with C. I’ve started using Zig for one of my projects with raylib, will see how it goes.
  • C3: Interesting, compatible with C. Will take a peak into it.

Worth noting that currently i develop my next title in Godot, and it’s scripting language GDScript is great: designed specifically for the needs of the gamedev and specifically for the engine. I have some thoughts about dangers of scripting languages in games, but for smaller games which i plan to start from, it seems ok. Time will show.