Recent submissions

Comment · 2 years ago
I wouldn't really buy this in the first place for $20, maybe on sale, but in addition you can get it for free on mobile if you have a netflix subscription, so I'd have to imagine that many people do what I did and played it for a bit on their phone, so now I doubt I'll ever pay for it.
Comment · 2 years ago
Even Javascript has a similar syntax, though `yield` / `await` only works for certain "monads" (promises seem close enough)
Comment · 2 years ago
Well, why would it be taken as a given that programming should mimic the hardware?

Pure functions are easier to reason about (there may be exceptions of course), that's why they're interesting.

This paper is not related to side-effects - it's related to "totality", meaning all programs terminate. This could also be interesting for side-effecting programs, but it's of course much harder to verify in this case.

Due to the halting problem's existance a total language can not be Turing complete, but many useful programs can be verified.

I didn't see anything in the paper that claims that pure functions should be "all the way down", and the paper is not about side effects anyway.

Comment · 2 years ago
The idea that anyone who's opposed to narrow government regulations is somehow brainwashed by the Kochs is just an unsufferably smug attitude towards people you disagree with. It's like the "funded by George Soros therefore bad" you sometimes see on the right.

I'm sure they've spent money on promoting this, but there's many reasons you'd come to this conclusion other than having it "manufactured" for you by billionaire conspiracies.

You have to start by considering that your political opponents are capable of thinking for themselves if you want to ever do more than just preach to the choir. Declaring them idiots in the guise of "providing historical context" isn't helpful.

Comment · 2 years ago
If you check out the linked paper you'll see the title is "One-shot Algebraic Effects as Coroutines" - the keyword being "one-shot".

In general every Monad can be expressed "interpreting" the free monad. This relaxes the "one-shot" restriction, and can be implemented using delimited control. One-shot means faster performance though and is still useful for many things - and that can be implemented using coroutines.

If you acquire some understanding of what this means then you'll have a very good idea about the expressive power of what you can use coroutines (with nothing more) for, so it's very interesting.

Comment · 3 years ago
Comment · 3 years ago
You don't have to memorize that log(5) = 0.7 if you know log(2) = 0.3 since log(5) = log(10 / 2) = log(10) - log(2) = 1 - 0.3 = 0.7.

Also log(8) = 0.9 because log(2^3) = 3log(2) = 0.3 3 = 0.9

Comment · 4 years ago
What, the anal beads is not a sensible theory? /s
Comment · 4 years ago
This is a really intuitive way of thinking about it. The best way I could work this out was to start with the special case of pure scaling in a single direction.

For instance when scaling by "a" in the x direction

M = (a 0; 0 1)

It's pretty easy to see by graphing an example that in order for the normal to work out correctly you must scale it by the inverse scale factor (1 / a), so the correct choice of M is the inverse, M⁻¹, i.e. M = ((1 /a) 0; 0 1).

This of course generalises to scaling in multiple directions (just multiply the matrices) - i.e. to diagonal matrices. For

M = (a 0; 0 b)

the correct choice for transforming the normals is

M = ((1/a) 0; 0 (1/b));

By applying singular value decomposition you get

M = UDV

So choosing M' = M⁻¹ᵀ you'll get M' = (UDV)⁻¹ᵀ = UD⁻¹V

Since orthogonal matrices U, V will actually correctly transform the normals (they're rotations or reflections) you can intuitively understand that M' will work for transforming the normals.

Question is - where does the transpose part actually come from? It's a of a bit "magic" choice. This article makes it very clear that this "arises from" the transpose in the dot product, (t⋅n = tᵀn), as the dot product defines orthogonality!

Comment · 4 years ago
I'd imagine you can use a keyboard shortcut as well to open this menu, but based on the text cursor, rather than the mouse one.

I do this a lot is vscode to auto-fix issues and automatically add imports for the identifier under the caret. It's however frustrating in that it sometimes uses the underlying platform's dropdown widget, which doesn't respect my key bindings (Emacs-like, using C-p, C-n for up, down etc).

Comment · 5 years ago
if (!memory[s1.id]) { memory[s1.id] = 'harvest' }

ought to do it.

Comment · 6 years ago
Yeah, the main coherent point I take out of this is that it makes sense to provide capabilities rather than to check them, i.e. if you have access to a certain API then you're by construction allowed to use it. It seems this is something the author has been working on.

This is then somehow shoehorned into "Parse / Don't typecheck" but it doesn't make much sense honestly.

Comment · 6 years ago
Not having it funded by the tax payer is not the same as outlawing it.

This all comes down to whether critical race theory is truly an unacceptable set of ideas, like e.g frenology, or not, that should be legitimately banned.

Should be easy to make an honest defense of that point if this is indeed the case?

Comment · 6 years ago
It’s hardly authoritarian to disallow certain ideas being funded by the tax payer. We wouldn’t be upset if frenology wasn’t allowed in government agencies.

I think the idea behind the ban is that critical race theory delivers a certain leftist ideology veiled in an intent to address race or gender issues.

Agree with this or not, but this seems where to discussion should take place.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton