Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #121599

Re: Universal Compiler (neos) - Turing Completeness

Path csiph.com!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail
From Keith Thompson <Keith.S.Thompson+u@gmail.com>
Newsgroups comp.lang.c++
Subject Re: Universal Compiler (neos) - Turing Completeness
Date Wed, 12 Feb 2025 15:00:00 -0800
Organization None to speak of
Lines 90
Message-ID <87y0yan4zz.fsf@nosuchdomain.example.com> (permalink)
References <eomnqj9h74qlbaaeh3llfj2cskptgssg2l@4ax.com> <877c5wnixf.fsf@nosuchdomain.example.com> <vohr77$295hl$1@dont-email.me> <voiimi$2cefi$2@dont-email.me> <jk4rP.38219$0C51.15480@fx38.iad> <ma6qqj5bs7nkv78ujlkjpgsj7uridrscs9@4ax.com>
MIME-Version 1.0
Content-Type text/plain; charset=utf-8
Content-Transfer-Encoding 8bit
Injection-Date Thu, 13 Feb 2025 00:00:02 +0100 (CET)
Injection-Info dont-email.me; posting-host="a242221703c60c2edaebd28191060ef6"; logging-data="2677688"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18zShSPcqwhfT8XKt/e+VjU"
User-Agent Gnus/5.13 (Gnus v5.13)
Cancel-Lock sha1:+fq/+EBPDQivPAisSYrEfYoyGGM= sha1:o/jcpK48LQ7kwamHy+FGwE7vDTk=
Xref csiph.com comp.lang.c++:121599

Show key headers only | View raw


Mr Flibble <leigh@i42.co.uk> writes:
> On Wed, 12 Feb 2025 16:51:27 GMT, scott@slp53.sl.home (Scott Lurndal)
> wrote:
[...]
>>>> On 12/02/2025 00:46, Keith Thompson wrote:
>>>>> Mr Flibble <leigh@i42.co.uk> writes:
>>>>>> I hope to achieve neos Turing Completeness in March during a two week
>>>>>> holiday.
>>>>>>
>>>>>> Also, did you know that with neos you can mix code from different
>>>>>> programming languages in the same source code file!
>>>>>
>>>>> That's a remarkable assertion.
>>>>>
>>>>> I presume you're asserting that you can do this *and* the code will
>>>>> execute correctly.
>>>>>
>>>>> Are you saying that that's possible in your current implementation, or
>>>>> that it's something you intend to implement in the future?

You didn't answer this.  I presume you haven't implemented this.  If
that's correct, please stop referring to neos's capabilities in the
present tense.

>>>>> Does switching from one language to another require some kind of
>>>>> explicit marker, or does neos figure it out?  With what granularity?
>>>>>
>>>>> If the latter, how does it know whether
>>>>>
>>>>>     size_t s = sizeof 'a';
>>>>>
>>>>> is C (typically setting s to 4, sizeof (int)) or C++ (setting s to 1)?

You didn't answer my question about granularity.  Will I be able to
write one line of code in C, another in C++ and another in Cobol, all
within the same function/procedure/subprogram?  Or is it finer than
that?  If I write

    DISPLAY printf("hello\n")

will it print "hello" to stdout and then use the Cobol DISPLAY verb to
display the result returned by printf (which is a C int, not of any
Cobol type)?

[...]

> In the unlikely event that two semantic concepts don't fold a compiler
> error is raised.

In the "unlikely event"?  I think you vastly underestimate the
complexity of the task.

So you're saying that there's no explicit marker indicating what
language is being used.  The system just figures it out.

I don't believe that's possible in general.

For a lot of C code, perhaps most of it, it's impossible to tell whether
it's C or C++ -- and Objective-C is supposed to be a strict superset of
C.  If I write `printf("hello, world\n");`, do you process it as C, or
as C++, or as Objective-C?  If a 10000-line source file is almost
entirely valid C with a single line that's C++, what will 

    void func(void) {
        int i = 10;
        int I = 20;
        writeln(i);
    }

What does this print?  (Pascal identifiers are case-insensitive.)
Or is this one of the "unlikely" cases where you'd raise an error?

And why would programmers *want* to do this?  If I wanted to mix
languages in a single source file (I don't), I'd insist on an
unambiguous indication of what language each piece of code is
written in.  Without that, maintenance would be a nightmare.

Language grammars, except in rare cases, are not designed to be
mixed with other language grammars.  I don't believe what you're
proposing is either possible or desirable, and I certainly don't believe
you've done it.

A "universal compiler" could be useful (if it were possible).

I'd like to encourage everyone else *not* to speculate about what
Mr Flibble has in mind.

-- 
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
void Void(void) { Void(); } /* The recursive call of the void */

Back to comp.lang.c++ | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Universal Compiler (neos) - Turing Completeness Mr Flibble <leigh@i42.co.uk> - 2025-02-11 23:22 +0000
  Re: Universal Compiler (neos) - Turing Completeness Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-02-11 15:46 -0800
    Re: Universal Compiler (neos) - Turing Completeness Muttley@DastardlyHQ.org - 2025-02-12 08:12 +0000
      Re: Universal Compiler (neos) - Turing Completeness David Brown <david.brown@hesbynett.no> - 2025-02-12 10:53 +0100
        Re: Universal Compiler (neos) - Turing Completeness Muttley@DastardlyHQ.org - 2025-02-12 10:06 +0000
          Re: Universal Compiler (neos) - Turing Completeness Phillip <nntp@fulltermprivacy.com> - 2025-02-12 11:34 -0500
    Re: Universal Compiler (neos) - Turing Completeness David Brown <david.brown@hesbynett.no> - 2025-02-12 10:55 +0100
      Re: Universal Compiler (neos) - Turing Completeness Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-02-12 02:47 -0800
      Re: Universal Compiler (neos) - Turing Completeness Phillip <nntp@fulltermprivacy.com> - 2025-02-12 11:36 -0500
        Re: Universal Compiler (neos) - Turing Completeness scott@slp53.sl.home (Scott Lurndal) - 2025-02-12 16:51 +0000
          Re: Universal Compiler (neos) - Turing Completeness Mr Flibble <leigh@i42.co.uk> - 2025-02-12 21:58 +0000
            Re: Universal Compiler (neos) - Turing Completeness Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-02-12 15:00 -0800
        Re: Universal Compiler (neos) - Turing Completeness James Kuyper <jameskuyper@alumni.caltech.edu> - 2025-02-12 12:26 -0500
          Re: Universal Compiler (neos) - Turing Completeness Phillip <nntp@fulltermprivacy.com> - 2025-02-13 00:00 -0500
            Re: Universal Compiler (neos) - Turing Completeness James Kuyper <jameskuyper@alumni.caltech.edu> - 2025-02-13 06:46 -0500
      Re: Universal Compiler (neos) - Turing Completeness "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2025-02-12 13:58 -0800
    Re: Universal Compiler (neos) - Turing Completeness Mr Flibble <leigh@i42.co.uk> - 2025-02-12 22:00 +0000
      Re: Universal Compiler (neos) - Turing Completeness Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-02-12 15:05 -0800
      Re: Universal Compiler (neos) - Turing Completeness James Kuyper <jameskuyper@alumni.caltech.edu> - 2025-02-13 17:34 -0500
        Re: Universal Compiler (neos) - Turing Completeness David Brown <david.brown@hesbynett.no> - 2025-02-14 09:48 +0100
          Re: Universal Compiler (neos) - Turing Completeness Mr Flibble <leigh@i42.co.uk> - 2025-02-14 13:25 +0000
            Re: Universal Compiler (neos) - Turing Completeness David Brown <david.brown@hesbynett.no> - 2025-02-15 10:15 +0100
              Re: Universal Compiler (neos) - Turing Completeness Mr Flibble <leigh@i42.co.uk> - 2025-02-15 14:37 +0000
                Re: Universal Compiler (neos) - Turing Completeness Muttley@DastardlyHQ.org - 2025-02-15 15:50 +0000
                Re: Universal Compiler (neos) - Turing Completeness Mr Flibble <leigh@i42.co.uk> - 2025-02-15 15:53 +0000
                Re: Universal Compiler (neos) - Turing Completeness Muttley@dastardlyhq.com - 2025-02-15 16:33 +0000
                Re: Universal Compiler (neos) - Turing Completeness Mr Flibble <leigh@i42.co.uk> - 2025-02-15 16:35 +0000
                Re: Universal Compiler (neos) - Turing Completeness Muttley@dastardlyhq.com - 2025-02-15 17:00 +0000
                Re: Universal Compiler (neos) - Turing Completeness David Brown <david.brown@hesbynett.no> - 2025-02-15 17:47 +0100
                Re: Universal Compiler (neos) - Turing Completeness Mr Flibble <leigh@i42.co.uk> - 2025-02-15 16:52 +0000
                Re: Universal Compiler (neos) - Turing Completeness Muttley@dastardlyhq.com - 2025-02-15 17:02 +0000
                Re: Universal Compiler (neos) - Turing Completeness Mr Flibble <leigh@i42.co.uk> - 2025-02-15 17:04 +0000
                Re: Universal Compiler (neos) - Turing Completeness Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-02-15 14:44 -0800
                Re: Universal Compiler (neos) - Turing Completeness Mr Flibble <leigh@i42.co.uk> - 2025-02-15 22:59 +0000
                Re: Universal Compiler (neos) - Turing Completeness Muttley@DastardlyHQ.org - 2025-02-16 09:23 +0000
                Re: Universal Compiler (neos) - Turing Completeness David Brown <david.brown@hesbynett.no> - 2025-02-16 14:13 +0100
                Re: Universal Compiler (neos) - Turing Completeness Mr Flibble <leigh@i42.co.uk> - 2025-02-16 13:18 +0000
                Re: Universal Compiler (neos) - Turing Completeness Michael S <already5chosen@yahoo.com> - 2025-02-16 17:01 +0200
                Re: Universal Compiler (neos) - Turing Completeness David Brown <david.brown@hesbynett.no> - 2025-02-16 16:17 +0100
                Re: Universal Compiler (neos) - Turing Completeness Muttley@dastardlyhq.com - 2025-02-16 16:44 +0000
                Re: Universal Compiler (neos) - Turing Completeness David Brown <david.brown@hesbynett.no> - 2025-02-16 16:09 +0100
                Re: Universal Compiler (neos) - Turing Completeness Muttley@dastardlyhq.com - 2025-02-16 16:47 +0000
                Re: Universal Compiler (neos) - Turing Completeness David Brown <david.brown@hesbynett.no> - 2025-02-17 08:11 +0100
                Re: Universal Compiler (neos) - Turing Completeness Muttley@dastardlyhq.com - 2025-02-16 16:41 +0000
                Re: Universal Compiler (neos) - Turing Completeness Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-02-16 15:23 -0800
                Re: Universal Compiler (neos) - Turing Completeness Muttley@DastardlyHQ.org - 2025-02-17 09:02 +0000
                Re: Universal Compiler (neos) - Turing Completeness James Kuyper <jameskuyper@alumni.caltech.edu> - 2025-02-16 11:30 -0500
                Re: Universal Compiler (neos) - Turing Completeness James Kuyper <jameskuyper@alumni.caltech.edu> - 2025-02-15 23:49 -0500
                Re: Universal Compiler (neos) - Turing Completeness Phillip <nntp@fulltermprivacy.com> - 2025-02-15 11:54 -0500
                Re: Universal Compiler (neos) - Turing Completeness Mr Flibble <leigh@i42.co.uk> - 2025-02-15 17:00 +0000
                Re: Universal Compiler (neos) - Turing Completeness Phillip <nntp@fulltermprivacy.com> - 2025-02-15 12:20 -0500
                Re: Universal Compiler (neos) - Turing Completeness Mr Flibble <leigh@i42.co.uk> - 2025-02-15 17:24 +0000
                Re: Universal Compiler (neos) - Turing Completeness Muttley@DastardlyHQ.org - 2025-02-16 09:19 +0000
                Re: Universal Compiler (neos) - Turing Completeness Muttley@dastardlyhq.com - 2025-02-15 17:04 +0000
                Re: Universal Compiler (neos) - Turing Completeness Mr Flibble <leigh@i42.co.uk> - 2025-02-15 17:16 +0000
                Re: Universal Compiler (neos) - Turing Completeness David Brown <david.brown@hesbynett.no> - 2025-02-16 14:31 +0100
                Re: Universal Compiler (neos) - Turing Completeness Muttley@dastardlyhq.com - 2025-02-16 16:44 +0000
          Re: Universal Compiler (neos) - Turing Completeness James Kuyper <jameskuyper@alumni.caltech.edu> - 2025-02-14 13:40 -0500
            Re: Universal Compiler (neos) - Turing Completeness antispam@fricas.org (Waldek Hebisch) - 2025-02-14 21:23 +0000
              Re: Universal Compiler (neos) - Turing Completeness David Brown <david.brown@hesbynett.no> - 2025-02-15 10:09 +0100
                Re: Universal Compiler (neos) - Turing Completeness antispam@fricas.org (Waldek Hebisch) - 2025-02-16 05:47 +0000
        Re: Universal Compiler (neos) - Turing Completeness antispam@fricas.org (Waldek Hebisch) - 2025-02-14 15:14 +0000
          Re: Universal Compiler (neos) - Turing Completeness Muttley@DastardlyHQ.org - 2025-02-14 16:00 +0000

csiph-web