Live data from Hacker News

Leaving Rust gamedev after 3 years

loglog.games

961–970 of 996 posts

Re: Leaving Rust gamedev after 3 years

#961
post #958

Earlier quoted context omitted.

It’s a bad habit to read too much into a single job posting. (oh, I remember now, it’s the account traumatized by odata)

I’m not sure why you’re trying to make it seem like Microsoft isn’t rewriting the core of their 365 business products from C# to Rust, but you do you I guess. As far as I’m aware I was never traumatised by OData. It’s true that I may have ranted about the sorry state of the public packages available outside of C# or Java. Not unwarranted criticism I think, but I wrote our own internal adaptation which now powers basi…

Alright, if not for that one job posting, I’m curious where you are getting this information from?

Re: Leaving Rust gamedev after 3 years

#962
They should open source their game engine. That way we can learn from their mistakes. How can we be sure this is a shortcoming of the language and not the APIs the author is working with?

Anyway - no one is going to ship a game written in Rust with this attitude. To the other folks out there happily writing their games in Rust - don't be distracted! All it takes is one success story to prove the concept :)

Re: Leaving Rust gamedev after 3 years

#963
I don't have nearly the same amount of experience with Rust (just a few months of hobby coding), but whenever people looked at me, all surprised, that I don't like Rust that much I always just said "Safety is not the most important thing for everything. For the stuff I am doing I'd rather be quick", but this article is the most thorough way of explaining that I have seen with lots of extra stuff I had no idea about before. Also the extra random gamedev links in the middle were great, but it took me well over a full, focused hour to read. It is thorough, but some more brevity might have helped, I think.

Re: Leaving Rust gamedev after 3 years

#964

I've worked on Ambient Engine and now on the Bevy engine. I totally agree with these points, very valuable. I only make some comments from my professional (audio) perspective: We need the highlight author's affirmation of cli. Rust's tui (ratatui) is great. I used it to make Glicol-cli [1]. If you are a Linux user, you are welcome to test the music production of the code. Speaking of game audio, I actually think rust…

This looks very cool. Are there more videos of glicol being used live?

https://youtube.com/playlist?list=PLT4REhRBWaOOrLQxCg5Uw97gE...

Re: Leaving Rust gamedev after 3 years

#965
post #24

My impression of Rust is that it's a very opinionated language that wants everybody to program in a specific way that emphasizes memory safety above everything. That's a good idea, I think, for the systems programming use cases that it was intended for. I don't see that as a particularly useful thing to value for game development. The part in the article about the Rust borrow checker constantly forcing refactors soun…

> I'd think that an ideal game dev language would be programmer time efficient, reasonably performant and designed for skilled programmers who can handle a language filled with footguns

Sounds like Common Lisp or OCaml would work well. With Ocaml I find myself being able to iterate extremely quickly because of the inferred types and extremely fast compilation times. You also have the ability to tweak the GC to your needs and the assembly is easy to read.

Lisp is well… built for interactive development

Re: Leaving Rust gamedev after 3 years

#966
post #19

As much as I love Rust I sometimes wonder if I'd be more productive in a simpler language. If I wrote it every day I'm not sure that would be true, but as a hobbyist coming back to Rust sometimes takes me a bit to get back in the zone. Also, still not a fan of async, as it is woefully incomplete and fairly complicated in some use cases. That said, I just can't go back to Go with nil pointers and lack of decent enums/…

OCaml could be that language. I’m not convinced that ecosystem is so important for game dev. Once you have a simple graphics library, bindings to BulletPhyiscs etc most of the code is custom simulation code with no integrations needed.

I can echo OCaml. It is probably the most underrated language imo. It has great compilation times, macros, type inference, good tooling. With few exceptions, the library ecosystem doesn’t suffer from the same overengineering issues as Haskell and types are kept relatively simple. It has simple runtime characteristics making it easy to optimize performance when needed, although it tends to be very fast in general.

Re: Leaving Rust gamedev after 3 years

#967
post #957

Earlier quoted context omitted.

I'd want to see perf stats on branch prediction misses and L1 cache evictions alongside that though. CPU cycles on their own aren't enough.

It doesn't seem my perf provides metric for L1 cache evictions (per perf list). Here's the results for 100000 rounds for taskset 1 perf record -F10000 -e branch-misses -e cache-misses -e cache-references target/release/RustTokioBenchmark (a)sync; perf report --stat though: async Task 2 min roundtrip time: 532 [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0,033 MB perf.data (117 sam…

Interesting. Thing is all you're benchmarking is the cost of sending a message on tokio's channels vs mpsc's channels.

It would be interesting to compare with crossbeam as well.

But not sure this reflects anything like a real application workflow. In some ways this is the worst possible performance scenario, just two threads spinning and spinning at the fastest speed they can, dumping messages into a channel and pulling them out? It's a benchmark of the channels themselves and whatever locking/synchronization stuff they use.

It's a benchmark of a "shared concurrent data" situation, with constant synchronization. What would be more interesting is to have longer running jobs doing some task inside themselves and only periodically (ever few seconds, say) synchronizing.

What's the tokio executor's settings by default there? Multithreaded or not? I'd be curious how e.g. whether tokio is actually using multiple threads or not here.

Re: Leaving Rust gamedev after 3 years

#968
post #797
post #13

Earlier quoted context omitted.

Yeah, I rather like the pattern of embedding a more rapid iteration scripting language on top for game stuff like Lua or stripped down Python variants, using Rust as the core and hot loop code. That said, there is a lot of folks wanting to do it all in Rust, and the article touches pretty well on that not being the pleasant case for a lot of valid gamedev approaches.

Lua is often used for this in gaming.

Yup! I found Lua pretty lovely to use with Rust in my case.

Re: Leaving Rust gamedev after 3 years

#969
post #957

Earlier quoted context omitted.

It doesn't seem my perf provides metric for L1 cache evictions (per perf list). Here's the results for 100000 rounds for taskset 1 perf record -F10000 -e branch-misses -e cache-misses -e cache-references target/release/RustTokioBenchmark (a)sync; perf report --stat though: async Task 2 min roundtrip time: 532 [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0,033 MB perf.data (117 sam…

Interesting. Thing is all you're benchmarking is the cost of sending a message on tokio's channels vs mpsc's channels. It would be interesting to compare with crossbeam as well. But not sure this reflects anything like a real application workflow. In some ways this is the worst possible performance scenario, just two threads spinning and spinning at the fastest speed they can, dumping messages into a channel and pull…

Actually I wasn't that interested in throughput, only the latency in terms of instructions executed since sending until it is received, though indeed the throughput is also superior with tokio.

For most applications this difference doesn't really matter, but maybe some applications do a lot of small things where it does matter? In those cases it might be an easy solution to switch from standard threads to tokio async and gain 10x speed, as the structure of the applications remains the same.

> It's a benchmark of the channels themselves and whatever locking/synchronization stuff they use.

Yeah, in retrospect some mutex-benchmark might be better, though I don't expect a message channel implemented on top of that is noticeably slower. A mutex benchmark is probably easier to get wrong..

> What would be more interesting is to have longer running jobs doing some task inside themselves and only periodically (ever few seconds, say) synchronizing.

I don't quite see how this would give any different results. Of course, in that case the time it takes to transmit the message would be completely meaningless.

> What's the tokio executor's settings by default there? Multithreaded or not? I'd be curious how e.g. whether tokio is actually using multiple threads or not here.

It's using the multithreaded executor. I tried the benchmark with #[tokio::main(worker_threads = 1)] and 2 and while with =1 the result was 529 but with =2 it was 566.

Re: Leaving Rust gamedev after 3 years

#970
post #889

Earlier quoted context omitted.

I'm not answering your question here, just saying my opinion on C++ vs Rust. I think that the big high-level difference (before diving into details like ownership and the borrow checker) is that C++'s safety is opt-in, while Rust's safety is opt-out. So in C++ you have to be careful each time you allocate or access memory to do it in a safe way. If you're working in a team, you all have to agree on the safe patterns…

An evolution of the C++ model could be something like Hylo. Hylo is safe. Hylo does not need a borrow checker. Hylo does not need a garbage collector. That is what I mean by evolution. I do not mean necessarily C++ with Core Guidelines.

I think you replied to the wrong reply.
Post reply on HN