unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* on using 8cc in reproducible bootstrap process
@ 2017-06-18 13:52 Jan Nieuwenhuizen
  2017-06-18 14:53 ` Mike Gran
  2017-06-18 22:39 ` Rui Ueyama
  0 siblings, 2 replies; 3+ messages in thread
From: Jan Nieuwenhuizen @ 2017-06-18 13:52 UTC (permalink / raw)
  To: rui314; +Cc: guile-user

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

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 <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: on using 8cc in reproducible bootstrap process
  2017-06-18 13:52 on using 8cc in reproducible bootstrap process Jan Nieuwenhuizen
@ 2017-06-18 14:53 ` Mike Gran
  2017-06-18 22:39 ` Rui Ueyama
  1 sibling, 0 replies; 3+ messages in thread
From: Mike Gran @ 2017-06-18 14:53 UTC (permalink / raw)
  To: Jan Nieuwenhuizen; +Cc: guile-user

On Sun, Jun 18, 2017 at 03:52:23PM +0200, Jan Nieuwenhuizen wrote:
> Hi!
> 
> 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].

> 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)?

For what it is worth, the hacker ragge and the OpenBSD community spent
some time a couple of years ago getting the old PCC Porable C Compiler
back up and running.  Because it is based on a much older program, it
may not have these new features with which you are struggling.

http://pcc.ludd.ltu.se/

-Mike Gran



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: on using 8cc in reproducible bootstrap process
  2017-06-18 13:52 on using 8cc in reproducible bootstrap process Jan Nieuwenhuizen
  2017-06-18 14:53 ` Mike Gran
@ 2017-06-18 22:39 ` Rui Ueyama
  1 sibling, 0 replies; 3+ messages in thread
From: Rui Ueyama @ 2017-06-18 22:39 UTC (permalink / raw)
  To: Jan Nieuwenhuizen; +Cc: guile-user

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 <janneke@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 <janneke@gnu.org> | GNU LilyPond http://lilypond.org
> Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com
>


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-06-18 22:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-18 13:52 on using 8cc in reproducible bootstrap process Jan Nieuwenhuizen
2017-06-18 14:53 ` Mike Gran
2017-06-18 22:39 ` Rui Ueyama

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).