Internet burnout
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
kixik@lemmy.ml to Rust Programming@lemmy.ml · 3 years ago

SerenityOS author: "Rust is a neat language, but without inheritance and virtual dispatch, it's extremely cumbersome to build GUI applications"

mobile.twitter.com

external-link
message-square
7
link
fedilink
0
external-link

SerenityOS author: "Rust is a neat language, but without inheritance and virtual dispatch, it's extremely cumbersome to build GUI applications"

mobile.twitter.com

kixik@lemmy.ml to Rust Programming@lemmy.ml · 3 years ago
message-square
7
link
fedilink

Just sharing from r/rust

alert-triangle
You must log in or # to comment.
  • TankieReplyBot@lemmygrad.mlB
    link
    fedilink
    arrow-up
    1
    ·
    3 years ago

    A Twitter link was detected in your post. Here are links to the same location on Nitter, which is a Twitter frontend that protects your privacy.

    • nitter.net
    • nitter.it
    • nitter.unixfox.eu
  • TankieReplyBot@lemmygrad.mlB
    link
    fedilink
    arrow-up
    1
    ·
    3 years ago

    A Twitter link was detected in your post. Here are links to the same location on Nitter, which is a Twitter frontend that protects your privacy.

    • nitter.net
    • nitter.it
    • nitter.unixfox.eu
  • TankieReplyBot@lemmygrad.mlB
    link
    fedilink
    arrow-up
    1
    ·
    3 years ago

    A Twitter link was detected in your post. Here are links to the same location on Nitter, which is a Twitter frontend that protects your privacy.

    • nitter.net
    • nitter.it
    • nitter.unixfox.eu
  • nachtigall@feddit.de
    link
    fedilink
    arrow-up
    1
    ·
    3 years ago

    Oh please not. Spare us from the C++ type-polymorphy nightmare. Traits are so much better than inheritance.

  • Tin Švagelj@mastodon.social
    link
    fedilink
    arrow-up
    1
    ·
    3 years ago

    @kixik Inheritance can always be substituted by composition which is what #Rust does pretty well. Constexpr isn’t on C++ level, but I guess you can generate code from build script so there’s ways around it.
    As for virtual functions - Traits are effectively to virtual function lookup table declarations that get used by dyn SomeTrait type. So calling a fn on Box\<dyn T\> generates VMT lookup.

    • Tin Švagelj@mastodon.social
      link
      fedilink
      arrow-up
      1
      ·
      3 years ago

      @kixik Thanks to good macro system Rust can (via enum_dispatch) transform those lookups into a switch statement which is best of both worlds IMO.

Rust Programming@lemmy.ml

rust@lemmy.ml

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@lemmy.ml
Visibility: Public
globe

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

  • 1 user / day
  • 2 users / week
  • 144 users / month
  • 313 users / 6 months
  • 5 local subscribers
  • 9.07K subscribers
  • 344 Posts
  • 1.09K Comments
  • Modlog
  • mods:
  • Nutomic@lemmy.ml
  • Joe@lemmy.ml
  • AgreeableLandscape@lemmy.ml
  • BE: 0.19.14
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org