5 ms·
I love Rust, but this lines up with my experience roughly. Especially the rapid iteration. Tried things out with Bevy, but I went back to Godot. There are so m
by lynndotpy 2y ago
I love Rust, but this lines up with my experience roughly. Especially the rapid iteration. Tried things out with Bevy, but I went back to Godot.
There are so many QoL things which would make Rust better for gamedev without revamping the language. Just a mode to automatically coerce between numeric types would make Rust so much more ergonomic for gamedev. But that's a really hard sell (and might be harder to implement than I imagine.)
- __loam 2y agoI used to hate the language but statically typed GDscript feels like the perfect weight for indie development
- IshKebab 2y agoYeah I haven't really used it much but from what I've seen it's kind of what Python should have been. Looks way better than Lua too.
- __loam 2y agoI like it better than python now, but it's still got some quirks. The lack of structs and typed callables are the biggest holes right now imo but you can work around those
- stefanka 2y agoIt is indeed great for creating a prototype. After that, one can gradually migrate to Rust go benefit from faster execution times. The Rust bindings are in a pretty decent shape by now https://godot-rust.github.io/ https://godot-rust.github.io/
- N_Lens 2y agoNowadays we have the luxury of LLMs to help migrate projects/code from one language to another. I would imagine a pipeline with Rust as an intermediate “compiled” step might be possible. LLM accuracy isn’t there yet, but I can dream.
- stefanka 2y agoIt is not that complicated or time-consuming to do the transformation manually. On the contrary, it's even fun and a good practice (but admittedly, I do have a rather conservative view on the matter)
- Seattle3503 2y agoWhat numeric types typically need conversions?
- koakuma-chan 2y agoThe fact you need a usize specifically to index an array (and most collections) is pretty annoying.
- anticrymactic 2y agoThis could be different in game dev, but in the last years of writing rust (outside of learning the language) I very rarely need to index any collection. There is a very certain way rust is supposed to be used, which is a negative on it's own, but it will lead to a fulfilling and productive programming experience. (My opinion) If you need to regularly index something, then you're using the language wrong.
- ChadNauseam 2y agoThis is getting downvoted but it's kind of true. Indexing collections all the time usually means you're not using iterators enough. (Although iterators become very annoying for fallible code that you want to return a Result, so sometimes it's cleaner not to use them.) However this problem does still come up in iterator contexts. For example Iterator::take takes a usize.
- kevincox 2y agoWhile you maybe "shouldn't" be indexing collections often (which I also don't agree with, there is a reason that we have more collections then linked lists, lookup is important) even just getting the size of a collection which is often very related to business logic can be quite annoying.
- AndrewDucker 2y agoFor data that needs to be looked up mostly I want a hashtable. Not always, but mostly. It's rare that I want to look up something but its position in a list.
- dcow 2y agoString conversions too
- ChadNauseam 2y agoI wish more languages would lean into having a really permissive compiler that emits a lot of warnings. I have CI so I'm never going to actually merge anything that makes warnings. But when testing, just let me do whatever I want! GHC has an -fdefer-type-errors option that lets you compile and run this code: a :: Int a = 'a' main = print "b" Which obviously doesn't typecheck since 'a' is not an Int, but will run just fine since the value of `a` is not observed by this program. (If it were observed, -fdefer-type-errors guarantees that you get a runtime panic when it happens.) This basically gives you the no-types Python experience when iterating, then you clean it all up when you're done. This would be even better in cases where it can be automatically fixed. Just like how `cargo clippy --fix` will automatically fix lint errors whenever it can, there's no reason it couldn't also add explicit coercions of numeric types for you.
- zaptheimpaler 2y agoYeah this is my absolute dream language. Something that lets you prototype as easily as Python but then compile as efficiently and safely as Rust. I thought Rust might actually fit the bill here and it is quite good but it's still far from easy to prototype in - lots of sharp edges with say modifying arrays while iterating, complex types, concurrency. Maybe Rust can be something like this with enough unsafe but I haven't tried. I've also been meaning to try more Typescript for this kind of thing.
- myaccountonhn 2y agoI think OCaml could be such a language personally. Its like rust-lite or a functional go.
- cantrecallmypwd 2y agoXen and Wall St. folks use it.
- jimbokun 2y agoSome Common Lisp implementations like SBCL have supported this style of development for many years. Everything is dynamically typed by default but as you specify more and more types the compiler uses them to make the generated code more efficient.
- tetha 2y agoYeh, I've been tinkering around a year with a Bevy-competitor, Amethyst until that project shut down. By now, I just don't think Rust is good for client-side or desktop game development. In my book, Rust is good at moving runtime-risk to compile-time pain and effort. For the space of C-Code running nuclear reactors, robots and missiles, that's a good tradeoff. For the space of making an enemy move the other direction of the player in 80% of the cases, except for that story choice, and also inverted and spawning impossible enemies a dozen times if you killed that cute enemy over yonder, and.... and the worst case is a crash of a game and a revert to a save at level start.... less so. And these are very regular requirements in a game, tbh. And a lot of _very_silly_physics_exploits_ are safely typed float interactions going entirely nuts, btw. Type safety doesn't help there.
- deleted 2y ago[deleted]
- zxvkhkxvdvbdxz 2y ago> Yeh, I've been tinkering around a year with a Bevy-competitor, Amethyst until that project shut down. By now, I just don't think Rust is good for client-side or desktop game development. I don't think your experience with Amethyst merits your conclusion of the state of gamedev in rust, especially given Amethysts own take on Bevy [1, 2]. 1: https://web.archive.org/web/20220719130541mp_/https://community.amethyst.rs/t/bevy-engine-addressing-the-elephant-in-the-room/1645?u=erlend_sh https://web.archive.org/web/20220719130541mp_/https://commun... 2: https://web.archive.org/web/20240202140023/https://amethyst.rs/posts/amethyst--starting-fresh https://web.archive.org/web/20240202140023/https://amethyst....
- pcwalton 2y ago> Just a mode to automatically coerce between numeric types would make Rust so much more ergonomic for gamedev. C# is stricter about float vs. double for literals than Rust is, and the default in C# (double) is the opposite of the one you want for gamedev. That hasn't stopped Unity from gaining enormous market share. I don't think this is remotely near the top issue.
- lynndotpy 2y agoI have written a lot of C# and I would very much not want to use it for gamedev either. I can only speak for my own personal preference.