36,256 karma · joined November 17, 2014
> I wonder if languages like RUST or GO will ever become ISO standards..
I doubt it, but mostly because everyone I know on the ISO standardization committees have expressed frustration with ISO (the organization) in ways that I haven't seen for other standards bodies like Ecma.
> The result of E1 << E2 is E1 left-shifted E2 bit positions; vacated bits are filled with zeros. If E1 has an unsigned type, the value of the result is E1 multiplied by the quantity, 2 raised to the power E2, reduced modulo ULONG_MAX+l if E1 has type unsigned long, UINT_MAX+1 otherwise. (The constants ULONG_MAX and UINT_MAX are defined in the header <limits.h>.)
You notice what's not mentioned there? What happens if E1 is signed. The standard says nothing. And when the standard says nothing, it's undefined behavior.
> Wait. An implementation-defined behaviour isn't allowed to be trap/termination of execution? Okay, make it unspecified then, with the options of trapping or calculating some unspecified (not indeterminate) integer value.
Unspecified behavior also isn't allowed to be a trap. The difference between unspecified and implementation-defined is whether or not the compiler has to document its choice; the difference between unspecified and undefined is whether or not the choice is limited.
And one of those kinds of "blast radius" is traps, and I suspect the original motivation for making signed integer overflow undefined behavior was precisely to preserve the ability to trap on signed integer overflow, which couldn't be implementation-defined. But the records of the discussions leading up to C89 and C99 are just too fragmentary for me to be certain.
This kind of attitude tends to make me suspect that you are disinclined to actually listen to my feedback.
That's exactly what it means, see the change mentioned in https://www.open-std.org/jtc1/sc22/wg14/www/docs/n723.htm. (Previously, in C89, left shift on signed integers was completely undefined, only unsigned integers had a defined left-shift operation.) My guess is that it has to do with signed-magnitude representation causing left shifts to be absolute garbage with negative numbers. You also have to remember that the standard having undefined behavior doesn't preclude implementations from defining that behavior, and this is especially true with the freewheeling nature of a lot of the original undefined behavior introduced in C89 and C99.
> Also, C23 (and C2y) is moving ever closer to actually having defined semantics.
Eh, having seen how some of the sausage gets made, there's definitely been some cases where the overeager urge to rip out undefined behavior from the standard has worsened the quality.
* thread_local and _Atomic support from C11
* fopen("foo", "x") from C11
* aligned_alloc from C11
* CMPLX macro from C11
* C++ attribute syntax ([[foo]] flows better to me than __attribute__((foo)) does)
* C23 finally gets rid of _Who _The _Hell _Thinks _Users _Like _This-style _Keywords.
* Multi-level break/continue in C2y
* Variable declarations in if conditions.
* Some of the new operations like ckd_add or stdc_rotate_left. I do dislike the names, but meh, at least C is starting to gain a competent set of fundamental operations.
And, FWIW, in a lot of high-performance code, the overhead of a function call may be too high for an atomic operation.
1. The Rust Foundation is a legal entity that owns things like the webhosting for servers and stuff that. Are you going to claim that, e.g., the C++ Foundation makes C++ the purview of nefarious evil corporations simply because all of the C++ members are companies?
2. I've never really seen the "social momentum" the author talks about. And even though I work in the kind of environment where you'd think people would be eager Rust converts... I'm pretty much the only person at work who tries to do anything in Rust.
3. "Rewrite-it-in-Rust" memers are viewed negatively by everyone I know, including the actual Rust developers.
4. There's nothing inherent about GPL versus MIT versus Apache or whatnot for Rust libraries. I think the trend in open source over the past decade or so has been to move away from GPL anyways, and that so many Rust packages are non-GPL is simply because Rust code is mostly newer than the heyday of GPL.
5. No, it's not "completely possible" that Rust's compiler contains a backdoor. If you want to, you can bootstrap the compiler from the ocaml-based compiler (which involves way too many steps). I think the mrustc compiler is also capable of building the current rustc. It's pure FUD.
The specific problem of the 2008 financial crisis was that the banks were going out of their way to obfuscate the source of their CDOs so that, even when it was clear in 2007 that the subprime mortgage market was unraveling, you couldn't look at your instruments and figure out whether or not you were affected. The problem wasn't the CDO, it was the obfuscation. And as far as I'm aware, the current debt offerings aren't being obfuscated--if you want to avoid the data center debt because you think it's junk, just avoid the stuff being touted as data center debt.
That's the kind of person I expect who speeds in a school zone.
(Note that it's not just the compiler that plays the game--a memory allocator might choose to use MADV_FREE for freed pages of memory, which means that at any point until its next write, the OS may replace the contents of the page with a zero page. So if a subsequent call to malloc reuses a MADV_FREE'd page, then reads of that data before anything it has been written to it may suddenly switch to a different value depending on the whims of the kernel.)
Dead code elimination is like the single most profitable optimization in the compiler, especially in conjunction with inlining and constant propagation that makes several branches become trivially dead. And its removal is very much expected by programmers, because (for example) bounds checking tends to work by generating bounds checks for every possible array access and relying on the compiler to be able to prove most of those bounds checks redundant.
No, my suspicion is you're actually only against certain kinds of dead code removal, but the kinds you're against are so inconsistent that it's impossible to implement a decision program except by including a routine to read the programmer's mind.
That's not true. There is a difference between normative text and informative text. Informative text is not authoritative, and you were citing an appendix that is labeled as informative.
> I am hoping the up and coming C2y spec has very clearly defined behavior when using unintialized memory (ideally where it will work but the bytes can have any values).
It won't. Uninitialized memory can't have "very clearly defined behavior" without breaking essentially every single implementation, and WG14 is very loth to break existing implementations.
I'd say it's the growth of private markets to allow companies to keep getting funding even at the $100 billion range while staying private that has fueled the trend to stay private rather than SOX and other new regulations for public corporate governance dissuading them from going public.
Actually, of all of the characters involved, she was the only chemist. Watson was a biologist, Crick was a physicist, as was Wilkins. That's why Franklin was ultimately brought in: to make further progress, they needed a chemist with crystallography experience, and Franklin was the one who had that experience.
That's a common tale of American mythos, but it's not really an accurate portrayal of American history. Hyper-local governance only really existed in New England and never spread outside of it. Most governance centered on states which are--let's be frank--small countries: the median state in population and area is around 40th percentile among world countries, so smaller than average, but not by that much. And if you look throughout the history of states' rights in US history, invariably those advocating for states' rights are bleeding hypocrites. Note that, e.g., when the southern states established the Confederate States of America, they expressly forbid their own states from having the rights they were claiming for themselves in the antebellum period.
Indeed, in many cases, the more localized governance really turns out to just be people who have lost the political debate at the national level, and thus unable to impose their views on everybody, settling for imposing them at the state level and eagerly oppressing those within the jurisdictions where they can win from exercising their differing views.
The Chinese political system is just as short-term-oriented as <insert democracy here> on the whole, and I don't think there has ever been a politician in history who ever thought about workable century-long impacts.
I suspect many commenters here work in companies that expect their profit margins to be 10× that.