Beehaw
  • Communities
  • Create Post
  • search
    Search
  • Login
  • Sign Up
fettuccinecode ( fettuccinecode@programming.dev )  to Rust@programming.dev · 3 years ago

Object Soup is Made of Indexes

jacko.io

external-link
message-square
6
link
fedilink
11
external-link

Object Soup is Made of Indexes

jacko.io

fettuccinecode ( fettuccinecode@programming.dev )  to Rust@programming.dev · 3 years ago
message-square
6
link
fedilink
alert-triangle
You must log in or register to comment.
  • Beej Jorgensen ( beejjorgensen@lemmy.sdf.org ) 
    link
    fedilink
    arrow-up
    6
    ·
    3 years ago

    I like this approach for Rust in general when it comes to graphs. But it suffers from many of the same kinds of issues we get with pointers, e.g. dangling pointers, use after free, and so on. Tradeoffs!

  • Anders429 ( Anders429@programming.dev ) 
    link
    fedilink
    arrow-up
    5
    ·
    3 years ago

    If you want to go one step further, a lot of game development uses a generational index, where the index is both a value and a generation, allowing you to know whether the index you currently have stored references an object that has already been destroyed and replaced by another object. Basically every ECS framework I’ve ever seen uses this pattern.

    • huntrss ( huntrss@feddit.de ) 
      link
      fedilink
      arrow-up
      3
      ·
      3 years ago

      Interesting. Can you provide a good link regarding generational index?

      • Anders429 ( Anders429@programming.dev ) 
        link
        fedilink
        arrow-up
        2
        ·
        3 years ago

        I was originally introduced to the idea by this RustConf 2018 keynote: https://kyren.github.io/2018/09/14/rustconf-talk.html. It’s rather dense though.

        I did find this random article that outlines just the concept of generational indices pretty concisely: https://lucassardois.medium.com/generational-indices-guide-8e3c5f7fd594

        • huntrss ( huntrss@feddit.de ) 
          link
          fedilink
          arrow-up
          2
          ·
          3 years ago

          Thanks

  • EthicalAI ( EthicalAI@beehaw.org ) 
    link
    fedilink
    arrow-up
    1
    ·
    3 years ago

    This is exactly right and very educational

Rust@programming.dev

rust@programming.dev

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !rust@programming.dev

Welcome to the Rust community! This is a place to discuss about the Rust programming language.

Wormhole

!performance@programming.dev

Credits
  • The icon is a modified version of the official rust logo (changing the colors to a gradient and black background)
Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 10 users / day
  • 79 users / week
  • 211 users / month
  • 776 users / 6 months
  • 118 local subscribers
  • 8.39K subscribers
  • 1.31K Posts
  • 3.88K Comments
  • Modlog
  • mods:
  • snowe ( snowe@programming.dev ) 
  • Ategon ( Ategon@programming.dev ) 
  • EdTheLegendary ( EdTheLegendary@programming.dev ) 
  • torcherist ( torcherist@programming.dev ) 
  • BE: 0.19.21
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code