• xigoi@lemmy.sdf.org
    link
    fedilink
    arrow-up
    3
    arrow-down
    1
    ·
    1 year ago

    Each request is a totally independent request that rebuilds the world. There’s no shared state (unless you want there to be).

    I with there was a language with this model, but without the language itself being completely garbage.

    • RonSijm@programming.dev
      link
      fedilink
      arrow-up
      6
      ·
      1 year ago

      Isn’t that the same as modern languages? For example in ASPCore / C#, you can just register all your services with a lifetime scoped to the request, and then there’s no shared state.

      If you want there to be a shared state, you’d just have to register your services with a higher lifetime scope, like with a singleton scope

    • TCB13@lemmy.world
      link
      fedilink
      English
      arrow-up
      4
      arrow-down
      2
      ·
      1 year ago

      And there is… its called PHP. JS doesn’t have this model because it is complete garbage slow and wouldn’t ever run fine and reasonable in that model.