Comments (8)
@SimonSapin would you be interested in attending such a meeting, and any thoughts about who else should attend?
from lang-team.
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.
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.
Sure, I already planed to post there in the right sub-threads, just got a phone call π [EDIT: done]
from lang-team.
I'd be keen to attend β But don't let my far-out timezone affect scheduling
from lang-team.
In today's lang meeting, @withoutboats volunteered to try to coordinate a design meeting for this.
from lang-team.
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.
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)
- Nail down cargo-script syntax proposal HOT 2
- T-types proposal for stabilizing type alias impl Trait (TAIT)
- 2024 Edition Review HOT 1
- Design meeting: resolve ABI issues around target-feature HOT 6
- Website broken HOT 5
- Design meeting: Rust for Linux
- Design meeting: Match ergonomics 2024
- Lang-team RFC guidelines appear to be out of date
- Design meeting: Profiles
- Bounds for RPIT/RPITIT/async fn
- Discuss RFC 2442: Simple postfix macros HOT 3
- Discuss Rust 2024 edition planning: 2024-01-10
- Discuss ideas for GSoC 2024 HOT 2
- Discuss feedback for T-spec sample chapters HOT 1
- Lang discussion: Item-level `const {}` blocks, and `const { assert!(...) }` HOT 1
- Discuss temporary lifetimes 2024 RFC HOT 1
- Discuss arbitrary self types v2 RFC
- Proposal: Remove `i128`/`u128` from the `improper_ctypes` lint HOT 7
- Discuss the never type situation
- Extended triage meeting 2024-03-20 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lang-team.