▲ | q3k 4 days ago | ||||||||||||||||
Is it just me, or does this seem a surprisingly bad teaching aid? I mean, it's correct and concise, but it almost distracts from the things that actually matter. I feel if I was learning Rust again this would've been almost useless, if not actually demotivating (because of how much complexity it shoves in your face all at once). It reminds me of one of the ways of visually laying out elementary particles according to the Standard Model. And now I wonder how much that representation is also actually detrimental to its use as a teaching aid. | |||||||||||||||||
▲ | dathinab 4 days ago | parent | next [-] | ||||||||||||||||
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 | |||||||||||||||||
| |||||||||||||||||
▲ | boxed 4 days ago | parent | prev [-] | ||||||||||||||||
> It reminds me of one of the ways of visually laying out elementary particles according to the Standard Model. And now I wonder how much that representation is also actually detrimental to its use as a teaching aid. The Periodic Table does seem like the inspiration. The crucial difference being that the Periodic Table has that shape for a reason. Take the first column of this page for example: u8, i8, bool. Ok, probably 8 bits big so good so far, but then that SAME ROW also has fn(T...) -> U, const T, mut T. Only two of which are related in any way with eachother, let alone the 8 bits column which is 100% not the same thing. Contrast to the Periodic Table where the first row has H and He which both only use the base electron shell. H is to the left because it has (when neutral) 1/2 electrons in it's shell and He to the right because it has 2/2. Then going down from He are all the nobel gases which all have full electron shells. Going down on the right most side of this page has just a bunch of random stuff. Anyway, the reason people try to draw things like the Periodic Table is because it's super good, but the people who do it think it's good marketing, not based on physics/chemistry, missing the entire point. | |||||||||||||||||
|