OT: Leaving Rust gamedev after 3 years

evilrat evilrat666 at gmail.com
Sat Apr 27 04:46:40 UTC 2024


On Friday, 26 April 2024 at 23:14:41 UTC, Matheus Catarino wrote:
> On Friday, 26 April 2024 at 18:41:11 UTC, ryuukk_ wrote:
>> https://loglog.games/blog/leaving-rust-gamedev/
>>
>> Discussion here: https://news.ycombinator.com/item?id=40172033
>>
>> We should encourage these people to check out D
>
> And what would be the selling point?
>
> If GC were to receive more (offensive) criticism, compared to 
> other languages, it wouldn't be worth it.
>
> I'm not a game developer, but when it comes to graphics 
> programming dealing with floating point, NaN will be a problem 
> that not everyone has experience or patience in dealing with.

Adding to that - practically no task specific libraries.

You need complex FBX scene importing setup to change things on 
import? good luck with that.
You need navigation and pathfinding? good luck with that.
You need physics engine that is not going to stuck on collision? 
right, you should've already guess it.

extern(C++) with all mess such as const applied to different 
parts e.g. `const foo* const` vs `const foo*` the former has a 
mangling scheme that is not supported by D, great.

---

Dealing with non-D libraries as well when using GC managed 
references(arrays, objects) is PITA, you have basically slap 
`__gshared` on every reference because as soon as it crosses 
thread boundary it is gone, very funny debugging awaits you in 
this path.

As was mentioned in another thread dealing with const and @safe 
is another level of PITA.

We also have our own @nogc and "GC bad" zealots.

---

Add to that compiler bugs, for example when working on 
godot-dlang compiler spits random error message in template with 
`return` scope, probably because there is loads of cyclic 
imports, but the message says something completely unrelated so I 
just given up on `return` and now it is basically leaking up 
refcounted reference leading to more bugs when used incorrectly.

Here is an example of such problem, getTexture returns Ref! 
wrapper that has leaky alias this, this means that getTexture 
immediately returns released instance.

Sure this is my problem, and I suck at programming.

```d
void setTexture(Mesh3D* mesh) {
     // let's assume we just want to invert colors
     Texture2D tex = mesh.getTexture;
     // code that inverts colors
     mesh.setTexture(tex); // oops
}
```

This all is just little annoying nuances, but how much it is 
really different from that "i'm done with rust" article?



More information about the Digitalmars-d mailing list