3 ms·
Where's the language spec? The reference is nice but it's not a formal specification. So much undefined behavior - more than C! /s Edited to reflect sarcasm a
by anonym29 4y ago
Where's the language spec? The reference is nice but it's not a formal specification.
So much undefined behavior - more than C! /s
Edited to reflect sarcasm as rustaceans apparently can't infer it.
- dochtman 4y agoIn my understanding it would be hard to make the case that Rust actually has more undefined behavior than C -- most kinds of undefined behavior in C have been carefully avoided in Rust, although, yes, there is no piece of paper ratified by a bunch of national technology institutes that describes Rust. See also this recent blog post: https://blog.m-ou.se/rust-standard/ https://blog.m-ou.se/rust-standard/
- anonym29 4y agoWhile the rust community might not believe their language needs a specification, some of their would-be customers have business requirements surrounding a specification that cannot be fulfilled with a reference. edit: clarity
- dochtman 4y agoA standard or a specification? Anyway, hopefully Ferrocene will be able to provide those folks what they need. https://ferrous-systems.com/ferrocene/ https://ferrous-systems.com/ferrocene/
- anonym29 4y agoThank you for catching this mistake on my part, fixed.
- deleted 4y ago[deleted]
- pcwalton 4y agoCan you explain what the difference is between a standard and a reference?
- anonym29 4y agoSee edit
- Macha 4y agoOf course you'd expect a formal specification to include details on what the fundamental data types actually are - C11 can't be nailed down on what char is, it defines it as a type large enough to store a member of the implementation-defined basic character set with implementation defined signedness. Which means you could have a valid implementation with anything from a 4-bit unsigned char to a 256 bit or larger signed char
- LegionMammal978 4y ago> Which means you could have a valid implementation with anything from a 4-bit unsigned char to a 256 bit or larger signed char This is not quite accurate; there is no upper limit to the number of bits in a char (except for INTMAX_MAX, perhaps), but it cannot have any fewer than 8 bits, including a possible sign bit.
- caf 4y agoAll the C types have had minimum allowed ranges going back to ANSI C. For 'char', it must at least support the range 0 to 127 (and in addition, it must have the same range as either 'unsigned char' or 'signed char').