Deutsch English Français Italiano |
<vi7grj$2pvf$2@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: question about linker Date: Wed, 27 Nov 2024 13:20:02 -0300 Organization: A noiseless patient Spider Lines: 77 Message-ID: <vi7grj$2pvf$2@dont-email.me> References: <vi54e9$3ie0o$1@dont-email.me> <vi56hi$3ie0o$2@dont-email.me> <vi57bh$3ip1o$2@dont-email.me> <vi58ba$3ie0o$4@dont-email.me> <vi6q77$3umr3$1@dont-email.me> <vi6tm3$3ve13$1@dont-email.me> <vi7cin$25vc$1@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Wed, 27 Nov 2024 17:20:03 +0100 (CET) Injection-Info: dont-email.me; posting-host="55a7253bc8aad96d55ac3768212cd6ac"; logging-data="92143"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19q1WGua2MAUIfF9/dVVPlAJQNt5ZJxcYo=" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:I4kFNV8g4HPb0l+0na8E0uN3HOQ= Content-Language: en-US In-Reply-To: <vi7cin$25vc$1@dont-email.me> Bytes: 3965 On 27/11/2024 12:07, David Brown wrote: > On 27/11/2024 11:52, Thiago Adams wrote: >> On 27/11/2024 06:53, David Brown wrote: > >> >> Thanks for the comments. Very useful. >> > > If they are of help to you, then that's great. It is not always easy to > know what will be useful. > >>> >>> I am not all sure why you are generating code C90 code here. I don't >>> think anyone much cares about using strict C90 other than a couple of >>> people in this newsgroup. >> >> The objective is to leave all complications to a front end, and write >> a simpler C89 code that is used by the backend. >> >> The advantage, comparing with a custom IL, is that the code will works >> in any C compiler. >> > > I think if we can understand what you are trying to do, and why, it will > be easier to help. (I say "we" - maybe I'm the only one that doesn't > understand. But hopefully I'm not the only one that is happy to give > comments that might be useful!) > > Are you trying to make your own C compiler here, divided into two parts? Yes. I already have experience in front end, and no experience in backend. > If so, why? What's the motivation - what will make this compiler > different from others? I hope to have a first class front end, with static analysis. My expectation for the backend are low at this point, it is more to understand better how everything works. So here is the advantage of using C as output (as IL). It can be compiled by any C compiler. > As an IL, this limited C would be very poor in > terms of good code generation, static error checking, or debugging. I think for debugger it is will good. We can see the generated code, we can have break points etc. > It > could be fairly portable, but I think would lose the platform or > compiler specific features that are often useful for real programs and > libraries. This output will be for "direct consumption" my compiler -> C89 -> CC It is header, platform and settings dependent since it is preprocessed. But my front end also have the non-preprocessed mode - http://thradams.com/cake/playground.html The problem with the other mode is that it functions as code editing. The process of generating this 'edit' is completely different from generating code for an intermediate language (IL). So, I am creating a new mode where I generate code instead of editing it. I believe this approach is similar to what a typical compiler does. > (Of course, fun, learning and your own interest is always perfectly good > motivation as far as I am concerned.) > This is the backend motivation! The front end is to have fun and to use it in my own C code as static analyzer and I hope more people could use it.