Hi Jan, Thank you for your interest in 8cc. 8cc is indeed a C compiler that supports most C11 features. However, I don't think it is being used seriously by anyone, so honestly I'd doubt it is a good choice to be used as part of your bootstrapping process. tcc have been much more tested.
The most interesting use of 8cc is to write a C++11 constexpr compile-time C compiler <https://github.com/kw-udon/constexpr-8cc> which is built on top of ELVM <https://github.com/shinh/elvm>, but that is still a toy program. On Sun, Jun 18, 2017 at 6:52 AM, Jan Nieuwenhuizen <jann...@gnu.org> wrote: > Hi! > > I am working to create a full source bootstrap path for GuixSD[0]. I > have written Mes[1] a mutual self-hosting Scheme interpreter prototype > in C and a C compiler (Mescc) in Scheme. > > The prototype Scheme interpreter in C will be redone in stage0's hex2[2] > at an opportune moment which will give us a real simple C compiler > (Mescc) that does not depend on any binary. > > The next leap forward is to compile gcc. I have been looking at > compiling Tinycc[3]. A couple of weeks ago, rain1 has been working with > the tcc developers to succeed in compiling gcc using tcc[4]. > > However, tcc uses many esoteric language features which makes > bootstrapping using tcc pretty [unnecessarily?] difficult. > > That is why I was happily surprised to read about 8cc's advertised > bootstrappability > > 8cc is a compiler for the C programming language. It's intended to > support all C11 language features while keeping the code as small > and simple as possible. > > However, I'm currently stuck on 8cc's use of anonymous unions and 8cc's > anonymous structs in unions. To me, as a fresh C compiler writer, those > are pretty esoteric language features too. The idea of having to > implement those discourages me a bit. > > Do you think 8cc should be used in my efforts to create a full source > bootstrap path (rather than tinycc, or as a stepping stone to tcc)? > > If so, I can think of two strategies > > 1) a. implement anonymous unions in Mescc > b. implement anonymous structs (inside anonymous unions) in Mescc > 2) remove anonymous unions and structs from 8cc > That said, I don't think anonymous structs/unions are not that tricky. It shouldn't be hard to support the feature. If it is the only missing feature in your compiler, you might want to add that. > > which one would you advise, or do you have a better alternative? Should > I 1) learn about anonymous structs and make Mescc richer, or would you > like to (help and) take patches for 2)? > > Greetings, > janneke > > [0] https://gnu.org/s/guix > [1] https://gitlab.com/janneke/mes > [2] https://github.com/oriansj/stage0 > [3] https://bellard.org/tcc/ > [4] http://lists.nongnu.org/archive/html/tinycc-devel/ > 2017-05/msg00103.html > > -- > Jan Nieuwenhuizen <jann...@gnu.org> | GNU LilyPond http://lilypond.org > Freelance IT http://JoyofSource.com | AvatarĀ® http://AvatarAcademy.com >