GNU social JP
  • FAQ
  • Login
GNU social JPは日本のGNU socialサーバーです。
Usage/ToS/admin/test/Pleroma FE
  • Public

    • Public
    • Network
    • Groups
    • Featured
    • Popular
    • People

Conversation

Notices

  1. Embed this notice
    Ryan (aer@freeradical.zone)'s status on Friday, 27-Dec-2024 02:14:58 JST Ryan Ryan

    Wrote a dinky little multithreaded chat server in Tokio, wasn't too hard.

    I did it using standard mutex/lock code to learn how it works, but typically prefer lockless code using pipes / actors. I think it suits the way I think about problems better, even if it is an abstraction

    It did make me wonder something about Rust, specifically how to avoid copies

    In conversation about 6 months ago from freeradical.zone permalink
    • Embed this notice
      Free Teks for sale, cheap (tek@freeradical.zone)'s status on Friday, 27-Dec-2024 02:14:55 JST Free Teks for sale, cheap Free Teks for sale, cheap
      in reply to

      @aer I found this post enlightening: https://jacko.io/object_soup.html

      In conversation about 6 months ago permalink

      Attachments

      1. No result found on File_thumbnail lookup.
        Object Soup is Made of Indexes
    • Embed this notice
      Ryan (aer@freeradical.zone)'s status on Friday, 27-Dec-2024 02:14:56 JST Ryan Ryan
      in reply to

      Mainly, my "database" is just a bunch of hashmaps in a struct. HashMap<i32, User>, HashMap<String, Room> etc

      What I don't get is, how do I implement a get_user function such that it returns a read-only reference to a User, as opposed to a cloned User object?

      I keep running into scoping/lifetime issues, and I get it. Realistically my Storage struct has a static lifetime, so it /should/ be fine, but the compiler doesn't know that

      Do I have to return an Rc?

      In conversation about 6 months ago permalink
    • Embed this notice
      Ryan (aer@freeradical.zone)'s status on Friday, 27-Dec-2024 02:26:04 JST Ryan Ryan
      in reply to
      • Free Teks for sale, cheap

      @tek Oh awesome, thanks

      Yeah coming from a dotnet/python background I definitely tend to structure my code this way, and Ruts (and systems code in general) is way less amenable to it, for good reasons

      Definitely a shift in the way of thinking

      In conversation about 6 months ago permalink
    • Embed this notice
      Free Teks for sale, cheap (tek@freeradical.zone)'s status on Friday, 27-Dec-2024 02:30:42 JST Free Teks for sale, cheap Free Teks for sale, cheap
      in reply to

      @aer For sure. I’m going through the same kind of learnings now after many years of Python.

      In conversation about 6 months ago permalink
    • Embed this notice
      Ryan (aer@freeradical.zone)'s status on Friday, 27-Dec-2024 02:34:28 JST Ryan Ryan
      in reply to
      • Free Teks for sale, cheap

      @tek Ha, getting towards the end of the article, I was thinking "I think I would use a HashMap", only for him to mention that

      Definitely didn't make the ECS connection, even having used a bit of Bevy. I hadn't considered using an ECS outside of game design but it makes a lot of sense

      In conversation about 6 months ago permalink

Feeds

  • Activity Streams
  • RSS 2.0
  • Atom
  • Help
  • About
  • FAQ
  • TOS
  • Privacy
  • Source
  • Version
  • Contact

GNU social JP is a social network, courtesy of GNU social JP管理人. It runs on GNU social, version 2.0.2-dev, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All GNU social JP content and data are available under the Creative Commons Attribution 3.0 license.