gregfjohnson

Joined 19 years ago

Karma
1,545
Submissions
203
Member since
Feb 8
View on Hacker News

Recent submissions

Comment · 16 days ago
I feed crows on my nightly bike ride. Sometimes there are multiple crows, the proverbial "murder". If there are just a few, as far as I'm concerned it's just a manslaughter...
Comment · 2 months ago
Comment · 2 months ago
Comment · 2 months ago
Joel Hamkins is my new favorite mathematician :-)

There is a beautiful application of the power set of the Naturals to denotational semantics. I assume Prof. Hamkins's book will cover that topic, but it is not mentioned in the linked article.

Dana Scott (and apparently Gordon Plotkin independently) came up with a clever way to create a model of the lambda calculus that employs the power set of the Naturals.

The problem is that in lambda calculus, the formal language permits every expression to appear in the left-hand slot of the "Function_Application" operator. I.e., every term is simultaneously permitted to be given as an argument to a function, and also to be used as a function.

So we have the conundrum of finding some set "S" where every element of S is a function (not a problem so far), BUT, those functions all take elements of S as inputs and produce elements of S as outputs. So we need a set S that is isomorphic to the set of functions "S -> S". Cardinality arguments show that this is not possible: the function space for any non-trivial set has greater cardinality than the set itself.

So, Scott and Plotkin devised a "computationally sensible" way to interpret an arbitrary set of integers as a function over sets of integers.

By standard encodings, interpret any integer "n" as an ordered pair "<M,u>". Now, again via standard encoding, interpret M as a finite set of integers M_set.

The "function" defined by a singleton set { n } applied to some other set Q is: {u} if M_set is a subset of Q, Empty_set otherwise.

Then for a set of more than one element, take the union of the outputs of each of the elements applied to Q as above.

One can define a topology over the power set of the Naturals, and the above functions turn out to be exactly the continuous functions relative to that topology. The continuous functions so defined have the same cardinality as the power set of the Naturals.

An interesting historical side-note: historically, mathematical structures were the starting point, and axiometized formal languages a la Frege, Russell & Whitehead, etc. were built later. In the case of lambda calculus, it was the other way around: the formal language came first, and it was a multi-decade riddle what actual mathematical structure (if any) this formal language actually described.

Comment · 3 months ago
Been doing this for 20 minutes in the morning for a few decades now. It has had an impact. I am a rather “high gain” person emotionally. I now tend to notice emotions and observe them, which helps when they threaten to suck me into a self-perpetuating ruminative vortex. Also, it has made me gentler, and an easier person to be around. I’m now well aware that whatever disturbances occur, there will be echoes and resonances tomorrow morning during my sit! Now for a moment of honesty: this is a religious practice for me. A prayer that “landed” for me: “Lord, I ask to be a conduit of grace.”
Comment · 3 months ago
It is a surprising and delightful consequence of this observation that there is a polynomial whose integer-valued roots are exactly the set of all prime numbers.
Comment · 7 months ago
Comment · 9 months ago
One use case that I'm beginning to find useful is to go into a specific directory of code that I have written and am working on, and ask the AI agent (Claude Code in my case) "Please find and list possible bugs in the code in this directory."

Then, I can reason through the AI agent's responses and decide what if anything I need to do about them.

I just did this for one project so far, but got surprisingly useful results.

It turns out that the possible bugs identified by the AI tool were not bugs based on the larger context of the code as it exists right now. For example, it found a function that returns a pointer, and it may return NULL. Call sites were not checking for a NULL return value. The code in its current state could never in fact return a NULL value. However, future-proofing this code, it would be good practice to check for this case in the call sites.

Comment · 9 months ago
This all reminds me of one of the most foundational and profound papers ever written about software development: Peter Naur's "Programming as Theory Building". I have seen colleagues get excited about using Claude to write their software for them, and then end up spending at least as much time as if they had written it themselves trying to develop a theory the code that was produced, and an understanding sufficient to correct the problems and bugs in the created code. Every professional software engineer confronts the situation of digging into and dealing with a big wad of legacy code. However, most of us prefer those occasions when we can write some code fresh, and develop a theory and deep understanding from the get-go. Reverse-engineering out a sufficient theory of legacy code to be able to responsibly modify it is hard and at times unsatisfying. I don't relish the prospect of having that be the sum total of all my effort as a software engineer, when the "legacy code" I need to struggle to understand is code generated by an AI tool.
Comment · 9 months ago
Comment · 10 months ago
The original comment by Rob Pike and discussion here have implied or used the word "evil".

What is a workable definition of "evil"?

How about this:

Intentionally and knowingly destroying the lives of other people for no other purpose than furthering one's own goals, such as accumulating wealth, fame, power, or security.

There are people in the tech space, specifically in the current round of AI deployment and hype, who fit this definition unfortunately and disturbingly well.

Another much darker sort of of evil could arise from a combination of depression or severe mental illness and monstrously huge narcissism. A person who is suffering profoundly might conclude that life is not worth the pain and the best alternative is to end it. They might further reason that human existence as a whole is an unending source of misery, and the "kindest" thing to do would be to extinguish humanity as a whole.

Some advocates of AI as "the next phase of evolution" seem to come close to this view or advocate it outright.

To such people it must be said plainly and forcefully:

You have NO RIGHT to make these kinds of decisions for other human beings.

Evolution and culture have created and configured many kinds of human brains, and many different experiences of human consciousness.

It is the height (or depth) of arrogance to project your own tortured mental experience onto other human beings and arrogate to yourself the prerogative to decide on their behalf whether their lives are worth living.

Comment · 10 months ago
Comment · 10 months ago
(Show HN?) Here is another attempt at providing intuition on complex numbers, the multiplication rule in particular: "Why does complex multiplication have to be the way it is?" https://gregfjohnson.com/complex/

I find that the easiest intuitive on-ramp to complex arithmetic is to start with compass headings: "Oh that nice coffee shop? Go two blocks north and then a block east." Numbers come with any direction on the compass, not just "east" and "west". It turns out that it is pretty easy to intuitively justify multiplication by a scalar and addition of complex numbers, but multiplication is harder. A great way to get a feel for multiplication is to consider the equation "(x+1)(x-1) = x*2 - 1". Then, substitute "i" for x. The left-hand side is (intuitively) on a circle of radius 2 centered at the origin, and the right-hand side is on a circle of radius 1, where the circle is shifted horizontally so that its center is on the real line at -1. There's only one place these two circles meet: -2 on the real line.

Comment · 11 months ago
There are bitter and heartstrong arguments on this topic. Brachycephalic breeds with flat faces or short snouts (for example pugs, bulldogs, boxers, Boston terriers) cause anger among some and devotion among others. (We are a three-pug family.) Pugs have an average lifespan of 12 to 15 years, as compared with the overall average dog lifespan of 10 to 13 years. We have also had (and loved) boxers, which have an average lifespan of 10 to 12 years. Boxers seem to be genetically prone to cancer, which is how we lost our most recent boxer.

There's a classic cartoon showing two wolves in the bushes at the edge of a campfire, looking at the leftovers being thrown around by the humans. One says, "Look, what the heck, let's cozy up to these two-legged creatures that seem to have lots of food. What could go wrong?"

Next frame is a picture of an unhappy-looking pug wearing a birthday hat..

Comment · 1 year ago
There is this wonderful concept of "flow state", which I'm sure most of us are familiar with. It was originated by Mihaly Csikszentmihalyi. Many of us in this thread (and Linus's essay quoted in OP) are referring in various ways of getting into the flow state while programming.

Something I learned late in the game as a programmer is how beautiful it is when multiple people somehow sync up and get into a flow state together. It is like a choir, where everyone is somehow elevated and together they achieve a lovely unity. Or a sports team where all of the players are locked in, seemingly reading each others' minds, and getting to some amazing transcendent place together. The book "The Boys in the Boat" describes this phenomenon beautifully. When all nine members of the team achieve this sort of locked-in unity, the boat just flies across the water.

In software, there are times when ideas seem to pass with electricity from person to person. People immediately build upon the thoughts of others. Ideas seemingly come from nowhere, a synthesis of the conceptual pieces held by each of the team members. You realize that some wonderful new way of doing things has emerged from the dialog, and no one person could have possibly gotten there on their own.

There is a wonderful old-fashioned phrase that describes this: "The whole is greater than the sum of the parts."

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton