Deutsch   English   Français   Italiano  
<vjmh5l$hhg1$4@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Thiago Adams <thiago.adams@gmail.com>
Newsgroups: comp.lang.c
Subject: Re: transpiling to low level C
Date: Sun, 15 Dec 2024 09:13:41 -0300
Organization: A noiseless patient Spider
Lines: 45
Message-ID: <vjmh5l$hhg1$4@dont-email.me>
References: <vjlh19$8j4k$1@dont-email.me> <vjmehc$hnkg$1@dont-email.me>
 <vjmfht$hhg1$3@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 15 Dec 2024 13:13:42 +0100 (CET)
Injection-Info: dont-email.me; posting-host="75cbf010cfc8fccc260a6c4cc0d7f911";
	logging-data="574977"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX19xmqycqsNWBenXEtC2GVbwhvcdMN65wYg="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:1Nw0eQSXUAsF7i5yeTj78bzk/Js=
In-Reply-To: <vjmfht$hhg1$3@dont-email.me>
Content-Language: en-GB
Bytes: 2439

Em 12/15/2024 8:46 AM, Thiago Adams escreveu:
> Em 12/15/2024 8:28 AM, bart escreveu:
>> On 15/12/2024 03:05, Thiago Adams wrote:
>>>
>>> I am working on a C backend that generates simple C code.
>>>
>>> You can test it here:
>>> http://thradams.com/cake/playground.html
>>>
>>> Objective
>>> - Shift all the complexity of the C compiler to the frontend.
>>>    Why? This approach simplifies having one frontend and multiple 
>>> backends.
>>> - Use C as an intermediate language to feed a backend (any C compiler 
>>> can act as the backend).
>>>    The backend can then focus solely on code generation.
>>> - Code is not portable
>>>
>>> Removed C89 Features
>>> - Preprocessor
>>> - sizeof
>>
>> If I try:
>>
>>      printf("%zu\n", sizeof(void*));
>>
>> it turns into:
>>
>>      printf("%zu\n", 4U);
>>
>> Presumably this translator will only target 32-bit systems even if run 
>> on a 64-bit one?
>>
> 
> It will have to be configured to x86 or x64. It has to match the target/ 
> platform compiler settings. The online versions is emulating something. 
> I think x86 gcc on linux.
> 
Th
Obs:
The platform windows\linux makes difference in the size of wchar_t L'a' 
also on sizes of long etc.. In practice the result is assuming fixed 
sizes. I may add at the end of generated code the assumptions . It can 
be in a static_assert form.