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


Groups > comp.lang.c > #167522

Re: Cake - C23 to C99 transpiler

From Bart <bc@freeuk.com>
Newsgroups comp.lang.c
Subject Re: Cake - C23 to C99 transpiler
Date 2022-09-07 15:35 +0100
Organization Aioe.org NNTP Server
Message-ID <tfaa7f$qcg$1@gioia.aioe.org> (permalink)
References <bd1af6b7-a632-41d7-88de-7f89e67115d4n@googlegroups.com> <tf6qfq$3ri7i$6@dont-email.me> <aac059b9-a9b3-4365-8c94-0c39102798cen@googlegroups.com> <tf9v6j$7gjv$1@dont-email.me> <836c6515-87f5-42b2-98b0-8308173a9120n@googlegroups.com>

Show all headers | View raw


On 07/09/2022 13:45, Thiago Adams wrote:
> On Wednesday, September 7, 2022 at 8:27:30 AM UTC-3, Vir Campestris wrote:
>> On 06/09/2022 18:08, Thiago Adams wrote:
>>> I need to choose a backend now.
>> If your intent is to produce C99 shouldn't you be testing against every
>> compiler you can get your hands on, rather than picking one?
> 
> Here "I need to choose a backend now." I was talking about
> a x86 or intermediate backend or create a interpreter.
> 
> But choosing a compiler target for C.. yes it also is possible.
> Some features may exist (like thread storage) and be different
> depending on the compiler . So choosing the target compiler the
> generator could generate code for that specific feature.

The Seed7 language, if you were to build it from C sources, comes with 
nearly 20 different makefiles for different compilers and platforms.

There's also a configure program which creates and runs some 100 
different test programs to collate information about the C 
implementation, resulting in a configuration header file describing the 
environment.

Since Seed7 also uses C as a target language, I can't remember if that 
config file was for the compiler, or compiling the generated C 
intermediates, or both.

Use C as a target is not that simple!

When I used to target C, I produced a single C source for the entire 
program, but there were three versions, since it didn't have conditional 
elements:

    * For Windows
    * For Linux
    * For a Neutral OS (runs on either but with limitations)

I think also the code assumed a 64-bit implementation; a 32-bit target, 
if I was to still bother with it, would need separate versions.

I used to try and support half a dozen C compilers, which was hard as 
they all had different limitations. Now I support only tcc and gcc.

No special options are required (other than ones like -O2 and -o for 
gcc), and no special extensions (a few things expected to be in C99 like 
anonymous structs and unions).

The main limitation of tcc (a significant one for me) is that it doesn't 
support '$' in identifiers; most C compilers do. Which means taking 
account of that in code generators.

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


Thread

Cake -  C23 to C99 transpiler Thiago Adams <thiago.adams@gmail.com> - 2022-08-18 18:44 -0700
  Re: Cake - C23 to C99 transpiler Blue-Maned_Hawk <bluemanedhawk@example.invalid> - 2022-09-06 02:48 -0400
    Re: Cake - C23 to C99 transpiler Thiago Adams <thiago.adams@gmail.com> - 2022-09-06 10:08 -0700
      Re: Cake - C23 to C99 transpiler Vir Campestris <vir.campestris@invalid.invalid> - 2022-09-07 12:27 +0100
        Re: Cake - C23 to C99 transpiler Thiago Adams <thiago.adams@gmail.com> - 2022-09-07 05:45 -0700
          Re: Cake - C23 to C99 transpiler Bart <bc@freeuk.com> - 2022-09-07 15:35 +0100
            Re: Cake - C23 to C99 transpiler Ben Bacarisse <ben.usenet@bsb.me.uk> - 2022-09-07 16:38 +0100
              Re: Cake - C23 to C99 transpiler Bart <bc@freeuk.com> - 2022-09-07 17:04 +0100
                Re: Cake - C23 to C99 transpiler Anton Shepelev <anton.txt@g{oogle}mail.com> - 2022-09-07 19:14 +0300
                Re: Cake - C23 to C99 transpiler Ben Bacarisse <ben.usenet@bsb.me.uk> - 2022-09-07 17:31 +0100
                Re: Cake - C23 to C99 transpiler Bart <bc@freeuk.com> - 2022-09-07 17:40 +0100
                Re: Cake - C23 to C99 transpiler Ben Bacarisse <ben.usenet@bsb.me.uk> - 2022-09-07 17:49 +0100
                Re: Cake - C23 to C99 transpiler Bart <bc@freeuk.com> - 2022-09-07 19:27 +0100
                Re: Cake - C23 to C99 transpiler Ben Bacarisse <ben.usenet@bsb.me.uk> - 2022-09-07 20:02 +0100
                Re: Cake - C23 to C99 transpiler Bart <bc@freeuk.com> - 2022-09-07 21:03 +0100
                Re: Cake - C23 to C99 transpiler Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2022-09-07 13:52 -0700
                Re: Cake - C23 to C99 transpiler Tim Rentsch <tr.17687@z991.linuxsc.com> - 2022-09-14 07:14 -0700
                Re: Cake - C23 to C99 transpiler Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2022-09-14 10:59 -0700
                Re: Cake - C23 to C99 transpiler Tim Rentsch <tr.17687@z991.linuxsc.com> - 2022-09-15 23:46 -0700
                Re: Cake - C23 to C99 transpiler David Brown <david.brown@hesbynett.no> - 2022-09-07 20:17 +0200
                Re: Cake - C23 to C99 transpiler Ben Bacarisse <ben.usenet@bsb.me.uk> - 2022-09-07 19:58 +0100
                Re: Cake - C23 to C99 transpiler Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2022-09-07 13:26 -0700
                Re: Cake - C23 to C99 transpiler Ben Bacarisse <ben.usenet@bsb.me.uk> - 2022-09-07 23:42 +0100
                Re: Cake - C23 to C99 transpiler Tim Rentsch <tr.17687@z991.linuxsc.com> - 2022-09-14 06:45 -0700
                Re: Cake - C23 to C99 transpiler Tim Rentsch <tr.17687@z991.linuxsc.com> - 2022-09-14 06:40 -0700
                Re: Cake - C23 to C99 transpiler Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2022-09-07 10:28 -0700
                Re: Cake - C23 to C99 transpiler David Brown <david.brown@hesbynett.no> - 2022-09-07 20:05 +0200
            Re: Cake - C23 to C99 transpiler Thiago Adams <thiago.adams@gmail.com> - 2022-09-07 15:28 -0700
              Re: Cake - C23 to C99 transpiler Bart <bc@freeuk.com> - 2022-09-08 00:51 +0100
                Re: Cake - C23 to C99 transpiler Thiago Adams <thiago.adams@gmail.com> - 2022-09-08 05:20 -0700
                Re: Cake - C23 to C99 transpiler Bart <bc@freeuk.com> - 2022-09-08 16:41 +0100
                Re: Cake - C23 to C99 transpiler scott@slp53.sl.home (Scott Lurndal) - 2022-09-08 16:43 +0000
                Re: Cake - C23 to C99 transpiler Bart <bc@freeuk.com> - 2022-09-08 19:23 +0100
                Re: Cake - C23 to C99 transpiler Thiago Adams <thiago.adams@gmail.com> - 2022-09-08 09:59 -0700

csiph-web