HNHacker News
TopNewBestAskShowJobs

wging

2,299 karma · joined February 15, 2011

submissionscomments
wging··on Obvious things C should do
I'm not sure what you are seeing, but perhaps it's just a login wall. I was able to read it; I'm logged in but have never paid for Twitter or X. X does tend to hide certain things (such as replies and replied-to tweets) if you're not logged in.
wging··on Axum 0.8
The key for trait errors is https://docs.rs/axum-macros/latest/axum_macros/attr.debug_ha... -- it's made solving my problems much easier.
wging··on Navtive FlameGraphViewer
> Code is simple, safe, ergonomic and obvious.

Dunno about 'safe' -- or at least not in the more general sense that you seem to intend, rather than the more limited sense of rust's safe/unsafe distinction. If you store an index into a Vec<T> as a usize, rather than a &T, very little is stopping you from invalidating that pseudo-pointer without knowing it. (Or from using it as an index into the wrong vector, etc...)

These problems are manageable and I'm not saying 'never do this' -- I've done it myself on occasion. It's just that there are more pitfalls than you're indicating here, and it is actually a meaningful tradeoff of bug potential for ease-of-use.

wging··on Will that hub or dock slow your SSDs, or even make them faster?
Way more, actually. It likely predates HN by decades.
wging··on Humans are unreliable models of mouse disease
Caffeine doesn't only come in coffee. Caffeine pills and powders make overdoses much easier. For example: https://pmc.ncbi.nlm.nih.gov/articles/PMC8824417/
wging··on How to pack ternary numbers in 8-bit bytes
Another way to write that number is as the log base 2 of 3. The log base 2 of the number of possible states gives you the number of bits of information in a value chosen from that many possible states; here, a trit has 3 possible states.
wging··on Float Self-Tagging
Another cool thing that seems related: exploiting alignment to free up N bits in a 'pointer' representation, because your values have to be aligned. The JVM does this to expand the set of possible addresses representable in 32 bits: https://shipilev.net/jvm/anatomy-quarks/23-compressed-refere...

So, for example, with 3 bits of alignment required, the first valid address for a pointer to point to after 0x0 is 0x8, and after that is 0x10, but you represent those as 0x1 and 0x2 respectively, and use a shift to get back the actual address (0x1 << 3 = 0x8, actual address). I think this is gestured at in section 1.1 of the paper, sort of, except they envision using the space thus freed for tags, rather than additional bits. (Which only makes sense if your address is 32 bits anyway, rather than 64 as in the paper: no one has 67-bit addresses. So saving 3 bits doesn't buy you anything. I think.)

> Aligning all heap-allocated values to 64-bit machine words conveniently frees the low bits of pointers to store a 3-bit tag.

wging··on Oncall shift should be Tuesday to Tuesday
Maybe I'm taking you too literally, but I wouldn't want to have a handoff sync-up (or any meeting, really) on a Friday night, nor push that earlier so significant things can happen between sync-up and the actual shift in responsibility from person to person. Friday-to-Friday does sound good.

One thing I really liked in a previous job was a split daytime-vs-nighttime rotation. It was well worth a little annoyance to set up in our tools. One week you'd be the 'daytime' oncall for business hours (something like 9-5 Mon-Fri, though we might have tweaked those hours a bit; it might have been 10-6 or something). The next you'd be on call for the complementary time (5-9, weekends). You were on call for the same total amount of time, just smeared over two different weeks. It ended up being less of a burden to optimize your schedule for a reasonable response time, but operational work still got done. And in practice awareness of operational issues was not too hard to maintain between the two members of the split.

(I think the best thing, if you can swing it, is probably a follow-the-sun rotation where there are three teams distributed 8 hours apart around the globe, and they trade off 8-hour workday shifts. But a lot of uncommon things probably have to be true of your organization for that idea to even be on the radar.)

wging··on How Google spent 15 years creating a culture of concealment
I don't think that is true. I'm sure they are more concerned about legal consequences than PR, even if both are important.
wging··on A joke in approximating numbers raised to irrational powers
Small but important correction: no polynomial with integer coefficients (equivalently, rational coefficients). p(x) = (x - 3^(sqrt(3))) is a perfectly fine polynomial with real coefficients.
wging··on You Don't Know Jack about Bandwidth
This seems to be a somewhat edited version of https://cacm.acm.org/practice/you-dont-know-jack-about-bandw..., discussed previously here: https://news.ycombinator.com/item?id=41793658
wging··on JVM Anatomy Quarks
Does anyone know why the name of this series was changed from ‘JVM Anatomy Park’?
wging··on Parsing arguments in Rust with no dependencies
I don't think speed of a full compile (including your dependencies) is the right thing to optimize for -- and incremental compiles don't rebuild dependencies. In a project that depends on serde, for example, most compiles in an ordinary dev cycle are probably not recompiling serde. And sccache reduces the incidence of unnecessary rebuilds far further. Even clean builds tend to get through my dependencies quite quickly.
wging··on One Square Minesweeper
In this case, you win by flagging all the mines. That isn't how winmine worked -- you just had to uncover all non-mine spaces.
wging··on Using Euro coins as weights (2004)
The cheapest plates can be higher variance than you might expect. I’ve seen reports of 45s that are 10% light.
wging··on setBigTimeout
In nodejs you at least get a warning along with the problematic behavior:

    Welcome to Node.js v22.7.0.
    Type ".help" for more information.
    > setTimeout(() => console.log('reached'), 3.456e9)
    Timeout { <contents elided> }
    > (node:64799) TimeoutOverflowWarning: 3456000000 does not fit into a 32-bit signed integer.
    Timeout duration was set to 1.
    (Use `node --trace-warnings ...` to show where the warning was created)
    reached
I'm surprised to see that setTimeout returns an object - I assume at one point it was an integer identifying the timer, the same way it is on the web. (I think I remember it being so at one point.)
wging··on Project Euler #912: Where are the Odds?
Sshhh...
wging··on Project Euler #912: Where are the Odds?
That’s mostly right, but some of them don’t require a computer. I’ve never solved one with just pencil and paper, but in some of the solution threads you will actually find pencil and paper solutions. I’m not sure if any of the later problems work like that, though.
wging··on Project Euler #912: Where are the Odds?
If you want a few similar problems, in ascending order of difficulty, try #81 through #83:

https://projecteuler.net/problem=81

https://projecteuler.net/problem=82

https://projecteuler.net/problem=83

wging··on Ask HN: If you were rewriting Emacs from scratch, what would you do differently?
I'd really prefer for emacs' implementation language to have been a lisp-1 rather than a lisp-2. It's annoying to have to do different things to treat a function as a value (put it into a list, assign it to a variable, etc.), as opposed to all other kinds of data. Any benefit you get from allowing name collisions (i.e. function named f, related but distinct variable also named f) seems very small in all elisp code I've seen and promotes confusion more than it enables desirable programming patterns.

I'd make lexical scope the default and dynamic scope opt-in on a per-variable basis. This one is probably less controversial. I think the devs are moving in that direction (e.g. by changing emacs core code to use lexical scope and adding warnings for code that doesn't opt into it), but I don't see how they will actually be able to change the default without breaking a whole bunch of user code.

wging··on Ask HN: If you were rewriting Emacs from scratch, what would you do differently?
For instant startup I recommend daemon mode and emacsclient. Start emacs via emacs --daemon, open windows (in the terminal or otherwise) via `emacsclient` / `emacsclient -nc` (I use aliases for these).
wging··on OpenAI pursues public benefit structure to fend off hostile takeovers
It's better compared to the baseline of a for-profit corporation, especially given the stakes -- but it's strictly worse compared to the intended purpose of the existing structure that was recently hollowed out. The nonprofit entity that was originally supposed to be in control actually won't be.

I'd also question whether there is actually going to be a meaningful check on any of OpenAI's actions, compared to what there would be for a for-profit corporation. I'd bet no.

wging··on Filed: WP Engine Inc. v Automattic Inc. and Matthew Charles Mullenweg [pdf]
That's not what page 35 says at all. Check out page 36:

> 92. Mullenweg’s premise was false, as WPE’s CEO had never interviewed with or negotiated a job offer with Automattic. To the contrary, back in 2022 Automattic had asked if she would be interested in running wordpress.com, but she politely declined.

(edit: I have no idea who is right, but it's just not correct to read page 35 as saying that)

wging··on What I tell people new to on-call
Expectations should be lower as far as responsiveness or even availability, for someone who is not actually on call. The load (and expectation) is also not evenly distributed: IME senior and staff/principal-level engineers (and managers) tend to get paged in when off-call much more frequently, for obvious reasons. It's more likely to be "I need someone who knows XYZ", not "I need absolutely EVERYONE" https://www.youtube.com/watch?v=74BzSTQCl_c or "I need a random additional pair of competent hands".

Also, IME it's been relatively rare for issues outside of business hours to require calling in people who aren't really on call. I think the article is pointing out that it can be the right thing, not that it's necessarily a common scenario. And during business hours, being pulled away from your other work to help handle an incident is obviously a much easier pill to swallow.

wging··on Terence Tao on O1
“Exact wording” would be Ancient Greek. Euclid did not even write in English. You’re checking whether the model matches a specific translation, which is not valuable. If you search around you’ll find many sources that choose a more intelligible phrasing.
wging··on Deploying Rust in existing firmware codebases
In what browser did it fail to work? It works for me in both iOS Safari and desktop Firefox.
wging··on Greppability is an underrated code metric
English inserts an additional ‘p’ in some cases; for precedent consider “stoppable”, “unflappable”, “skippable”.

See https://english.stackexchange.com/questions/30001/why-is-shi...

wging··on Why should anyone boot *you* up?
"Do you want to be alive" is, for most people, not all that complicated a question.
wging··on JavaScript dates are about to be fixed
The ability to convert it to any human-readable time is actually the problem: without additional information you don't know which one to pick, and are forced to make certain assumptions, such as using the user's local time zone or defaulting to UTC. That's the point of the section of the article I quoted above.

For example, given just a timestamp, you don't even know what day it was. Was the user in New York? That 3:50am was actually 11:50pm on March 15th.

wging··on JavaScript dates are about to be fixed
> In other words, the function responsible for transforming a timestamp into a human-readable date is not injective, as each element of the set of timestamps corresponds to more than one element of the "human dates" set.

The author confuses the concept of injectivity and well-definedness. For an injective function f, it has to be true that given distinct a and b, f(a) != f(b). That's not the problem here; rather the problem is that for a timestamp t there's no unique human-readable date x such that f(t) = x. That's well-definedness, not injectivity.

https://en.wikipedia.org/wiki/Well-defined_expression

You could talk about the inverse function, from human-readable dates to timestamps, and correctly point out that that function is not injective, because more than one human-readable date maps to the same timestamp...

← PreviousPage 4 of 25Next →