Rust 1.0 has been released

But see that’s one of the things I like most about Rust, it’s quite abstract in many ways (albeit not the runtime) while still native. You get a lot of programmer convenience without the abstracted runtime (and associated costs).

That’s when Rust will be renamed to “Stainless Steel”… ::slight_smile:

Oh and while I’m on a tangent: hard and soft realtime is like java and javascript. The names are about the only thing common to them.

you nailed it! :wink: realtime merely means: “it takes real time” as in “it really takes time.”

It’s a problem I encountered in my voxel engine when turning up the world size to not-quite-but-almost-silly levels. No matter how hard I tried to pool data, there was inevitably a few bits of garbage that ended up being created all the time. The GC wasn’t running very frequently (probably every 3-10 seconds or so and only when moving quickly towards regions that then had to be generated), when it did run there was a noticable stutter. It’s not a constant lag, but more of an infrequent hit.

GC isn’t such a bad feature when you have proper control over what memory needs GC and what can be freed at the end of a scope, but that is not the case in Java, hence why pooling objects is such a common optimisation.

In Rust, everything is owned by something else, whether it’s a scope of a function, or another type (which is in turn owned by something). When a scope is exited or an object dropped, all of its contents in turn are dropped (Some functions and types provide ways around this behaviour, but are rarely needed). If you’re creating lots of garbage it’s because you’re explicitly storing it.

As for compilation speeds, yes they are quite slow. Fortunately, the bottleneck is LLVM’s optimisation passes, and so any errors will be caught reasonably quickly and compilation aborted. Coupled with the fact that most bugs are caught at compile time, once you’ve successfully compiled, any bugs will be silly logic errors (or abuse of unsafe {} code)

A few more reasons I like Rust over Java for gamedev

  • Lambdas & Closures (I’ll include this even though Java has it now. When I started with Rust, Java 8 was quite far away)
  • The standard library is quite comprehensive for important types such as String, Vec, Option, Result, etc, whether through providing the functions outright or through composing various methods and closures together.
  • The collections API is sane. For some reason in Java, Map is not a Collection.
  • Iterators are composable.

That’s not to say that Java doesn’t have some advantages:

  • Fast prototyping. Rust requires a bit more effort and thought to design the architecture of your game. In Java you can just write code and it generally works.
  • Not having to worry about ownership and borrowing. While a very powerful tool, it’s nice not to have to worry about it all the time.
  • Rust doesn’t have any mature GUI libraries (unless you count Servo, but that’s an embeddable brower engine, not relly a library)
  • Rust has extremely limited reflection. As evil as Java reflection is, it does have its uses.

I have started messing around with Rust and while I am getting a lot out of the experience, I am still getting hung up on the ownership, borrowing, and lifetime models. I feel like I am randomly adding 'as and & until it compiles.

Don’t worry. Took me about a year to fully understand how it all works. #rust on Moznet is a good place to ask for help on snippets of code.

eh what? What’s happening here?

Cas :slight_smile:

http://openjdk.java.net/jeps/173

Ah yes, but which one would you say was most useful for games?

Cas :slight_smile:

iCMS. What are you using? Is G1 making any progress? (Haha…thread hijack!)

Hrmm… no, G1 slashed framerates by half in my latest creation. I’ve not specified any GC options on the commandline (Java 8, 32 bit, server VM) and get perfect behaviour. What’s Java 8 server VM using by default these days?

Cas :slight_smile: