K

Kyren

kyren.github.io · Personal blog · on HN since 2018

Kyren, a game developer who worked on Starbound, writes about Rust, game development, and entity component systems.

What HN saysHN commenters point to her RustConf 2018 keynote write-up as a strong case for Rust in game development and for using ECS.
18HN people shared it
17linked it in comments
1stories submitted
191story points
1 year agolast shared
2018people per year2026

Most-shared posts

  1. 1
    My RustConf 2018 Closing Keynote
    18 people · 191 points · first shared 2018 · 23 comments on HN

What HN people wrote when they linked it

dkbrk · 2025-07-24
It's a bit of a long read, but I think the best introduction is still this [0] and the comments were here [1]. Yes, it's presented in the context of rust and gamedev, but ECS isn't actually specific to a particular programming language or problem domain. [0]: https://kyren.github.io/2018/09/14/rustconf-talk.html [1]: https://news.ycombinator.com/item?id=17994464
yoklov · 2018-11-27
I use Rust daily, and it took me a while to be productive. Productive is hard to define, and I guess I'm not "all the way there"; the design of a Rust project still takes me longer than a C++ or JavaScript one, mostly due to its pervasive restrictions around mutability. There are still things I'd have trouble doing. I used to do game development professionally, and I still don't think I'd use Rust for it. I also have worked on virtual machines and high level programming language runtimes, and I wouldn't want to write a GC in Rust. (Yes, I've seen shifgrethor[0] and the rustconf 2018 closing keynote[1] (I was there, actually) -- both are great, but they're almost more examples of my point; Rust makes certain patterns much harder). [0]: https://github.com/withoutboats/shifgrethor/ [1]: https://kyren.github.io/2018/09/14/rustconf-talk.html
atoav · 2018-11-26
Sometimes there is just no right way when it comes to using OOP. Sure OOP is often a hammer that will make everything look like nails, but for some problems it really just isn’t the right approach at all. For a very good example when this is indeed the case, watch (or read!) this amazing talk by kyren on Game ECS: https://kyren.github.io/2018/09/14/rustconf-talk.html
donmcc · 2018-09-15
And here’s the follow-up blog post: https://kyren.github.io/2018/09/14/rustconf-talk.html
capitainenemo · 2024-01-15
IMO Kyren (the game dev who created a large portion of the Starbound game) covers this well in her Rust 2018 keynote. https://kyren.github.io/2018/09/14/rustconf-talk.html She is of the opinion Rust is well suited to game dev, and ECS is an excellent choice for a game design. She works off an example from the Starbound code. Her thesis. "Rust, by design, makes certain programming patterns more painful than others. This is a GOOD thing! It turns out that, for game development, the patterns that end up being the easiest to deal with in Rust closely mirror the patterns that are easiest for game development in any language. I unfortunately had to learn this the HARD way! Rust highly rewards data-oriented design with simple, understandable ownership semantics, and this is great news because this is a really good fit for game development. I suspect this is also true generally, not just for game development! (but what do I know?)"
cyber_kinetist · 2022-05-19
I've tried Rust before. in the end I concluded that I don't really need it over C++ for the following reasons: - I tend to store references to other objects using indices instead of pointers/references anyway, so the borrow checker isn't really that important for me. Memory errors that comes from indexing can be caught with runtime assertions, or if you can't use assertions because of performance constraints you can still use sanitizers to debug these issues. (You're probably going to run sanitizers even in Rust anyway if you are using unchecked array indexing...) Further use-after-free errors that come up with reusing indices in an object pool can be caught at runtime using the generational index trick. (See https://kyren.github.io/2018/09/14/rustconf-talk.html for the gist of what I'm talking about. The presenter listed this as a reason why Rust is good because the compiler nudges you circumvent the borrow checker to design better code, but for me this was actually a reason why Rust doesn't actually help that much at all: I don't need the guidance of the borrow checker to have this decision in the first place! She's actually giving a reason for why the borrow checker is useless!) - Also, Rust's compile-time facilities are still not as powerful as C++'s. For example in Rust you can't still do operations with integers in generics in compile time, you need to wait that until the full version of const generics. (This is important if you want to make a convenient math/linear…
Dirak · 2020-01-11
I would even take your learnings from your experience a step further and say that one should be proactive in talking to teammates and exploring ideas on how to improve the codebase if you think there is room for improvement. For instance, it may well be that inheritance is the wrong pattern for that given codebase, but there are indications that the current architecture isn't scalable. With more investment, more research could have been put into looking at better suited architectures such as the Entity Component System architecture, where Entities such as Rects and Ellipsis are composed of units of functionality (position, resizability, etc), which is a proven architecture for this sort of application. Then, implementation would be a matter of getting team buy-in / weighing the refactor pros and cons with your team. Tangential, but Entity Component Systems are a great way to structure systems with many types of entities that share subsets of functionalities. https://kyren.github.io/2018/09/14/rustconf-talk.html.
adamnemecek · 2019-03-15
"As the compiler will stop you from borrow checking or something unsafe again and again, you are being distracted constantly by focusing on the language itself instead of the problem you are solving. I know the friction is greater because I am still a Rust learner, not a veteran, but I think this experience stops a lot of new comers, speaking as someone who already conquered the uncomfortable syntax of Rust, coming from a C/C++ background." To be honest, this article seems somewhat ingenuous. The author wasn't comfortable with Rust, and it seems like he missed the point of the borrow checker. This article will now be circulated whenever Rust is discussed. Here is a good article that arrives at the opposite conclusion: https://kyren.github.io/2018/09/14/rustconf-talk.html I've been writing Rust full time for the last month and a half or so and the language is a joy to use. The main difference is that the code I write feels very sturdy and permanent. I've heard other people say the same thing.
halvnykterist · 2021-10-14
I think Kyren's 2018 CustConf talk [0] caused it to become popular earlier. Arewegameyet has an entire section for ECS crates, with 10 different entries. I'm aware of multiple smaller homegrown solutions, too. https://kyren.github.io/2018/09/14/rustconf-talk.html
steveklabnik · 2020-11-20
Rust folks think this as well; there has been a lot of activity in this area, and even spread some of the ideas behind ECSes to areas outside of games. https://kyren.github.io/2018/09/14/rustconf-talk.html
aarpmcgee · 2019-02-23
I don't think so. I believe the Starbound development was led by someone else. This is an interesting article written by that person. https://kyren.github.io/2018/09/14/rustconf-talk.html
rgoulter · 2019-02-15
Catherine West's RustConf keynote provides a good discussion about why you might want to organise "a program where objects interact" using an ECS system. She discusses the "how you might write it with standard-OOP", some drawbacks to this, and iterates this towards using an ECS system. https://kyren.github.io/2018/09/14/rustconf-talk.html I like that both this and TFA mention a focus on the data, and "row"/"column" roughly compares to (say) an SQL table. - It's an interesting way of thinking about objects/entities.
afiori · 2019-01-28
https://kyren.github.io/2018/09/14/rustconf-talk.html Is a good post about how that can fail from the creators of starbound. Relevant quote: A new requirement comes in: I have an idea for a special kind of item that when the player holds it and its near a specific kind of enemy, it will glow. The enemies that trigger this should be scared of the item and back away, but have a special animation where they’re mesmerized by the glowing item. This should only work for players that have achieved some specific quest goal. You throw up your hands in frustration [...]
Svip · 2018-11-22
Thank you for that link. Very useful. It already highlighted a solution in Rust for a problem that I've run into with my Go prototype. And I appreciate there also was a blog post to read.[0] I personally prefer articles over videos. [0] https://kyren.github.io/2018/09/14/rustconf-talk.html
lasagnaphil · 2021-02-04
Still, inside that copy constructor you're going to write the exact boilerplate code for recursively copying each node, so the complexity of code won't change that much. Also, you're going to call quite a lot of malloc/free, which could be a potential performance hit if you're creating/destroying large trees a lot, as well as fragmenting your memory if you're not careful. Personally I have a much easier time dealing with tree/graph data structures using indices, regardless of the language I'm using. Using indices as handles in general are just so much easier than using pointers in terms of memory management, and generally performs much better in terms of cache coherency. Indices are also easier to serialize/deserialize, and sometimes it just "makes sense" (for example, if you're developing a physics simulation, representing objects as indices are natural because you're going to use those index values inside various math equations.) The downside might be that if you're creating and destroying nodes in a tree continuously. then you have to be careful about reusing indices. There's a pattern in gamedev (generational indices) that solve the issue (basically, in addition to an index you also store a counter value with it, and you increment the counter everytime you allocate a new node in the same spot of the array. It's a bit more bookkeeping, but there's lots of code examples for it. It's kind of a well-known trick inside gamedev (and recently in the Rust community, in order…
Twisol · 2019-08-28
I think that we are subtly talking past each other, because what you're saying doesn't line up against what I thought I was saying. I'm not looking for additional type safety or security protections from this model. See my sibling comment to your earlier comment for a little more context [1]. As someone who works with Rust often, your assertions don't match my experience. I want to engage honestly and understand where Rust itself falters, versus where we need to invest in educating newcomers about what kinds of models are better represented in Rust than others. I have found the model I'm describing to be valuable in many ways -- more than a "hack" to get around Rust. > And of course the extra indirection is costly, especially for a systems language. To my knowledge, base-offset addressing is natively present on at least x86. With a vector-based index space like I was describing, a[b] == * (a + b) is no more costly than * b. If you would need a more complex index space, you were probably doing more than bare pointers already. > And you're also doing much more memory management. > because such hacks turn a simple logical operation into a series of multiple memory allocations No, no more than you would have needed with pointer-based naming. The top-level arena (a vector in the graph example) owns everything and can be deallocated all at once when you're done with it. Arenas were already a well-known pattern before Rust, and they can reduce the amount of manual memory…
ekidd · 2019-02-10
I've been programming in C and C++ since sometime around 1992 (and Pascal before that). For the last 3 years, I've been writing Rust professionally. Here's my Rust advice for C and C++ programmers: - Rust is a higher-level language than C. A C/C++ programmer could think of Rust as "C++ without most of the footguns and magic." - Certain types of C/C++ code will translate very easily to Rust. For example, if your code mostly transforms bytes (or data structures) into other bytes (or data structures), then Rust will usually be fairly easy to learn. We could call this "mostly functional" C code, with only localized mutability, and with clear, hierarchical data structures. Examples: Most typical Unix CLI tools. - Certain kinds of C and C++ will translate very badly to Rust. If you have a big web of mutable objects, all of which point to each other and update each other, then your first experience of Rust will probably be frustrating. Examples: doubly-linked lists, traditional GUIs, typical video games. You can do all these things in Rust, but you'll need to either re-architect them or use more advanced features. (See http://cglab.ca/~abeinges/blah/too-many-lists/book/ for doubly-linked lists, or https://kyren.github.io/2018/09/14/rustconf-talk.html for video games.) - Async Rust is not ready for prime-time. We make limited use of async Rust at work. It's rock-solid and powerful, but it's missing critical ergonomic features and it demands a surprisingly high level of Rust…

Keyboard shortcuts

/Search
j kNext / previous blog
EnterOpen selected blog
vVisit the blog site
fFollow / unfollow
lSwitch grid / list view
dSwitch dark mode
g hHome
g pTop posts
g tTopics
g fFollowing
g lLiked
g yHistory
g qFAQ
EscBack / close