HNHacker News
TopNewBestAskShowJobs

kd0amg

1,587 karma · joined December 1, 2009

Interested in language design/implementation, architecture, security, and graph theory

Reachable at jrslepak@gmail.com

submissionscomments
kd0amg··on Algebra Driven Design
> objects and classes are a fundamental concepts people are familiar with from real-life experiences.

The idea that actions one can perform on real-world items are actually embedded in those items themselves (as opposed to being imposed on them from the external world) is neither universally accepted ontology nor required understanding for day-to-day interaction with them.

kd0amg··on How close are computers to automating mathematical reasoning?
Just knowing something is true without knowing why is a lot less helpful in figuring out what else is true.
kd0amg··on How close are computers to automating mathematical reasoning?
Unsound with respect to what?
kd0amg··on How close are computers to automating mathematical reasoning?
> There is no Turing Machine capable of proving that this program won't halt

Yes, there is. There's a machine which does nothing but print that exact proof.

You seem to have conflated solving an instance of a problem with solving the entire problem. Turing's theorem states that no one Turing machine will get the answer right for every instance of the halting problem, but for any instance that one specific machine gets wrong, there's another machine that also gets that instance right (in addition to everything else the original machine gets right).

kd0amg··on How close are computers to automating mathematical reasoning?
The idea that humans are physical systems with Turing-computable behavior would mean that any problem not solvable by Turing machines is also not solvable by humans. That is, there are programs whose halting behavior no human will ever determine, theorems of Peano arithmetic whose proof no human will ever find, etc., no matter how much humans work at it.
kd0amg··on A look at the J language: the fine line between genius and insanity (2012)
It would be a lot like that. There's a mindset shift to thinking of arrays as geometric objects to manipulate in space instead of as boundaries on valid indices. One of my favorite examples is computing a moving average over some vector of input data. Instead of thinking about looping over each sub-range to find its average, and having that nested inside a loop over possible sub-ranges, you can build a 2D array whose rows are time-shifted versions of the original 1D array. Sum that column-wise and divide by the number of rows to get your answer.

Understanding how you can build that iteration space as reified data gives you a lot more expressive power than you get from remembering that `|.` means "rotate." It's easy to look up which symbol corresponds to a chosen operation (and you'll memorize the ones you use a lot anyhow).

kd0amg··on Scientists rename human genes to stop MS Excel from misreading them as dates
The usual reason programmers object to ugly, hacky code is that it's a lot harder to be justifiably confident that such code actually does produce the right answer -- "garbage in, garbage out" is just as true in function position as it is in argument position.
kd0amg··on Unlearn rotation matrices as rotations
How to compute a matrix product, how to compute the solution to a system of equations, how to compute a determinant (inefficiently), how to compute eigenvalues

Lots of how, not enough why

kd0amg··on The undeserved status of the pigeon-hole principle (1991)
Yes, talking about averages sounds like it might lead a prover astray into reasoning about the average size of compressed data. The average that matters here though is how many inputs map to the same output.

Compressing (n+1)-bit input to n-bit output makes the average output correspond to 2^(n+1)/2^n = 2 inputs. By Dijkstra's rephrasing of the pigeonhole principle, the maximum number of inputs colliding on the same output must be at least 2.

Or we could make it more robust and say we're compressing to n-bit-or-smaller output. Then the average output corresponds to 2^(n+1)/(2^(n+1)-1) inputs. That average is still strictly greater than 1, so the maximum number of inputs colliding on the same output must also be strictly greater than 1 (at least 2, since that's the smallest natural which is greater than 1).

kd0amg··on Is Dark Mode Such a Good Idea?
Many people perceive light mode as the cause of eye strain. But blue light, among other things, is actually the cause of it most of the time.

That seems like an explanation of why to prefer dark mode over light mode when those are the choices available. Or are app/web developers making dark mode versions that actually use bright blue light?

kd0amg··on As Qualified Immunity Takes Center Stage, More Delay from SCOTUS
If Congress has the power to make something literally part of the Constitution then they literally have the power to shape the boundaries of constitutional law because they literally have the power to rewrite the Constitution.

Ex falso quodlibet. Congressional action is not sufficient to alter the Constitution.

kd0amg··on As Qualified Immunity Takes Center Stage, More Delay from SCOTUS
The question before the court was a point of law, not a disagreement about vote totals.
kd0amg··on The Liskov Substitution Principle (2019)
Liskov's explanation at a talk she gave a couple years ago was that it just looked like the obvious way one ought to use subtyping and certainly not a deep enough insight to be worth naming.
kd0amg··on Bosque Programming Language
>> This compiles recursive functions into a CPS form that uses constant stack space, eliminating any possible Out-of-Stack issues

> So recursion cannot depend on input from the outside world?

Why would CPS prevent recursive code from doing I/O or using its results?

kd0amg··on Improve your walking technique
If it's causing serious problems, talk to a real doctor, not armchair doctors on HN (or reddit).
kd0amg··on Is APL Dead? Not anymore
Numpy has a very rough approximation of APL's semantics. The broadcasting rules are quite different, and it's missing some rather fundamental things like automatically lifting functions with argument rank other than 0.
kd0amg··on We’re Testing the Wrong People
I'm pretty sure GP means actual quarantine. We are not quarantining hundreds of millions. We are advising hundreds of millions to practice social distancing.
kd0amg··on Ode to J
The source code to his data parallel compiler hosted on the GPU is 17 lines of APL!

The co-dfns source I've seen[1] is much longer. Do you know if there's a write-up somewhere of the differences between that and Appendix B from the dissertation?

1: https://github.com/Co-dfns/Co-dfns

kd0amg··on First trans-Atlantic contact made on 432 MHz
The amateur radio service has its own designated format for call signs: one or two letters, a single digit, then one to three letters. These days, the FCC normally issues a new licensee a "two by three" call sign (two-letter prefix, three-letter suffix), but depending on your license class, you can qualify for a shorter one. The Advanced and Amateur Extra license classes are allowed to have 1x2 or 2x1 call signs. According to the ARRL[1], there are currently 38093 Advanced licensees and 150793 Extra licensees (Advanced is no longer issued, but there are still quite a few Advanced who never upgraded to Extra).

Of course, a call sign can only be held by one licensee at a time, and most (or all) of the 1x2 and 2x1 are assigned (I'm not sure on the current state of things with 1x3 and 2x2). So one only becomes available when the previous holder loses it (by license expiration or death). There are far more Advanced/Extra licensees than short call signs.

There are also 1x1 call signs, but they are only issued on a temporary basis to special event stations (e.g., I have operated W8C, with a club whose normal call sign is W8YY).

1: http://www.arrl.org/fcc-license-counts

kd0amg··on Mysterious heart damage, not just lung troubles, befalling Covid-19 patients
That danger is contingent on credulous readers being in position to act on the misinformation. When people here speculate about an airliner's flight envelope, misled readers generally aren't going to go crash 737s.
kd0amg··on God be with you till we meet again (1918)
The government can only do so much to change culture, though, right?

The Chinese government is famous for having done it.

kd0amg··on Dwarf Fortress: An actual look at graphical improvements
If you use cage traps instead, you can set up a target range to train your crossbowdwarfs.
kd0amg··on A Man Who Saw the Pandemic Coming
Do you have sources for those figures? The ones I find are suggesting up to 2 weeks incubation (but more typically about 5 days) and surviving on some surfaces for 3 days (less for others).

https://www.medicalnewstoday.com/articles/sars-cov-2-study-c...

https://www.npr.org/sections/health-shots/2020/03/14/8116090...

kd0amg··on K Language (2011)
Typical practice seems to be having a large collection of ad hoc local transformations that look for specific combinations of operations. I've only really seen more general static analysis aimed at not materializing intermediate arrays in academic research.

Expression tree IR is maybe the wrong setting to do this sort of fusion for APL. What you want for a+b+c is a 3-argument scalar function applied to a, b, and c, but you need something other than actual APL expressions for that.

kd0amg··on K Language (2011)
Is there something about the primitives that APL-derivitives provide that mean that more of your program can happen inside the primitives so the interpreter is doing less work?

Yes. Well, maybe not the primitives themselves, so much as how the language pushes you to use them.

Last I looked, execution of the J interpreter, especially on large data, tends to be a handful of very tight loops inside the built-in verbs' implementations, and those loops are glued together with a small amount of the higher-overhead dispatch code normally associated with interpretation. Implicit looping incurs a once-per-array-op cost, but the cost of the computation done on each array element dominates the total cost. The interpreter is not especially clever, but the language encourages the programmer to write code that's easy for the interpreter to handle.

Performance is a bit fragile though. If the operation you're lifting over a whole array includes array-lifted operations internally, now you're doing the heavy interpretive dispatch inside the loop. As a simple example, {.+{: means "add the first item to the last item." If you apply it to a vector, it adds the first and last scalars. If you apply it to a matrix, it adds the first and last rows (and so on). Applying it to a very wide matrix is cheap because {. and {: just have to select the right rows, and then you have a simple loop over those rows' elements. It's about 166ms on my laptop with ten million row elements:

       wide =. i. 2 10000000
       6!:2 '({.+{:) wide'
    0.166085
With the data oriented the other way, there's no inherent reason computation should be any slower, but it is. ({.+{:)"1 means, "apply {.+{: to each individual vector." So we've changed from selecting the top and bottom from each column to selecting the left and right from each row. The way the J interpreter is structured, we have to figure out the loop for {.+{:)"1, but the loop body isn't just grabbing two numbers and adding them. The loop body jumps back to the interpreter to figure out how {.+{: should work on a 2-element vector. That takes about as long as figuring out how it should work on a 2-row matrix, but we do that for all ten million vectors.

       tall =. i. 10000000 2
       6!:2 '({.+{:)"1 tall'
    2.99855
kd0amg··on Facebook tax court trial begins over Ireland offshore deal
They will not be expected to pay this fine each year.

They will be "expected" to discontinue the behavior the IRS is suing them for. If they do it again, the IRS presumably has cause to sue again.

kd0amg··on Thought Experiment: An Introductory Compilers Class
Let's go another step. Move parsing into a mandatory class on automata theory, where you can properly dig into the machine models underlying different parsing algorithms.
kd0amg··on Simple Sabotage Field Manual (1944) [pdf]
What would covert acts of "simple sabotage" look like at a company like Google, Amazon, Microsoft, or Facebook?

They'd look like examples from past discussions of how a bad programmer can provide negative value to the company.

kd0amg··on The word “mafia” is never heard in The Godfather
Michael is the one Vito was trying to keep clean in hopes that he'd eventually be able to rise into a position of legitimate power, outside the criminal underworld.
kd0amg··on The word “mafia” is never heard in The Godfather
Luke, in Episode 4: "Why would Imperial troops want to slaughter Jawas?"
← PreviousPage 3 of 30Next →