GithubHelp home page GithubHelp logo

Comments (8)

nikomatsakis avatar nikomatsakis commented on May 25, 2024

@SimonSapin would you be interested in attending such a meeting, and any thoughts about who else should attend?

from lang-team.

rustonaut avatar rustonaut commented on May 25, 2024

Edit: See discussions on the RFC RP instead.

I have one small thing about RFC 2580 which I think is a problem:

The way pointer thinning is done isn't very ergonomic, getting a thin pointer to the inner unsized value also requires unsafe code. I believe both should be doable without needing to write unsafe code. On the long run using custom DST types should preferably not be "magic" using pointer offsets and alignment fixing but easy to understand rust code.

E.g. if we have a thin pointer to a struct like struct Foo { f1: usize, f2: usize, dst: [u8] } we should still be able to access f1, f2 without unsafe code.

I know this makes this a bit more tricky as this likely would make Thin ptr. a language level thing instead of just a (core) library component.

E.g. something like foo: &Thin<Foo>, foo.f1: usize, foo.dst: &Thin<[u8]> and then we could have a fat pointer constructor which takes a *const Thin<T> instead of a *const () making it more type safe.

Through it's just the part about thin pointer which I think we could do better, the rest about getting metadata from fat pointers and creating new fat pointers and DynMetadata for trait object's seems all fine.

Through we should be aware that DynMetadata does two level of erasure: 1. the dyn type erasure and then 2. the erasure of what trait is left. By keeping the dyn Trait in some PhantomData we could later one extend it with vtable specific functionality. (i.e. DynMetadata<dyn Any>).

Lastly I would maybe remove some of the traits from the Pointee::Metadata bound, while all currently used metadata does fulfill the traits we might later one features which e.g. require non Send/Sync Metadata (e.g. dynamic VTables in thread local storage). But then all the features which would require it are so crazy that we probably don't want to support them anyway πŸ˜‰

I have to apologize for not commenting earlier, I was basically close to offline for half a year and before wasn't aware of this RFC (or more concrete that it still get's updated after it got delayed 2 years ago).

from lang-team.

SimonSapin avatar SimonSapin commented on May 25, 2024

Thanks @nikomatsakis for getting this moving again. Yes I’d like to attend. I’m in UTC+2. I’m not sure who else should, maybe a few folks who commented the most on the RFC?

@rustonaut I think technical discussion about the proposal should likely stay within the RFC PR comment thread as long as that’s open. Do you mind reposting there?

from lang-team.

rustonaut avatar rustonaut commented on May 25, 2024

Sure, I already planed to post there in the right sub-threads, just got a phone call πŸ˜„ [EDIT: done]

from lang-team.

KodrAus avatar KodrAus commented on May 25, 2024

I'd be keen to attend βœ‹ But don't let my far-out timezone affect scheduling

from lang-team.

joshtriplett avatar joshtriplett commented on May 25, 2024

In today's lang meeting, @withoutboats volunteered to try to coordinate a design meeting for this.

from lang-team.

nikomatsakis avatar nikomatsakis commented on May 25, 2024

This is now scheduled for Nov 4. We'll need some preparation work.

Sense for the meeting:

  • Immediate desire is to be able to manipulate representation of trait objects
    • Summary of the RFC and what it propses
  • But want to be forwards compatible with future developments like custom dst, dyn A + B, etc
    • Will therefore want a summary of some of those ideas and notes on how they interact

If folks can leave comments with notes on some of the future developments (e.g., pointers to RFCs, etc) that would be useful to help in preparing this document.

from lang-team.

nikomatsakis avatar nikomatsakis commented on May 25, 2024

Minutes posted: https://github.com/rust-lang/lang-team/blob/master/design-meeting-minutes/2020-11-04-RFC-2580-and-custom-dst.md

from lang-team.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.