HNHacker News
TopNewBestAskShowJobs

cwzwarich

3,108 karma · joined February 21, 2007

submissionscomments
cwzwarich··on A one in a million bug in Switch kernel
…
cwzwarich··on The case for a modern language
Unlike other cases of signed overflow, you actually don’t get UB on integer-to-integer conversions. You still have a bug in your code, though.
cwzwarich··on Almost Always Unsigned
The loop optimization you point to can be done for unsigned loop counters even without exploiting undefined behavior. It’s part not why the standard C practice was to use unsigned loop counters.
cwzwarich··on High blood pressure cases double in 30 years
> Eating too little salt is as dangerous as eating too much salt. The usual recommendation is to eat about 4 to 5 grams of salt per day.

Who recommends 4g of salt as a minimum?

cwzwarich··on Are there flaws in some ARM64 instructions?
For finite inputs, the results are unambiguously specified by the IEEE spec. For singularities involving zero/infinite inputs, the IEEE spec allows two sets of behavior, which basically correspond to x86 and everyone else.
cwzwarich··on How many real numbers exist? New proof moves closer to an answer
In a forcing-based consistency proof of a proposition P, you start with a model of ZFC (or a sufficiently large subset of ZFC, depending on the exact formalism being used), approximate a witness to P (e.g. a bijection between a set of reals and aleph_2) within the starting model, and then apply the forcing machinery to construct a new model of ZFC where P holds. Unlike the diagonalization argument, it's inherently metamathematical.
cwzwarich··on Impact of Undefined Behavior on Performance
> If you have defined wrapping/saturating semantics then you don't get this option, even if overflow is a bug in your program.

Well, unsigned overflow is also a potential bug, and it's defined behavior. So if you want useful integer overflow diagnostics, you already need to break the C/C++ spec.

Of course, the correct way to model this in a programming language is to distinguish between bitvectors with defined twos-complement operations and fixed-range integers.

cwzwarich··on CompilerJobs – A listing of compiler, language and runtime teams
Probably more the latter, but that requires some amount of the former. You’ll usually either be working on a custom LLVM backend or working on integrating LLVM into some compiler other than Clang.
cwzwarich··on Yes, experts will lie to you sometimes
Another example (from https://www.nytimes.com/2020/12/24/health/herd-immunity-covi...) not quoted in the article:

> “When polls said only about half of all Americans would take a vaccine, I was saying herd immunity would take 70 to 75 percent,” Dr. Fauci said. “Then, when newer surveys said 60 percent or more would take it, I thought, ‘I can nudge this up a bit,’ so I went to 80, 85.”

cwzwarich··on Cranelift, Part 3: Correctness in Register Allocation
This is probably more along the lines of what you were thinking about for the approach based on SSA form:

https://hal-lara.archives-ouvertes.fr/hal-02102286/file/RR20...

cwzwarich··on Is a long-dismissed forgery the oldest known Biblical manuscript?
Even in rabbinic Hebrew, the name for this script is כתב עברי (Hebrew writing), and the name for the script used today is כתב אשורית (Assyrian writing).
cwzwarich··on The Kotlin Foundation
This isn't actually true. KHTML is LGPL 2.0, so you can release source code for the pieces you modified and binary blobs for the rest. WebKit proper (as opposed to WebCore, which was based on KHTML, and JavaScriptCore, which was based on KJS) was originally not open source.
cwzwarich··on Why mmap is faster than system calls (2019)
Wouldn't REP MOVSB be as fast as an AVX memcpy for 4 KB sizes on recent Intel CPUs?
cwzwarich··on The Complete Idiot’s Guide to the Independence of the Continuum Hypothesis
I don’t really think this is true. See this historical article:

http://math.bu.edu/people/aki/14.pdf

He was drawn to logic by discussions with Feferman and worked unsuccessfully on other problems in logic before moving to independence questions in set theory.

cwzwarich··on Email to Former Board Member
Releasing this as-is seems like a bad idea. He's likely addressing a former board member by name, as well as their firm. Couldn't you just look at all of the names of board members and their firms, compute the metrics of those names with the typeface being used, and then figure out exactly who he's talking about?
cwzwarich··on Challenging LR Parsing
I was only commenting on his claims about the academic literature on parsing, not whether he should use the techniques verbatim.

The problem with structured approaches to incremental parsing is that you rarely want incremental parsing alone. You’re going to want to do something else with the resulting parse tree (name resolution, type checking, compilation, etc.) and no structured approach to incremental parsing will help you there. Once you’re stuck writing an incremental type checker by hand, you probably have the right framework for also writing an incremental parser.

Rust has additional complications, e.g. the macro system and the fact that the language is defined by a single implementation.

cwzwarich··on Challenging LR Parsing
> There’s a lot of literature about error recovery for LR parsers, how come academics haven’t figured this out already? I have a bold claim to make: error-recovery research in academia is focusing on a problem irrelevant for IDEs. Specifically, the research is focused on finding “minimal cost repair sequence”

The parsing literature can be a bit difficult to navigate because the field is effectively dead for research purposes. However, other models of errors have been considered. Tim Wagner's PhD thesis is the best discussion of the application of LR parsing techniques in IDEs, and this paper extracted from it discusses error recovery in particular:

http://harmonia.cs.berkeley.edu/papers/twagner-er.pdf

In the non-interactive context, Richter's work on error recovery by substring parsing is also very interesting, in that it doesn't cause spurious errors when attempting to recover from errors, and it only depends on the language and not the grammar or parsing technique used:

https://dl.acm.org/doi/10.1145/3916.4019

For LR grammars (and many other grammars), the necessary substring parsing can be done in linear time using variations of the GLR algorithm.

cwzwarich··on Portland adopts landmark facial recognition ordinances
Doesn’t Facebook have a Portland office?
cwzwarich··on The History, Status, and Future of FPGAs
Pretty much every new non-x86 CPU doesn't have updatable microcode, so that's a very x86-centric problem.
cwzwarich··on Fixing Mass Effect black blobs on modern AMD CPUs
Approximations implemented in HW generally use different techniques than ones in SW. They typically start with a lookup table, possibly followed by some other steps. Someone reverse-engineered the old AMD 3DNow implementations here:

https://pdf.sciencedirectassets.com/272990/1-s2.0-S157106610...

cwzwarich··on Fixing Mass Effect black blobs on modern AMD CPUs
Matrix inversion requires taking the reciprocal of a determinant. I don't have the D3D binary to disassemble it, but chances are that they used the RCPSS/RCPPS instructions to get an approximate reciprocal. The precision of the approximation is specified. Both Intel and AMD satisfy the specification, but with different results.
cwzwarich··on Don't Panic! Better, Fewer, Syntax Errors for LR Parsers
An even bigger flaw with most academic research into parser error recovery is that the vast majority of syntax errors occur from modifying a valid program to produce an invalid program, but the recovery algorithms are oblivious to this.
cwzwarich··on Initially dismissed, representation theory is now central to much of mathematics
I'm not so sure about the historical accuracy of the claim that representation theory was initially dismissed. They quote Burnside being skeptical of representation theory in 1897 in the introduction of his book Theory of Groups of Finite Order, but soon after he this he reformulated Frobenius' work on characters in a group/representation-theoretic framework. Burnside used representation-theoretic methods to prove his eponymous theorem in 1904, and representation theory appears in the second 1911 edition of this book.

A lot of people don't realize that the concepts of abstract groups, vector spaces, linear transformations, etc. were not particularly obvious to people, and a lot of results were developed in specific contexts that were later realized to be more general. After the development of abstract algebra, these subjects morphed into something much closer to the standard algebra curriculum we see today.

cwzwarich··on Amazon added a non-compete after the employee entered the U.S. on an L1B visa
> I've also heard of contracts that essentially prohibit side projects or moonlighting.

If your employer is sufficiently broad, the California Labor Code basically prohibits side projects or moonlighting:

https://leginfo.legislature.ca.gov/faces/codes_displaySectio...

cwzwarich··on Why Skylake CPUs Are Sometimes 50% Slower (2018)
TLDR: PAUSE instruction pauses longer.
cwzwarich··on Faster than radix sort: Kirkpatrick-Reisch sorting
> Faster

Benchmarks?

cwzwarich··on The radix 2^51 trick (2017)
He’s testing on Haswell, where (at least according to Agner Fog) ADC has an extra uop compared to ADD. On Broadwell and later, non-memory ADC is a single uop with a single cycle of latency. He would probably see a big speedup on a newer CPU.
cwzwarich··on San Francisco real estate going to collapse: Angel investor Calacanis
You can usually find a way to make it work with any pair of timezones (e.g. North America and Europe, North America and Asia), but when you throw in a third distant timezone it becomes a huge pain.

At Mozilla, we had people working on the same project in North America, Western Europe, and Australasia. The meetings alternated between inconveniencing Europe / Australasia, but the additional latency of having all 3 timezones involved in decisions really slowed things down.

cwzwarich··on Make LLVM Fast Again
A lot of large C++ projects use link-time optimization, since it's the easiest way to get predictably good performance.
cwzwarich··on Make LLVM Fast Again
Besides GCC, Clang, and MSVC++, most other C++ compilers license the EDG frontend, so there's less heterogeneity than you would expect. I don't actually know if there's another implementation of C++11 besides the ones I listed. Even Microsoft now uses the EDG frontend for Intellisense, rather than their own (more incorrect) frontend.
← PreviousPage 5 of 21Next →