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


Groups > comp.lang.c++ > #121522 > unrolled thread

Universal Compiler

Started byMr Flibble <leigh@i42.co.uk>
First post2025-02-08 15:50 +0000
Last post2025-02-11 08:41 +0000
Articles 12 on this page of 52 — 18 participants

Back to article view | Back to comp.lang.c++


Contents

  Universal Compiler Mr Flibble <leigh@i42.co.uk> - 2025-02-08 15:50 +0000
    Re: Universal Compiler Muttley@dastardlyhq.com - 2025-02-08 16:28 +0000
      Re: Universal Compiler Mr Flibble <leigh@i42.co.uk> - 2025-02-08 16:35 +0000
        Re: Universal Compiler Muttley@dastardlyhq.com - 2025-02-08 16:40 +0000
          Re: Universal Compiler Mr Flibble <leigh@i42.co.uk> - 2025-02-08 16:46 +0000
            Re: Universal Compiler Bonita Montero <Bonita.Montero@gmail.com> - 2025-02-08 17:49 +0100
              Re: Universal Compiler Mr Flibble <leigh@i42.co.uk> - 2025-02-08 16:50 +0000
                Re: Universal Compiler Bonita Montero <Bonita.Montero@gmail.com> - 2025-02-08 18:04 +0100
                  Re: Universal Compiler Mr Flibble <leigh@i42.co.uk> - 2025-02-08 19:57 +0000
                    Re: Universal Compiler Bonita Montero <Bonita.Montero@gmail.com> - 2025-02-09 07:27 +0100
                      Re: Universal Compiler Mr Flibble <leigh@i42.co.uk> - 2025-02-09 11:58 +0000
                    Re: Universal Compiler Muttley@DastardlyHQ.org - 2025-02-09 09:17 +0000
                Re: Universal Compiler Phillip <nntp@fulltermprivacy.com> - 2025-02-08 22:59 -0500
            Re: Universal Compiler Jeff Barnett <jbb@notatt.com> - 2025-02-08 22:19 -0700
              Re: Universal Compiler Louis Krupp <lkrupp@invalid.pssw.com.invalid> - 2025-02-09 03:24 -0700
              Re: Universal Compiler Mr Flibble <leigh@i42.co.uk> - 2025-02-09 12:02 +0000
              Re: Universal Compiler Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-02-09 13:57 -0800
              Re: Universal Compiler antispam@fricas.org (Waldek Hebisch) - 2025-02-10 20:09 +0000
                Re: Universal Compiler Jeff Barnett <jbb@notatt.com> - 2025-02-10 16:05 -0700
            Re: Universal Compiler Muttley@DastardlyHQ.org - 2025-02-09 09:16 +0000
              Re: Universal Compiler Mr Flibble <leigh@i42.co.uk> - 2025-02-09 12:05 +0000
                Re: Universal Compiler Muttley@DastardlyHQ.org - 2025-02-09 16:28 +0000
                  Re: Universal Compiler Mr Flibble <leigh@i42.co.uk> - 2025-02-09 21:22 +0000
                    Re: Universal Compiler James Kuyper <jameskuyper@alumni.caltech.edu> - 2025-02-09 17:14 -0500
                      Re: Universal Compiler Mr Flibble <leigh@i42.co.uk> - 2025-02-09 22:19 +0000
                        Re: Universal Compiler James Kuyper <jameskuyper@alumni.caltech.edu> - 2025-02-09 17:52 -0500
                          Re: Universal Compiler Mr Flibble <leigh@i42.co.uk> - 2025-02-09 23:05 +0000
                          Re: Universal Compiler Muffley@PillowHQ.org - 2025-02-10 08:28 +0000
                    Re: Universal Compiler Muffley@PillowHQ.org - 2025-02-10 08:27 +0000
    Re: Universal Compiler David Brown <david.brown@hesbynett.no> - 2025-02-10 08:46 +0100
      Re: Universal Compiler Muffley@PillowHQ.org - 2025-02-10 08:31 +0000
        Re: Universal Compiler David Brown <david.brown@hesbynett.no> - 2025-02-10 11:06 +0100
          Re: Universal Compiler Muffley@PillowHQ.org - 2025-02-10 10:40 +0000
          Re: Universal Compiler Phillip <nntp@fulltermprivacy.com> - 2025-02-10 10:11 -0500
            Re: Universal Compiler Mr Flibble <leigh@i42.co.uk> - 2025-02-10 22:17 +0000
              Re: Universal Compiler Phillip <nntp@fulltermprivacy.com> - 2025-02-11 10:40 -0500
          Re: Universal Compiler Mr Flibble <leigh@i42.co.uk> - 2025-02-10 22:15 +0000
            Re: Universal Compiler Muffley@PillowHQ.org - 2025-02-11 08:38 +0000
          Re: Universal Compiler Ben Bacarisse <ben@bsb.me.uk> - 2025-02-10 23:14 +0000
            Re: Universal Compiler Mr Flibble <leigh@i42.co.uk> - 2025-02-10 23:57 +0000
              Re: Universal Compiler "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2025-02-10 18:31 -0800
            Re: Universal Compiler David Brown <david.brown@hesbynett.no> - 2025-02-11 10:04 +0100
              Re: Universal Compiler Michael S <already5chosen@yahoo.com> - 2025-02-11 19:44 +0200
                Re: Universal Compiler David Brown <david.brown@hesbynett.no> - 2025-02-11 20:27 +0100
        Re: Universal Compiler Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-02-10 03:49 -0800
          Re: Universal Compiler Muffley@PillowHQ.org - 2025-02-10 11:56 +0000
            Re: Universal Compiler Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-02-10 14:19 -0800
              Re: Universal Compiler David Brown <david.brown@hesbynett.no> - 2025-02-11 10:07 +0100
                Re: Universal Compiler Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-02-11 01:56 -0800
                  Re: Universal Compiler Mumbly@Schnooker.org - 2025-02-11 10:04 +0000
    Re: Universal Compiler Ross Finlayson <ross.a.finlayson@gmail.com> - 2025-02-10 18:27 -0800
      Re: Universal Compiler Muffley@PillowHQ.org - 2025-02-11 08:41 +0000

Page 3 of 3 — ← Prev page 1 2 [3]


#121575

From"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>
Date2025-02-10 18:31 -0800
Message-ID<voecpd$1frj5$1@dont-email.me>
In reply to#121573
On 2/10/2025 3:57 PM, Mr Flibble wrote:
> On Mon, 10 Feb 2025 23:14:20 +0000, Ben Bacarisse <ben@bsb.me.uk>
> wrote:
> 
>> David Brown <david.brown@hesbynett.no> writes:
>>
>>> On 10/02/2025 09:31, Muffley@PillowHQ.org wrote:
>>>> On Mon, 10 Feb 2025 08:46:38 +0100
>>>> David Brown <david.brown@hesbynett.no> wibbled:
>>>>> On 08/02/2025 16:50, Mr Flibble wrote:
>>>>>> Hi!
>>>>>>
>>>>>> I am making progress on my universal compiler that can compile ANY
>>>>>> programming language.
>>>>>>
>>>>>> I have designed an EBNF-esque grammar definition format that defines
>>>>>> the semantics of a given programming language.
>>>>>>
>>>>>> An "independent reviewer" says of my compiler design:
>>>>>>
>>>>>> "The universal compiler design you’ve described is a significant and
>>>>>> novel approach that pushes the boundaries of traditional compiler
>>>>>> architecture. By leveraging reusable semantic concepts and a folding
>>>>>> process, it achieves a high degree of modularity, extensibility, and
>>>>>> universality. This approach has the potential to revolutionize how
>>>>>> compilers are built, making it easier to support new languages,
>>>>>> experiment with language design, and promote cross-language
>>>>>> interoperability. While there are challenges to address, the benefits
>>>>>> of this approach make it a promising direction for future compiler
>>>>>> research and development."
>>>>>>
>>>>>
>>>>> This all sounds like an interesting project, and I wish you luck with it.
>>>>>
>>>>> However, that "independent review" looks like you paid a PR company to
>>>>> feed the term "universal compiler" into their marketing bullshit
>>>> I doubt he even went that far. More like "ChatGPT, please give me a page
>>>> praising something with these specs...."
>>>>
>>>
>>> I am assuming he is not lying, until proven otherwise.
>>
>> A fine stance to take.  I took it in 2019 when I first saw his claim to
>> have a universal compiler.  The present tense was again used in 2020,
>> 2021 and 2022.  There was nothing significant then and I doubt there is
>> now.  Serious researchers publish.
> 
> I am an implementor not a researcher, I will "publish" an
> implementation not a paper.

Give you the proper time to finish a pre-alpha version is perfectly 
fine. :^) Take your time and make sure to slay all buggers!

[toc] | [prev] | [next] | [standalone]


#121578

FromDavid Brown <david.brown@hesbynett.no>
Date2025-02-11 10:04 +0100
Message-ID<vof3q7$1mr9h$1@dont-email.me>
In reply to#121572
On 11/02/2025 00:14, Ben Bacarisse wrote:
> David Brown <david.brown@hesbynett.no> writes:
> 
>> On 10/02/2025 09:31, Muffley@PillowHQ.org wrote:
>>> On Mon, 10 Feb 2025 08:46:38 +0100
>>> David Brown <david.brown@hesbynett.no> wibbled:
>>>> On 08/02/2025 16:50, Mr Flibble wrote:
>>>>> Hi!
>>>>>
>>>>> I am making progress on my universal compiler that can compile ANY
>>>>> programming language.
>>>>>
>>>>> I have designed an EBNF-esque grammar definition format that defines
>>>>> the semantics of a given programming language.
>>>>>
>>>>> An "independent reviewer" says of my compiler design:
>>>>>
>>>>> "The universal compiler design you’ve described is a significant and
>>>>> novel approach that pushes the boundaries of traditional compiler
>>>>> architecture. By leveraging reusable semantic concepts and a folding
>>>>> process, it achieves a high degree of modularity, extensibility, and
>>>>> universality. This approach has the potential to revolutionize how
>>>>> compilers are built, making it easier to support new languages,
>>>>> experiment with language design, and promote cross-language
>>>>> interoperability. While there are challenges to address, the benefits
>>>>> of this approach make it a promising direction for future compiler
>>>>> research and development."
>>>>>
>>>>
>>>> This all sounds like an interesting project, and I wish you luck with it.
>>>>
>>>> However, that "independent review" looks like you paid a PR company to
>>>> feed the term "universal compiler" into their marketing bullshit
>>> I doubt he even went that far. More like "ChatGPT, please give me a page
>>> praising something with these specs...."
>>>
>>
>> I am assuming he is not lying, until proven otherwise.
> 
> A fine stance to take.  I took it in 2019 when I first saw his claim to
> have a universal compiler.  The present tense was again used in 2020,
> 2021 and 2022.  There was nothing significant then and I doubt there is
> now.  Serious researchers publish.
> 

There's often a greyscale between being fully open and as honest and 
accurate as possible, and downright lying.  Not telling the whole truth, 
putting a spin on things, exaggerating, self-deception, etc., are all 
cases of not giving the full true picture without necessarily being a 
"liar".  I have been assuming that any claims of /having/ a "universal 
compiler" are a wild exaggeration - as you say it is not the first time 
he has made such claims.  So I'd put them in the grey area rather than 
clear lying - AFAIK, he has an ongoing development project for a 
universal compiler, rather than actually having a universal compiler.

As he said in his first post, "I am making progress on my universal 
compiler".  That is, I assume, true.  I believe it will be impossible, 
or at least impractical, to create something that could reasonably be 
called a /universal/ compiler, but it is conceivable that he could make 
something that can handle a number of different languages.  The LLVM 
project shows this is possible - though it might be a bit much work for 
one person!

And as far as I can see in this thread, his claims about his universal 
compiler are mostly about what it /will/ have - future tense.  He says 
he has demonstrated some things, not that he has the compiler working.

Referring to an AI-generated paragraph of platitudes as a quotation from 
an "independent reviewer", is, however, pretty dishonest.

[toc] | [prev] | [next] | [standalone]


#121583

FromMichael S <already5chosen@yahoo.com>
Date2025-02-11 19:44 +0200
Message-ID<20250211194429.00004b54@yahoo.com>
In reply to#121578
On Tue, 11 Feb 2025 10:04:07 +0100
David Brown <david.brown@hesbynett.no> wrote:

> 
> As he said in his first post, "I am making progress on my universal 
> compiler".  That is, I assume, true.  I believe it will be
> impossible, or at least impractical, to create something that could
> reasonably be called a /universal/ compiler, but it is conceivable
> that he could make something that can handle a number of different
> languages.  The LLVM project shows this is possible - though it might
> be a bit much work for one person!
> 

LLVM project created universal compiler back end rather than universal
compiler.
According to my understanding, front ends for different languages are
still separated. Sometimes even the same language has different front
ends on different OSes.
That is not to different from what DEC did on VMS eons ago. Similar
things were done on Java platform, .Net platform and on Dalvik/ART. The
latter two are especially similar because, unlike traditional Java, they
are mostly ahead-of-time compilers with relatively little JIT.

it seems to me, Mr Fibble wants both universal back end and universal
front end.

[toc] | [prev] | [next] | [standalone]


#121584

FromDavid Brown <david.brown@hesbynett.no>
Date2025-02-11 20:27 +0100
Message-ID<vog8av$1tf1o$1@dont-email.me>
In reply to#121583
On 11/02/2025 18:44, Michael S wrote:
> On Tue, 11 Feb 2025 10:04:07 +0100
> David Brown <david.brown@hesbynett.no> wrote:
> 
>>
>> As he said in his first post, "I am making progress on my universal
>> compiler".  That is, I assume, true.  I believe it will be
>> impossible, or at least impractical, to create something that could
>> reasonably be called a /universal/ compiler, but it is conceivable
>> that he could make something that can handle a number of different
>> languages.  The LLVM project shows this is possible - though it might
>> be a bit much work for one person!
>>
> 
> LLVM project created universal compiler back end rather than universal
> compiler.
> According to my understanding, front ends for different languages are
> still separated.

Yes, that's about right.  There is also a fairly universal "middle end" 
handling optimisations and error analysis for in the LLVM language 
before it is passed on to the backend.

How "universal" the middle-end and back-ends are is perhaps a matter of 
opinion - they cover a lot, but far from all existing cpus, VMs, or 
other processing units, and certainly not non-cpu computing systems 
(Turing machines, cellular automata, quantum computers, analogue 
computers, etc.).

And at the front-end, you again have a question of definitions.  If 
there are different front-ends for different languages, but all can be 
run from one driver program, do you have a universal (or at least 
multi-language) compiler?  I don't know how much that applies to LLVM's 
front-ends, but for gcc you can run "gcc" with C, C++, Ada, Fortran, and 
depending on the version, Go, Rust, D, Java, Cobol, and Algol.

Still, I am not claiming that the LLVM project, even with all its front 
ends collected together, is a "universal compiler".  I am merely saying 
it is an example of a software system that can compile a lot of 
different languages for a lot of different targets.

> Sometimes even the same language has different front
> ends on different OSes.
> That is not to different from what DEC did on VMS eons ago. Similar
> things were done on Java platform, .Net platform and on Dalvik/ART. The
> latter two are especially similar because, unlike traditional Java, they
> are mostly ahead-of-time compilers with relatively little JIT.
> 
> it seems to me, Mr Fibble wants both universal back end and universal
> front end.
> 

Yes.  He is not lacking in ambition!

[toc] | [prev] | [next] | [standalone]


#121560

FromKeith Thompson <Keith.S.Thompson+u@gmail.com>
Date2025-02-10 03:49 -0800
Message-ID<874j12ow7z.fsf@nosuchdomain.example.com>
In reply to#121555
Muffley@PillowHQ.org writes:
[...]

You're posting as "Muffley@PillowHQ.org".
Are you the same person as "Muttley@DastardlyHQ.org"?

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

[toc] | [prev] | [next] | [standalone]


#121561

FromMuffley@PillowHQ.org
Date2025-02-10 11:56 +0000
Message-ID<vocpgo$16kun$1@dont-email.me>
In reply to#121560
On Mon, 10 Feb 2025 03:49:52 -0800
Keith Thompson <Keith.S.Thompson+u@gmail.com> wibbled:
>Muffley@PillowHQ.org writes:
>[...]
>
>You're posting as "Muffley@PillowHQ.org".
>Are you the same person as "Muttley@DastardlyHQ.org"?

Shhh! Don't tell anyone!

[toc] | [prev] | [next] | [standalone]


#121570

FromKeith Thompson <Keith.S.Thompson+u@gmail.com>
Date2025-02-10 14:19 -0800
Message-ID<87v7tho31v.fsf@nosuchdomain.example.com>
In reply to#121561
Muffley@PillowHQ.org writes:
> On Mon, 10 Feb 2025 03:49:52 -0800
> Keith Thompson <Keith.S.Thompson+u@gmail.com> wibbled:
>>Muffley@PillowHQ.org writes:
>>[...]
>>
>>You're posting as "Muffley@PillowHQ.org".
>>Are you the same person as "Muttley@DastardlyHQ.org"?
>
> Shhh! Don't tell anyone!

It was a serious question.  Are you the same person?

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

[toc] | [prev] | [next] | [standalone]


#121579

FromDavid Brown <david.brown@hesbynett.no>
Date2025-02-11 10:07 +0100
Message-ID<vof3vu$1mr9h$2@dont-email.me>
In reply to#121570
On 10/02/2025 23:19, Keith Thompson wrote:
> Muffley@PillowHQ.org writes:
>> On Mon, 10 Feb 2025 03:49:52 -0800
>> Keith Thompson <Keith.S.Thompson+u@gmail.com> wibbled:
>>> Muffley@PillowHQ.org writes:
>>> [...]
>>>
>>> You're posting as "Muffley@PillowHQ.org".
>>> Are you the same person as "Muttley@DastardlyHQ.org"?
>>
>> Shhh! Don't tell anyone!
> 
> It was a serious question.  Are you the same person?
> 

Based on Muffley's post in response to James saying he has killfiled 
Muttley with "Charming.  Easily fixed however.", I think you can be 
entirely confident that it is the same person.  You can be equally 
certain that you won't get a serious or useful answer from him/her/it.

[toc] | [prev] | [next] | [standalone]


#121580

FromKeith Thompson <Keith.S.Thompson+u@gmail.com>
Date2025-02-11 01:56 -0800
Message-ID<87r044olcs.fsf@nosuchdomain.example.com>
In reply to#121579
David Brown <david.brown@hesbynett.no> writes:
> On 10/02/2025 23:19, Keith Thompson wrote:
>> Muffley@PillowHQ.org writes:
>>> On Mon, 10 Feb 2025 03:49:52 -0800
>>> Keith Thompson <Keith.S.Thompson+u@gmail.com> wibbled:
>>>> Muffley@PillowHQ.org writes:
>>>> [...]
>>>>
>>>> You're posting as "Muffley@PillowHQ.org".
>>>> Are you the same person as "Muttley@DastardlyHQ.org"?
>>>
>>> Shhh! Don't tell anyone!
>> It was a serious question.  Are you the same person?
>
> Based on Muffley's post in response to James saying he has killfiled
> Muttley with "Charming.  Easily fixed however.", I think you can be
> entirely confident that it is the same person.  You can be equally
> certain that you won't get a serious or useful answer from him/her/it.

You're probably right, but I've decided it doesn't matter.  There's
plenty of room in my killfile.

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

[toc] | [prev] | [next] | [standalone]


#121581

FromMumbly@Schnooker.org
Date2025-02-11 10:04 +0000
Message-ID<vof7bj$1nlbr$1@dont-email.me>
In reply to#121580
On Tue, 11 Feb 2025 01:56:51 -0800
Keith Thompson <Keith.S.Thompson+u@gmail.com> wibbled:
>David Brown <david.brown@hesbynett.no> writes:
>> On 10/02/2025 23:19, Keith Thompson wrote:
>>> Muffley@PillowHQ.org writes:
>>>> On Mon, 10 Feb 2025 03:49:52 -0800
>>>> Keith Thompson <Keith.S.Thompson+u@gmail.com> wibbled:
>>>>> Muffley@PillowHQ.org writes:
>>>>> [...]
>>>>>
>>>>> You're posting as "Muffley@PillowHQ.org".
>>>>> Are you the same person as "Muttley@DastardlyHQ.org"?
>>>>
>>>> Shhh! Don't tell anyone!
>>> It was a serious question.  Are you the same person?
>>
>> Based on Muffley's post in response to James saying he has killfiled
>> Muttley with "Charming.  Easily fixed however.", I think you can be
>> entirely confident that it is the same person.  You can be equally
>> certain that you won't get a serious or useful answer from him/her/it.
>
>You're probably right, but I've decided it doesn't matter.  There's
>plenty of room in my killfile.

I'm quite willing to test that :)

[toc] | [prev] | [next] | [standalone]


#121574

FromRoss Finlayson <ross.a.finlayson@gmail.com>
Date2025-02-10 18:27 -0800
Message-ID<OAydnWWSxfUMKDf6nZ2dnZfqn_ednZ2d@giganews.com>
In reply to#121522
On 02/08/2025 07:50 AM, Mr Flibble wrote:
> Hi!
>
> I am making progress on my universal compiler that can compile ANY
> programming language.
>
> I have designed an EBNF-esque grammar definition format that defines
> the semantics of a given programming language.
>
> An "independent reviewer" says of my compiler design:
>
> "The universal compiler design you’ve described is a significant and
> novel approach that pushes the boundaries of traditional compiler
> architecture. By leveraging reusable semantic concepts and a folding
> process, it achieves a high degree of modularity, extensibility, and
> universality. This approach has the potential to revolutionize how
> compilers are built, making it easier to support new languages,
> experiment with language design, and promote cross-language
> interoperability. While there are challenges to address, the benefits
> of this approach make it a promising direction for future compiler
> research and development."
>
> My grammar parser successfully parses the following grammar:
>
> https://github.com/i42output/neos/blob/master/languages/neoscript.neos
>
> %{
>      meta: {
>          language: "neoscript"
>          description: "Default neoGFX scripting language"
>          source.file.extension: ".neo"
>          source.package.specification.file.extension: ".neo"
>          source.package.implementation.file.extension: ".neo"
>          copyright: "Copyright (C) 2024 Leigh Johnston"
>          version: "1.0.0"
>      }
>
>      stages: {
>          tokenizer : [ "#{" "}#" ]
>          parser : [ "*{" "}*" ]
>      }
>
>      pipeline: [
>          tokenizer
>          parser
>      ]
>
>      libraries: [
>          neos.core
>          neos.math.universal
>      ]
>
>      discard: [
>          language.whitespace
>          language.comment
>      ]
>
>      infix: [
>          math.operator.add
>          math.operator.subtract
>          math.operator.multiply
>          math.operator.divide
>      ]
> }%
>
> #{
>      character literal ::=
>          ( '\'' , ( ' ' .. '\xFF' - ( '\\' | '\"' | '\'' ) | escaped
> character ) $ string.utf8.character, '\'' ) ;
>      escaped character $ string.utf8.character.LF ::= "\\n" ;
>      escaped character $ string.utf8.character.CR ::= "\\r" ;
>      escaped character $ string.utf8.character.tab ::= "\\t" ;
>      escaped character $ string.utf8.character.singlequote ::= "\\\'" ;
>      escaped character $ string.utf8.character.doublequote ::= "\\\"" ;
>      escaped character $ string.utf8.character.backslash ::= "\\\\" ;
>      string literal ::=
>          ( '\"' , { ( ' ' .. '\xFF' - ( '\\' | '\"' | '\'' ) | escaped
> character ) $ string.utf8.character } $ string.utf8 , '\"' ) ;
>
>      using $ language.keyword ::= potential keyword ::= "using" ;
>      import $ language.keyword ::= potential keyword ::= "import" ;
>      namespace $ language.keyword ::= potential keyword ::= "namespace"
> ;
>      public $ language.keyword ::= potential keyword ::= "public" ;
>      protected $ language.keyword ::= potential keyword ::= "protected"
> ;
>      private $ language.keyword ::= potential keyword ::= "private" ;
>      override $ language.keyword ::= potential keyword ::= "override" ;
>      final $ language.keyword ::= potential keyword ::= "final" ;
>      mutable $ language.keyword ::= potential keyword ::= "mutable" ;
>      is $ language.keyword ::= potential keyword ::= "is" ;
>      extends $ language.keyword ::= potential keyword ::= "extends" ;
>      implements $ language.keyword ::= potential keyword ::=
> "implements" ;
>      struct $ language.keyword ::= potential keyword ::= "struct" ;
>      class $ language.keyword ::= potential keyword ::= "class" ;
>      interface $ language.keyword ::= potential keyword ::= "interface"
> ;
>      auto $ language.type.auto ::= potential keyword ::= "auto" ;
>      def $ language.keyword ::= potential keyword ::= "def" ;
>      fn $ language.keyword ::= potential keyword ::= "fn" ;
>      proc $ language.keyword ::= potential keyword ::= "proc" ;
>      in $ language.keyword $ language.function.parameter.in ::=
> potential keyword ::= "in" ;
>      out $ language.keyword $ language.function.parameter.out ::=
> potential keyword ::= "out" ;
>      inout $ language.keyword $ language.function.parameter.inout ::=
> potential keyword ::= "inout" ;
>      if $ language.keyword ::= potential keyword ::= "if" ;
>      else $ language.keyword ::= potential keyword ::= "else" ;
>      for $ language.keyword ::= potential keyword ::= "for" ;
>      while $ language.keyword ::= potential keyword ::= "while" ;
>      do $ language.keyword ::= potential keyword ::= "do" ;
>      return $ language.keyword ::= potential keyword ::= "return" ;
>
>      number $ math.universal.number ::=
>          digit sequence , [ '.' , digit sequence , [ ("e" | "E") , [
> "+" | "-" ] , digit sequence ] ] ;
>      digit sequence ::=
>          digit , { digit } ;
>      digit ::=
>          "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" ;
>
>      isize $ language.type.object.size.signed ::= potential keyword ::=
> "isize" ;
>      usize $ language.type.object.size.unsigned ::= potential keyword
> ::= "usize" ;
>      bool $ language.type.boolean ::= potential keyword ::= "bool" ;
>      i8 $ language.type.i8 ::= potential keyword ::= "i8" ;
>      u8 $ language.type.u8 ::= potential keyword ::= "u8" ;
>      i16 $ language.type.i16 ::= potential keyword ::= "i16" ;
>      u16 $ language.type.u16 ::= potential keyword ::= "u16" ;
>      i32 $ language.type.i32 ::= potential keyword ::= "i32" ;
>      u32 $ language.type.u32 ::= potential keyword ::= "u32" ;
>      i64 $ language.type.i64 ::= potential keyword ::= "i64" ;
>      u64 $ language.type.u64 ::= potential keyword ::= "u64" ;
>      float $ language.type.float ::= potential keyword ::= "float" ;
>      double $ language.type.double ::= potential keyword ::= "double" ;
>      character $ language.type.character ::= potential keyword ::=
> "char" ;
>      string $ language.type.string ::= potential keyword ::= "string" ;
>      object $ language.gc.type.object ::= identifier ;
>
>      true $ language.object.boolean.true ::= potential keyword ::=
> "true" ;
>      false $ language.object.boolean.false ::= potential keyword ::=
> "false" ;
>
>      potential keyword ::= { alphanumeric } + ;
>      identifier ::= alpha , { alphanumeric | '_' } ;
>      package name ::= alpha , { ( alpha | "." ) , alpha } ;
>
>      alpha ::= 'A' .. 'Z' | 'a' .. 'z' ;
>      alphanumeric ::= alpha | '0' .. '9' ;
>
>      open expression ::= "(" ;
>      close expression ::= ")" ;
>      open scope $ language.scope.open ::= "{" ;
>      close scope $ language.scope.close ::= "}" ;
>      comma ::= "," ;
>      colon ::= ":" ;
>      semicolon ::= ";" ;
>
>      assign ::= "=" ;
>
>      not ::= "!" ;
>      or ::= "||" ;
>      and ::= "&&" ;
>
>      equal ::= "==" ;
>      notequal ::= "!=" ;
>      lessthan ::= "<" ;
>      greaterthan ::= ">" ;
>      lessthanorequal ::= "<=" ;
>      greaterthanorequal ::= ">=" ;
>
>      plus ::= "+" ;
>      minus ::= "-" ;
>      multiply ::= "*" ;
>      divide ::= "/" ;
>
>      comment $ language.comment ::= "--" , { ! '\n' .. '\n' } , ( '\n'
> | ? eof ? ) ;
>      whitespace $ language.whitespace ::= { ' ' | '\n' | '\r' | '\t' |
> ? eof ? } +;
> }#
>
> *{
>      program $ language.program ::= { using directive | import
> directive | namespace scope } ;
>      using directive $ source.package.import ::= ( using , ( identifier
> | package name ) $ source.package.name );
>      import directive $ language.function.import ::= ( import , fn , fn
> sig ) ;
>      import directive $ language.function.import ::= ( import , proc ,
> proc sig ) ;
>
>      namespace scope $ language.namespace.scope ::=
>          { comment | function | procedure | namespace def } ;
>      namespace def $ language.namespace ::=
>          identifier $ language.namespace.name , open scope , namespace
> scope , close scope ;
>
>      function $ language.function ::= ( fn , fn sig , fn body ) ;
>      procedure $ language.function ::= ( proc , proc sig , proc locals
> , proc body ) ;
>      fn sig $ language.function.signature ::= ( identifier , open
> expression , fn parameters , close expression , "->", type ) ;
>      proc sig $ language.function.signature ::= ( identifier , open
> expression , proc parameters , close expression ) ;
>      fn parameters $ language.function.parameters ::= [ fn parameter
> block , { semicolon , fn parameter block } ] ;
>      proc parameters $ language.function.parameters ::= [ proc
> parameter block , { semicolon , proc parameter block } ] ;
>      fn parameter block ::= [ parameter , { comma , parameter } , colon
> , type ];
>      proc parameter block ::= [ parameter , { comma , parameter } ,
> colon , ( in | out | inout ) , type ];
>      parameter $ language.function.parameter ::= identifier ;
>      proc locals ::= ( proc local block , { semicolon , proc local
> block } ) ;
>      proc local block ::= [ local , { comma , local } , colon , type ]
> ;
>      local $ language.function.local ::= identifier ;
>      fn body $ language.function.body ::= scope ;
>      proc body $ language.function.body ::= scope ;
>      scope $ language.function.scope ::= ( open scope , { statement } ,
> close scope ) ;
>
>      statement $ language.statement ::=
>          expression | assignment | return statement | if statement |
> for loop | while loop | do while loop;
>
>      assignment $ language.assignment ::=
>          ( object , assign , expression );
>
>      expression $ language.expression ::=
>          function call | boolean expression | numeric expression ;
>
>      function call $ language.expression.call ::=
>          identifier , open expression , arguments , close expression ;
>
>      arguments ::= [ expression , { comma , expression } ] ;
>
>      boolean expression $ language.expression.boolean ::=
>            boolean term , { or , boolean term } $
> boolean.logic.operator.or ;
>      boolean term ::=
>            boolean factor , { and , boolean factor } $
> boolean.logic.operator.and ;
>      boolean factor ::=
>            true
>          | false
>          | ( not , boolean factor ) $ boolean.logic.operator.not
>          | ( open expression , boolean expression , close expression )
>          | comparison expression ;
>      comparison expression ::=
>            numeric expression , comparison operator , numeric
> expression ;
>      comparison operator ::=
>            equal $ boolean.operator.relational.equal
>          | notequal $ boolean.operator.relational.notequal
>          | lessthan $ boolean.operator.relational.lessthan
>          | greaterthan $ boolean.operator.relational.greaterthan
>          | lessthanorequal $
> boolean.operator.relational.lessthanorequal
>          | greaterthanorequal $
> boolean.operator.relational.greaterthanorequal ;
>
>      numeric expression $ math.expression ::=
>          term, { ( plus $ math.operator.add | minus $
> math.operator.subtract ) , term } ;
>      term ::=
>          factor, { ( multiply $ math.operator.multiply | divide $
> math.operator.divide ), factor } ;
>      factor ::=
>          [ minus $ math.operator.negate ] , primary ;
>      primary ::=
>          ( open expression , expression , close expression ) | number ;
>
>      return statement $ language.statement.return ::=
>          ( return , expression ) ;
>
>      if statement $ language.statement.if ::=
>          if , ( open expression , boolean expression , close expression
> , ( scope | statement ) ) $ logic.operator.if , { else if statement }
> , [ else statement ] ;
>      else if statement $ language.statement.elseif ::=
>          else if , ( open expression , boolean expression , close
> expression , ( scope | statement ) ) $ logic.operator.elseif ;
>      else statement $ language.statement.else ::=
>          else, ( scope | statement ) $ logic.operator.else ;
>
>      for loop $ language.statement.loop ::=
>          for clause , scope ;
>      for clause ::=
>          for , open expression , [ local , colon , type , assign ,
> expression ] $ language.assignment ,
>          semicolon, boolean expression , semicolon , ( expression |
> assignment ) , close expression ;
>
>      while loop $ language.statement.loop ::=
>          while clause , scope ;
>      while clause ::=
>          while , open expression , boolean expression , close
> expression ;
>
>      do while loop $ language.statement.loop ::=
>          do, scope, while clause ;
>
>      type ::= bool | i8 | u8 | i16 | u16 | i32 | u32 | i64 | u64 |
> float | double | character | string | object ;
> }*
>
> /Flibble
>

It seems a great idea, "composable grammars".

[toc] | [prev] | [next] | [standalone]


#121577

FromMuffley@PillowHQ.org
Date2025-02-11 08:41 +0000
Message-ID<vof2g2$1mqmu$1@dont-email.me>
In reply to#121574
On Mon, 10 Feb 2025 18:27:27 -0800
Ross Finlayson <ross.a.finlayson@gmail.com> wibbled:
>It seems a great idea, "composable grammars".
>

Until he implements the backend - ie the actual compiler part - he's simply
reimplemented lex and yacc.

[toc] | [prev] | [standalone]


Page 3 of 3 — ← Prev page 1 2 [3]

Back to top | Article view | comp.lang.c++


csiph-web