▲ | dathinab 4 days ago | |||||||
yes the main issue here is that it's basically a list of thing which are "lang_item"s, i.e. have a `#[lang = ...]` attribute or are build in `&/&mut/str/[T]` etc. (but then for some reasons lists combinations of them!?). But `#[lang]` is mainly there to map types to some compiler special casing which might be as trivial as a optimization hint... and the thing with that is it's - not useful for teaching *at all* as it's not representing the semantic/logical building blogs, or what "core" means in rust terms or what you have to learn when learning the language or anything. _It pretty much only is relevant if you write the compiler or the standard library for rust_. - isn't really that useful for know what the "core" of rust is (as many of this items only have a lang tag to make sure some "special case" optimizations, compiler messages, etc. map correctly, and at least in the past you also didn't really have to have all lang items to use rust in a _very_ cut down way) - conflicts with the term of lib-core (which is a very cut down version of lib-std for embedding use-cases where you e.g. might not have alloc, but you can even write rust without lib-core) E.g. `Termination` isn't a "core" rust feature, it's a nice customization hook which main exist so that you can have all of `!, (), ExitCode, Result<T,E>` as return types of main, which is mostly irrelevant outside of some QoL edge cases. In general you don't need to know about it and in 99% of cases you shouldn't implement it either. E.g. Deref,DerefMut, Index, IndexMut, the various Range types, the various operator aren't really special in any way except "hey they have first class syntax" and thats it, the #[lang] tag just tell the compiler "if you find += map it to AddAsing::add_assign". E.g. the lang tag on `Ordering` is basically a optimization hint AFIK. etc. etc. there really is little use for the overview outside of a curiosity and calling it the "core elements" of rust is really just very very misleading | ||||||||
▲ | MeetingsBrowser 3 days ago | parent [-] | |||||||
> not useful for teaching at all ... _It pretty much only is relevant if you write the compiler or the standard library for rust_. This seems a little hyperbolic. > isn't really that useful for know what the "core" of rust is In the same way it isn't useful for python developers to know what the stack and heap are, maybe. > conflicts with the term of lib-core I don't know what group of people might see this and get it confused with lib-core. Most people looking at this will never encounter lib-core directly, the rest are unlikely to look at this and think it has anything to do with lib-core. > Deref,DerefMut, Index, IndexMut, the various Range types, the various operator aren't really special in any way except "hey they have first class syntax" first class syntax makes them pretty special IMHO > there really is little use for the overview outside of a curiosity I think its a great way to get a high level view of the Types/Traits provided by Rust. | ||||||||
|