logoalt Hacker News

t0mek • today at 3:06 PM • 3 replies • view on HN

> We must take the same attitude in computing: use abstractions, refactor, refine scope, invent and adopt higher-level languages, until we can hold the code in our head.

I want to believe this is true. But as an counterexample, do we need to hold machine code or assembly, generated from our C or Golang programs, in our heads? Or rather the Golang code is a high-level abstraction which is good enough?

If that's the case, does it mean we should go even further and treat design docs as the code suitable to hold in head and treat Golang program as a derivative? Or maybe design docs are also too low-level and the general vibe "create me an app, make no mistakes" is actually enough?

What's the right abstraction level? How to find it?


Replies

titzer • today at 4:23 PM

> But as an counterexample, do we need to hold machine code or assembly, generated from our C or Golang programs, in our heads?

No, the source is enough, because the low-level assembly is translated from the high-level source descriptions (a sound programming language with a complete and consistent specification) via a deterministic algorithmic translation process (a compiler) to a low-level executable that can run on a machine. Today, compilers are complex, but still human understandable. The programs are equivalent, and we're getting better able to actually prove this.

This is why I bristle when people say "post your prompts". Your prompts are not a program and the magic box is not a compiler.

Too many people abandoning everything, either due to laziness, mental overload, or..."skill issues".

I still want to see code. I want write code, check code, optimize and refactor code. I don't want to spend a lot of time debugging, but maybe a little.

The clankers should be accelerating the parts of the process we are bad at, and that takes time we won't spend: long, time-consuming refactors, debugging deep issues, writing crap tons of tests, investigating performance issues, digesting other people's code.

AI should be more like a bicycle than a cruise ship. And I mean the "bicycle for the mind" that Jobs wanted.

➕ show 1 reply
remywang • today at 3:58 PM

I agree there is a spectrum, but we at least have to be honest with ourselves: are we really sure AI generated code is following the spec? On the other hand, with progress in proof automation, it is now feasible to formally verify AI generated code, and that allows us to specify program behavior formally, and a formal specification is again a program in itself.

➕ show 1 reply
CamperBob2 • today at 3:25 PM

I'm not sure the comparison with Hilbert's dictum holds up in our field. Yes, Godel made a mockery of it, and mathematics is now known to be limited by incompleteness, but only at the theoretical horizon. Working mathematicians will not run into it as a problem that blocks their work in other areas.

In computing, though, the halting problem hoses us every time we have to hit ctrl-c to break an accidental infinite loop. Our tools can't always flag those situations ahead of time, so we often have to find them the hard way.

It seems clear that in software development, the specification is the program. To the extent there's something that the spec doesn't cover, that's a bug in the spec, not in the AI that turns the spec into code. Just as you wouldn't blame a compiler for your infinite loop, we will eventually reach the point where blaming a clanker for generating imperfect high-level code sounds just as bogus.

"Build me a Super Mario Bros. clone, make no mistakes" is the new hello_world.c. For anything innovative -- anything with commercial value -- the spec will have to be a lot more elaborate. There are plenty of specs that are already too complex for any one person to hold in their head, except perhaps for a few godlike prodigies. Look at the MPEG-4 document collection, or for that matter our tax and legal systems. I think the lesson is that language alone can't save us from complexity, any more than a better set of axioms can save us from incompleteness.