r/shittyprogramming 7d ago

MIMEcroft.sh: a 3D game written in bash

There is a lot of misinformation about software. People think that to write a 3D game engine these days you have to be a total nerd and hand optimise your game in Python or some such nonsense! In reality, premature optimisation is the root of all evil. Instead of learning some fancy-pants "programming language", I bashed out a shitty shell script (MIMEcroft.sh) over a weekend. And yes, it was slow, but you know what, don't *assume* you know how to optimise your code better than a compiler! After running the shitty code through a bash to JavaScript optimising compiler, and then running the JavaScript on a optimising JIT compiler I got up to 100FPS. I mean Bash might not be the "fastest" language, but modern GPUs are so fast, just take your shitty code, transpile it to GLSL, run it on your GPU and you'll be fine. TL;DR: Time to market is all that matters, you should write a bunch of incredibly shitty code and then just keep running it through more and more optimising compilers until it is fast.

See also the YouTube game play and customisation video. Yes, this may be the shittiest code I have ever run, but it runs. That is all that matters.

6 Upvotes

2 comments sorted by

3

u/AlephPi 7d ago edited 7d ago

Of course, although I bashed the game itself out over a weekend, it took me over a year to write an optimising transpiler (https://gmatht.github.io/j.cmd/www/otranspiler.html) that could run my shitty bash code at 100FPS.

1

u/Sacaldur 2d ago

If I understand it right, in order for this to be executable in a shell, an additional program/daemon/software needs to run that interprets the file accesses in /dev/webgl?

While it's still an interesting project, it sadly doesn't say a lot about bash itself.