Article View: comp.arch
Article #210Re: Documentation (was Re: Performance of xchg reg,reg)
From: Dan Cross
Date: Mon, 19 Oct 2026 01:52
Date: Mon, 19 Oct 2026 01:52
55 lines
3057 bytes
3057 bytes
In article <6ad5609b.8505984@news.eternal-september.org>,
John Savard <quadibloc@invalid.com> wrote:
>On Sun, 18 Oct 2026 09:45:00 -0400, George Neuner
><gneuner2@comcast.net> wrote:
>
>>The problem with the original report was that they attempted with the
>>grammar turn [at least some kinds of] semantic errors into syntax
>>errors.
>
>Obviously, there's no way one can enable a compiler to flag logic
>errors in programs. A Turing-complete language can calculate anything,
>so how can it tell you that you were calculating this when you wanted
>to calculate that?
With apologies, arguments like these always seem to me to miss
the forest for the trees a bit. Some constructs clearly violate
the documented semantics of e.g. a language.
Yes, these langauges are all Turing-complete and so on, and no,
we cannot solve _The_ Halting Problem, in all of its glorious
generality. But, we can solve any number of specific halting
_problems_. For example, I can see that, `for (;;);` is a loop
that does not terminate. With enough effort, I can take that
down some reasonably long paths.
So, too, one can spot a lot of logic errors. There's no reason
a compiler can't see this, for example:
? if (ptr == NULL) {
? int v = *ptr++;
? *ptr = v + 10;
? }
And flag it with a error: "you dereferenced a pointer right
after you asserted it was nil; did you invert the condition?"
Similarly, I posted about Rust a few days ago, which can do all
sorts of fun stuff with its borrow checker to assert that an
object is still alive while references to it exist, and so on,
and reject programs at compilation time that violate those
semantics.
>Of course, with AI, we might be able to do something there.
>
>But already many modern languages do have strict type-checking.
>
>So even if Algol 68 was over-ambitious in this regard, trying to have
>the language help the programmer avoid more mistakes is basically a
>sound idea.
Agreed. Indeed, we've gone much farther than just mere type
checking.
- Dan C.
Technical Details
Message-ID:
<11b3t5j$h7l$1@reader2.panix.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!panix!.POSTED.spitfire.i.gajendra.net!not-for-mailReferences:
<2026Oct13.104347@mips.complang.tuwien.ac.at> <11b0nak$iems$9@dont-email.me> <kqg9dl5oj9l0dih5kvnrif2fv91ns8lgs3@4ax.com> <6ad5609b.8505984@news.eternal-september.org>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!panix!.POSTED.spitfire.i.gajendra.net!not-for-mail From: cross@spitfire.i.gajendra.net (Dan Cross) Newsgroups: comp.arch Subject: Re: Documentation (was Re: Performance of xchg reg,reg) Date: Mon, 19 Oct 2026 01:52:51 -0000 (UTC) Organization: PANIX Public Access Internet and UNIX, NYC Message-ID: <11b3t5j$h7l$1@reader2.panix.com> References: <2026Oct13.104347@mips.complang.tuwien.ac.at> <11b0nak$iems$9@dont-email.me> <kqg9dl5oj9l0dih5kvnrif2fv91ns8lgs3@4ax.com> <6ad5609b.8505984@news.eternal-september.org> Injection-Date: Mon, 19 Oct 2026 01:52:51 -0000 (UTC) Injection-Info: reader2.panix.com; posting-host="spitfire.i.gajendra.net:166.84.136.80"; logging-data="17653"; mail-complaints-to="abuse@panix.com" X-Newsreader: trn 4.0-test77 (Sep 1, 2010) Originator: cross@spitfire.i.gajendra.net (Dan Cross)