[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] Consensus: Big change to TCC code, need everyone's ag

From: uso ewin
Subject: Re: [Tinycc-devel] Consensus: Big change to TCC code, need everyone's agreement for PR
Date: Thu, 5 Jul 2018 18:46:14 +0200

On Thu, Jul 5, 2018 at 5:31 AM, Steve Fan <address@hidden> wrote:
> Hi,
> So I'm working on TinyCC to make it somewhat usable in the modern era,
Here you are doing some kind of Appeal to novelty,
I don't see the point of it.

> here's the list of thing I did, all of them are huge changes.
> 1. Formatted the code to use 4-space-indent, K&R bracket style
>    -> This is very big, as it breaks all WIP PRs
Well tcc already use 4 space indent, but there is some trailing white-space and
sometime it's a mix of tab and space,
so maybe a start would be to remove trailing white-space and
uniformise indentations,
But I don't know if peoples here will be happy with patches that
change nothing but style.

> 2. No more global code, finishing what Bellard wished to do for a long time
>    -> All states are stuffed in TCCState with their corresponding name
>    -> Yes, it should be fully reentrant now
>    -> Yet also comes with a caveat to using more memory (~80k in sizeof now
> according to MSVC)

I'm a little sceptical about this, I like the way TCC keep it's code simple,
moving everything into TCCState will make a lot more code
without adding much features.

I don't really see the point of reentrancy in TCC, if your goal is
thread safety,
can't you just put all global variables in thread local storages
(which could be enable/disable at compile time) ?

I guess you can share your code on github(or another repository)
so we can judge.

> 3. More C90 code
>    -> Anonymous struct/"struct { ... } foo;" as I separated the global
> states to namespaces
>    ->  !! TinyCC might not be self-bootstrappable after this

I don't understand that,
we are already using unnamed struct/union fields(in Sym in tcc.h),
and tcc already support unnamed union and struct.
BTW Anonymous struct is C11 not C90

> 4. Codegen virtualization (not started yet)
>    -> This is a great idea in mind, as we could finally cross-compile in one
> centralized binary, but the codegen currently copulates with a lot of
> cancerous implementation defined macros, so I need to fully separate the
> damning macros first.
> Anaƫl Seghezzi also had worked on similar things I did
> (https://github.com/anael-seghezzi/tcc-0.9.26), but he did it for his CToy
> environment anyway and the base version he dealt with is outdated, and I
> guess he never asked for the same PR I guess? My work is fully independent
> until I googled it in what I already did most so far.
> Nevertheless, I always wanted reentrant code on mainstream TinyCC, perhaps
> the next version 0.9.27 could have it :)
> Another reason I did this is for experiments with the MJIT library from
> Vladimir Makarov for Ruby
> (https://github.com/vnmakarov/ruby/tree/rtl_mjit_branch#mjit-organization),
> it uses C code as an intermediate representation, very interesting idea and
> I believe MJIT and TinyCC can make a match in the heaven.
> Also, I want to advocate on moving TinyCC to GitHub, the owner should be the
> one still active here or I can take the place :P because
> http://repo.or.cz/tinycc.git is not well indexed in Google and so people
> spammed different versions of TCC on top of that, it is not cool to see
> http://repo.or.cz/tinycc.git in the middle of google search result while an
> old branch from LuaJIT is on the top.
> But y'know, I could always fork TinyCC and separate the code from the
> mainstream. However, I hate to merge git commits (as I'm, unfortunately, a
> git-retard), so now I need all past contributors to vote for these changes:
> if you had time, just put a yay or nay on this thread, thanks.
> Steve the student.
> _______________________________________________
> Tinycc-devel mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/tinycc-devel

reply via email to

[Prev in Thread] Current Thread [Next in Thread]