Recent submissions

Comment · 3 years ago
Can someone shed light on these two steps in the approximation?

  *         since cos(x+y) ~ cos(x) - sin(x)*y
  *                        ~ cos(x) - x*y,
For the first, maybe it's an approximate identity I'd never heard of?

For the second, it seems like it relies on X being small, but in this code... Y might be small enough for sin==identity approximation, but X isn't, is it?

Comment · 3 years ago
SongTable won’t compile (on any modern compiler) because the number of initializers (36) doesn’t match the declaration (32)
Comment · 4 years ago
In addition to the sibling comments, one simple opportunity available to a JIT and not AOT is 100% confidence about the target hardware and its capabilities.

For example AOT compilation often has to account for the possibility that the target machine might not have certain instructions - like SSE/AVX vector ops, and emit both SSE and non-SSE versions of a codepath with, say, a branch to pick the appropriate one dynamically.

Whereas a JIT knows what hardware it's running on - it doesn't have to worry about any other CPUs.

Comment · 4 years ago
Thanks, those are specific requirements I could definitely see WASM struggling to meet.

In my experience in a large+mature enough codebase (particularly one that is already multi-platform, like Postgres appears to be) many of those requirements are wrapped in an abstraction layer to allow targeting new platforms, but some requirements (like memory mapping) could definitely be dealbreakers if the target platform doesn't naturally support them.

This solution still seems awfully complex (and probably not very efficient) but I certainly see why it's probably the "easiest" option.

Comment · 4 years ago
The first thing to point out is that our implementation isn't pure WASM. We attempted to compile Postgres for WASM directly from source, but it was more complicated that we anticipated.

Crunchy's HN post provided some hints about the approach they took, which was to virtualize a machine in the browser. We pursued this strategy too, settling on v86 which emulates an x86-compatible CPU and hardware in the browser.

I’m out-of-domain but very curious about this part - it seems like a pretty extreme solution with a lot of possible downsides. Does this mean the “just compile native code to WASM” goal is still far off?

Comment · 4 years ago
Comment · 4 years ago
So if I make a new, identical copy of a GPL'ed codebase - should I feel free to use it for whatever purpose I want and ignore the GPL?
Comment · 4 years ago
The full game isn't playable on that page. I believe all three sets of assets (HLDM, Uplink, Hazard Course) are from demos or free products.

Making the full game playable would probably be less OK.

Comment · 4 years ago
Comment · 4 years ago
I think GP is reacting to the word "obligation" (I certainly did.)

I'd claim there are actions that may be "morally justifiable" yet not raise to a level that creates a "moral obligation." The word "obligation" implies (to me at least) some sort of guilt or culpability if you don't undertake the action.

In fact my instinct is that most morally justifiable actions aren't weighty enough to be obligations. Consider any "morally neutral" action (for example, eating an apple instead of an orange for a snack) - I would label such an action "morally justifiable" (since applying the rules of morality does not argue against it) but it's certainly not a "moral obligation" (even ignoring the fact that the alternative is also morally justifiable!)

You could perhaps argue there is no such thing as a "truly neutral" action to an omniscient observer, who can measure and predict the impact on total human happiness of any action with certainty. Such an individual would indeed have a much more restrictive set of "morally justifiable" actions available to them - fortunately we mortals aren't burdened with that level of insight or certainty!

Comment · 4 years ago
Not GP, but the code in the article passes 'unsigned int mutex' by-value, and then operates on its address (which will potentially be at a different stack address on each invocation, and will certainly be different for different threads.) It won't serve its purpose at all.

To my eye, the code is fundamentally broken in a way that's surprising for an article trying to teach threading, and it's likely confuse someone unfamiliar with these concepts.

Comment · 4 years ago
Comment · 4 years ago
It seems like the brownout should be publicized on the front page of github.com - or at least githubstatus.com ?

(Although I'm not an active git/github user, so maybe there's an even more more obvious place a naive user having issues would go to figure out what their problem is. Hopefully there's a helpful commandline error explaining the situation.)

Comment · 4 years ago
> Education is insanely overfunded

Can you cite a source for that claim? Genuinely curious, because I don't know if I've ever heard someone suggest it. (Conversely, the idea that education is substantially underfunded is generally assumed - at least in my bubble.)

Comment · 5 years ago

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton