From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Rui Ueyama Newsgroups: gmane.lisp.guile.user Subject: Re: on using 8cc in reproducible bootstrap process Date: Sun, 18 Jun 2017 15:39:38 -0700 Message-ID: References: <87d1a1csiw.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1497855398 21195 195.159.176.226 (19 Jun 2017 06:56:38 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 19 Jun 2017 06:56:38 +0000 (UTC) Cc: guile-user@gnu.org To: Jan Nieuwenhuizen Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Mon Jun 19 08:56:34 2017 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dMqbu-000540-Ea for guile-user@m.gmane.org; Mon, 19 Jun 2017 08:56:30 +0200 Original-Received: from localhost ([::1]:40877 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dMqbz-0003HW-F5 for guile-user@m.gmane.org; Mon, 19 Jun 2017 02:56:35 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42037) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dMirV-00035W-Q6 for guile-user@gnu.org; Sun, 18 Jun 2017 18:40:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dMirU-00038W-FL for guile-user@gnu.org; Sun, 18 Jun 2017 18:40:05 -0400 Original-Received: from mail-ot0-x22d.google.com ([2607:f8b0:4003:c0f::22d]:32981) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dMirR-00036J-OT; Sun, 18 Jun 2017 18:40:01 -0400 Original-Received: by mail-ot0-x22d.google.com with SMTP id y47so35212606oty.0; Sun, 18 Jun 2017 15:40:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=RcZNwr7NsacdgmDgGnt3LnxSKfKQaiNfVYJ9CaJzwZ4=; b=UuL8FRuXH/mTthJXvrs8/m0i1rtKJldyhJSUpIuUnVMheu2QzbZYtZixxHw1jTyud4 vRE0F4C20X9x2RP7lPUv5zZVA5r2t1VG/+ozy7lYK8bivieH8bAPTGFqsItEnJWXzUSK 2Ncw+wW8XU+XXzTXQYzu0ogV+57h1oUIaf1QtWsaY06ZnnhxBETozte0gl+lTF04v99f 8iqGnYjbYNrMkuWftnjLf1EHFtlQzJGN/UGMc0NdSByZhLvx/McvTZXYE4s/LlOmsgeh wI15lczd6JcyFhhwpN9BdzLknSncueTQ1Lj9BYaayYyO4EDl+aFtKWxRvBG5SaMui0Ka AMvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=RcZNwr7NsacdgmDgGnt3LnxSKfKQaiNfVYJ9CaJzwZ4=; b=dp4Weiilpi6POhpkoEm0YsKMzA96t6yICcOusmDcgjUNElgRXJrCUt8bSO1aYEMR2y +0q23yxDr8KnPxYFDo+PsGSgzTnt6rQkxnxp2GSo8TbvOZO+z+MRIbR12mAl0uz9VaCK 791jidhTL6mrzFc27OKbGNSrqT8ygepDCL7/wRjN/zZivUuMf3R+NwRc4Plh7tiJaD+z +U3EbPF2VzFI//m5WeVlAQknN0NuHWN0uS5m3D72sEMo76SlxZLTGRWYQso7qiFeiHZ9 k8Y08qMXrTDkfI3bne+Dyr7vRIhM2bP4/h7DDxQB0dMjmWoOMqS/FV33d9bWULlWjRRa 7FDA== X-Gm-Message-State: AKS2vOzMDvSxrQub/tKKiOfOVSHO00pAW4+UkGrqEjJSXV+SZIs5eeB3 pBkRgnTy+HTYEofmsJLcFc9FjhM6CsZMgrs= X-Received: by 10.157.63.196 with SMTP id i4mr10242477ote.231.1497825599126; Sun, 18 Jun 2017 15:39:59 -0700 (PDT) Original-Received: by 10.202.169.21 with HTTP; Sun, 18 Jun 2017 15:39:38 -0700 (PDT) In-Reply-To: <87d1a1csiw.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4003:c0f::22d X-Mailman-Approved-At: Mon, 19 Jun 2017 02:55:00 -0400 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.org gmane.lisp.guile.user:13851 Archived-At: 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 which is built on top of ELVM , but that is still a toy program. On Sun, Jun 18, 2017 at 6:52 AM, Jan Nieuwenhuizen 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 | GNU LilyPond http://lilypond.org > Freelance IT http://JoyofSource.com | Avatar=C2=AE http://AvatarAcademy.c= om >