Hacker Newsnew | past | comments | ask | show | jobs | submit | mohinder's commentslogin

> This would neither pass a review, nor static analysis

I beg to differ. Humans are fallible. Static analysis of C++ cannot catch all cases and humans will often accept a change that passes the analyses.


> Static analysis of C++ cannot catch all cases

You're ignoring how static analysis can be made to err on the side of safety rather than promiscuity.

Specifically, for optional dereferencing, static analysis can be made to disallow it unless it can prove the optional has a value.


You don't need all the permutations. If there are 32 bytes in a cache line then each instruction can only start at one of 32 possible positions. Then if you want to decode N instructions per cycle you need N 32-to-1 muxes. You can reduce the number of inputs to the later muxes since instructions can't be zero size.


It was even simpler until very recently where the decode stage would only look at a max 16 byte floating window.


The chopping up can happen the next cycle, in parallel across all the instructions in the cache line(s) that were fetched, and it can be pipelined so there's no loss in throughput. Since x86 instructions can be as small as one byte, in principle the throughput-per-cache-line can be higher on x86 than on RISC-V (e.g. a single 32-byte x86 cache line could have up to 32 instructions where the original RISC-V ISA might only have 8). And in any case, there are RISC-V extensions that allow variable-length instructions now, so they have to deal with the problem too.


As for program size, I played with small algorithms (like binary search) on godbolt, and my x86 programs had similar size to RISC-V with compressed instructions. I rarely saw 1-byte instructions, there almost always was at least one prefix.

> e.g. a single 32-byte x86 cache line could have up to 32 instructions where the original RISC-V ISA might only have 8

With compressed instructions the theoretical maximum is 16.

> so they have to deal with the problem too.

Luckily you can determine the length from first bits of an instruction, and you can have either 2 bytes left from previous line, or 0.


> The chopping up can happen the next cycle

It still causes issues.

> Since x86 instructions can be as small as one byte, in principle the throughput-per-cache-line can be higher on x86 than on RISC-V (e.g. a single 32-byte x86 cache line could have up to 32 instructions where the original RISC-V ISA might only have 8).

RISC-V has better code density. The handful of one byte instructions don't make up for other longer instructions.

> And in any case, there are RISC-V extensions that allow variable-length instructions now, so they have to deal with the problem too.

Now? Have to deal with the problem too?

It feels like you didn't read my previous post. I was explaining how it's much much simpler to decode length. And the variable length has been there since the original version.


I'm not arguing that it's logical, but I do think it's natural for humans to want to do the thing that pleases them now even if it costs them some unknown number of years of life in the unforeseeable future.


No, you misunderstand. I'm arguing it is logical for them to do that. You just have to stop looking at them as though they actually hold "maximize number of seconds alive" as their first, second or even third most important thing in life.


I agree with you when it comes to life in general. However, I think most people regard time spent working as fixed and already having been spent, and so maximizing the value of your attention is what is important.

I read the article assuming they were talking about work, not life in general.


> Hate crimes only serve to give a specific group protected status

That's not true. There is no specific group of people that is protected. A racially motivated crime only requires that race be part of the motive, not that the victim be a member of a particular race.


It seems like the C++ language devs are always trying to rein in horses that have already left the barn.


Yes. Here though the ostensible topic is constexpr allocation, the real topic is adding deep const.


It seems like C++ would be simpler if were either just all immutable (like Haskell) or embraced using the full, mutable language for metaprogramming (Jonathan Blow's Jai). Of course that's a horse that left the barn before most of the current barn was even built.


I suppose one could opt-into default-immutable and make it Rust-like. That'd be nice.


> DAs have stopped fully prosecuting criminals -- including those who commit violent gun crimes

Just wondering if you have any evidence to back up this assertion.


[flagged]


> gaslighting

Please.

Just link a study or something. FWIW I think it's wild I'm being accused of gaslighting over a simple request. Isn't that DARVO?


I think the issue is that it's such an easy web-search, your failure to do it and instead make a "simple request" appears to present an implication that the phenomenon in question doesn't exist, i.e. gaslighting.

The assertion for which you asked evidence is not a correlation between prosecutorial policy ("fully prosecuting criminals") and crime rates, but rather the existence of the policies themselves. So, there's no need for a "study": the prosecutors put it down in writing (and those policies then get reported by the media).

For the record, I support some of these prosecutorial reform efforts, but through legislation which eliminates things like "add-on charges", not by prosecutors selectively deciding who will and won't get them.

But, since you asked, here's just a few -- and I'll make the "simple request" to you to do the "hard work" of a web-search if you want more than these: try Chesa Boudin, Larry Krasner, etc.

Manhattan DA Alvin Bragg announces he is directing his staff either not to prosecute, accept "community diversion" in lieu of prosecution, or at least not to seek any jail time, for a slew of offenses, including e.g. armed robbery:

https://www.manhattanda.org/wp-content/uploads/2022/01/Day-O...

Media coverage of same:

https://www.cnn.com/2022/01/06/us/alvin-bragg-manhattan-dist...

https://nypost.com/2022/01/04/manhattan-da-alvin-bragg-to-st...

LA district attorney George Gascón, upon being elected, issued a memo modifying the policy to reduce the charging of violent criminals:

https://da.lacounty.gov/sites/default/files/pdf/SPECIAL-DIRE...

Media coverage of same:

https://www.foxnews.com/politics/crimes-las-prosecute

And while anecdotal, here's evidence of the implementation of that policy, a letter from Union Pacific railroad to the DA's office, complaining that when their agents apprehend criminals robbing trains, they are not fully prosecuted:

https://www.up.com/cs/groups/public/@uprr/@newsinfo/document...

HN thread on same:

https://news.ycombinator.com/item?id=29985568


I appreciate you taking the time to do this, explain that the existence of these policies itself is not in doubt, and clarify the difference between asking for proof of their existence versus proof of their effects on society. Because I had started to respond, but I decided it was bad for my mental state to engage further.

It sounds like you and I are actually quite close in belief that systemic reforms are necessary but that undertaking them by prosecutorial fiat is a mistake. You'd probably appreciate this analysis:

https://harvardlawreview.org/print/vol-132/the-paradox-of-pr...


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: