110 points · by goranmoomin · 2y ago · 37 comments
Of course there are workarounds to circumvent this but they are a bit clunky.
Have been following Miguel de Icaza's work on Swift Godot and am really tempted to switch. Swift feels like an ideal language for game dev: type safe to allow frequent refactoring, a simple but effective (enough) memory management mechanism, good performance...
And de Icaza spearheading this makes it more compelling still. The guy takes on rather tricky engineering problems and sees it to completion.
As someone who likes lower level languages (like rust) I find gdscript to cover all my needs (since 2017)
It’s worth noting that they ported SS2 from unity to Godot, so it’s likely they were trying to keep as much of their existing code as they could, but tbh they’d probably use c# from the beginning regardless
It's a fine scripting language for hobby games or glue code. I would never do serious software development with it.
Writing a whole game in gdscript (and godot) seems totally fine.
Imo it’s a better language than Lua, and 100s of games are written in Lua.
Balatro, undertale, hotline Miami (anything in game maker)
For why Rust vs. C++, Rust is often able to handle embedded invariants through the type system, while in C++ you'd need to juggle them in your head, which scales a bit poorly through time or number of people working on the project. That said one thing that doesn't match well is the Godot is very inheritance based, which is a bit of an impedance mismatch for using Rust, but I've found gdext to translate these things into composition well enough.
I just don’t know if I want to pull in that complexity, yknow?
I’m waiting for bevy’s editor before I go too far into rust land for my games.
Ownership rules exist only at compile time and are not the reason it crashes at runtime.
Ownership rules can be arbitrarily violated by unsafe code which may cause a crash, or undefined behaviour but it does not prevent rust code from running.
Many “violates single ownership rules” (eg. Concurrent mutable references) actually dont break rust, because the undefined behaviour on many platforms happen to be “eh, does whatever c does, which is actually fine”.
It would be more correct to say that they must upheld to guarantee rust code functions correctly.
However, segfaults come from memory corruption, which comes from unsafe code; probably use after drop. It doesnt usually come from violating single ownership rules, and usually it’s from “object was dropped because it was owned and you forgot to keep it alive across a callback boundary” just like c++ code with unique_ptr
…but eh, whatever. The point is it crashes, which means the binding isn’t done correctly, whatever you call it. Lay blame where blame is due; the rust wrapper isn’t safe.
Something like a flash authoring and deployment used to be.