awful.systems
  • Communities
  • Create Post
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
Nemeski@mander.xyz to Rust@programming.dev · 16 days ago

Switching to Rust's own mangling scheme on nightly

blog.rust-lang.org

external-link
message-square
3
link
fedilink
41
external-link

Switching to Rust's own mangling scheme on nightly

blog.rust-lang.org

Nemeski@mander.xyz to Rust@programming.dev · 16 days ago
message-square
3
link
fedilink
Switching to Rust's own mangling scheme on nightly | Rust Blog
blog.rust-lang.org
external-link
Empowering everyone to build reliable and efficient software.
alert-triangle
You must log in or # to comment.
  • INeedMana@piefed.zip
    link
    fedilink
    English
    arrow-up
    1
    ·
    15 days ago

    It would be cool if there was an option to tell compiler how to name the object in the end. A strength of C mangling (or rather lack of it) is that you can take the object file and know beforehand the names. With mangling that will always depend on the version of the compiler. In practice, while mangled names are kind of stable, mangled C++ names are not really reliable in the real world

    If we could tell the compiler “in the end name/alias this function as prefix_or_name_of_cargo_my_super_duper_function”, we could then easily call it in an assembler/pure C/etc
    It could even be a separate wrapper. only for exposing stable function names in the object files

    • SavvyWolf@pawb.social
      link
      fedilink
      English
      arrow-up
      2
      ·
      15 days ago

      https://doc.rust-lang.org/reference/abi.html#the-no_mangle-attribute https://doc.rust-lang.org/nomicon/other-reprs.html#reprc

      Does no_mangle and repr(c) do that?

      • INeedMana@piefed.zip
        link
        fedilink
        English
        arrow-up
        2
        ·
        15 days ago

        Those are good to know, thanks. But as far as I understand, attribute enforces unsafe, repr is more about the data layout. Right?

        But in there, I’ve found https://github.com/mozilla/cbindgen. Wicked

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.

  • 16 users / day
  • 93 users / week
  • 384 users / month
  • 1.09K users / 6 months
  • 8 local subscribers
  • 7.53K subscribers
  • 1.04K Posts
  • 4.29K Comments
  • Modlog
  • mods:
  • snowe@programming.dev
  • Ategon@programming.dev
  • EdTheLegendary@programming.dev
  • kahnclusions@programming.dev
  • torcherist@programming.dev
  • BE: 0.19.12
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org