Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #22280

Re: are forthers still unimpressed with go lang?

From "Rod Pemberton" <do_not_have@notemailnotq.cpm>
Newsgroups comp.lang.forth
Subject Re: are forthers still unimpressed with go lang?
Date 2013-05-05 00:51 -0400
Organization Aioe.org NNTP Server
Message-ID <km4oal$ro0$1@speranza.aioe.org> (permalink)
References (1 earlier) <klr03f$isv$1@speranza.aioe.org> <_b-dnTif5YYWsxzMnZ2dnUVZ_qidnZ2d@supernews.com> <72351a29-1334-4832-86ff-92186fdf0ef4@tz3g2000pbb.googlegroups.com> <km158i$3lv$1@speranza.aioe.org> <S-6dncHYyamWohnMnZ2dnUVZ_smdnZ2d@supernews.com>

Show all headers | View raw


"Andrew Haley" <andrew29@littlepinkcloud.invalid> wrote in message
news:S-6dncHYyamWohnMnZ2dnUVZ_smdnZ2d@supernews.com...
> Rod Pemberton <do_not_have@notemailnotq.cpm> wrote:
> > "Hugh Aguilar" <hughaguilar96@yahoo.com> wrote in message
news:72351a29-1334-4832-86ff-92186fdf0ef4@tz3g2000pbb.googlegroups.com...
> >> On May 1, 8:02 am, Andrew Haley
> > <andre...@littlepinkcloud.invalid>
> >> wrote:
> >> > Rod Pemberton <do_not_h...@notemailnotq.cpm> wrote:
...

> >> > > Go is one just more example of a language that is
> >> > > compiled to C,
> >> >
> >> > No it's not. There's a real GCC front end for it. It
> >> > doesn't get compiled into C.
> >
> > It does.
>
> No, it doesn't.
>

Does too.

> > It was done once but manually for all the syntax of a
> > language.  One can't create a GCC front-end without doing so.
>
> One certainly can.  What does "It was done once but manually for
> all the syntax of a language" mean?

Each piece of unique language syntax for Go is manually, i.e., by
a person, converted to C.

> Do you have any idea what a compiler
> front end does?
>

Absolutely, I've written a half-dozen or so from scratch, so they
don't follow standard techniques...  I've also written a Forth
interpreter in C from scratch using the historical methods.
Oddly, that uses many of the standard Computer Science techniques,
but simplified, and given weird non-Computer Science
terminology...  I've also used flex and bison for full ISO C front
end.  But, you should've known that from my description below
involving ASTs, etc.

> > It really doesn't matter whether you look at the high-level
> > overview, i.e., compiles into C, or you switch topics to the
> > actual low-level implementation specific details.  The result
> > and process is the same or nearly so.  The code is parsed and
> > represented as either C or a representation of C.  To do that,
> > at some point it was converted to C, even if that was only
> > once.
> >
> > In the high-level perspective, the Go code goes through this
> > process (basically):
> >
> >  Go -> emitted as C
>
> No.  There is a GCC front end for go.  It does not get converted
> into C.
>

Either way, the code is or was converted to C or a internal
representation of C.

> > With -O1, -O2, and -O3 optimization, the code is roughly 90%,
> > 95%, 99% the same.  The only real difference is whether there
> > is a file of actual emitted C code or not.
>
> Indeed, that is the difference.

Indeed, that is one difference.

Either way, the code is or was converted to C or a internal
representation of C.

> > In both cases, the Go code is still converted to C, and is
> > still represented as C.  Why?  Because, the AST for GCC
> > was designed to represent C code.  I.e., to write a Go front
> > end for C one converts the Go code into equivalent C code
> > for all the syntactic elements of Go.  Next, the equivalent
> > C code for Go is parsed by GCC's C front end.
>
> No, that's not right.

Yes, it is.  Well, that's the 2nd easiest way.  The 1st easiest
way is to emit C code directly.  You don't have to code a front
end then.  They could've done it the really hard way and chose to
have not do either...  But, that'd be pointless.

> The C front end does not get called; it is not
> involved in any way.

You're correct.  However, I didn't say that here for this case.  I
said that for the other case.  So, please, re-read.

> The go code is parsed and compiled straight into GCC trees.

Well, that's what was said here.  Please, read more carefully.

> > This is where they tell you GCC only handles an AST for C, but
> > that it can be used for similar languages, i.e., those
> > compileable to C...
> > http://gcc.gnu.org/onlinedocs/gccint/Languages.html#Languages
>
> Which doesn't say what you think it says.
>

Read the first sentence.

If it doesn't say that, what does it say?

> > AIR, I provide proof to you (and others here) that nearly all
> > languages are or have been compiled to C, and all major
> > languages of use today are C derivatives (currently, over
> > 61%).
>
> That may be what you recall; it's not what anyone else recalls.
>

Well, I did so.  The fact that no one else recalls that is not my
problem.  It's theirs and yours.  It's there in c.l.f. archives.
Actually, both are there a number of times in response to
different people at different times.  Feel free to look them up if
you think otherwise.


Rod Pemberton


Back to comp.lang.forth | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

are forthers still unimpressed with go lang? the_gavino_himself <visphatesjava@gmail.com> - 2013-04-30 15:12 -0700
  Re: are forthers still unimpressed with go lang? Hugh Aguilar <hughaguilar96@yahoo.com> - 2013-04-30 20:52 -0700
    Re: are forthers still unimpressed with go lang? the_gavino_himself <visphatesjava@gmail.com> - 2013-05-03 15:59 -0700
  Re: are forthers still unimpressed with go lang? "Rod Pemberton" <do_not_have@notemailnotq.cpm> - 2013-05-01 08:02 -0400
    Re: are forthers still unimpressed with go lang? Mark Wills <forthfreak@gmail.com> - 2013-05-01 05:33 -0700
    Re: are forthers still unimpressed with go lang? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-05-01 10:02 -0500
      Re: are forthers still unimpressed with go lang? Hugh Aguilar <hughaguilar96@yahoo.com> - 2013-05-01 15:28 -0700
        Re: are forthers still unimpressed with go lang? "Rod Pemberton" <do_not_have@notemailnotq.cpm> - 2013-05-03 16:07 -0400
          Re: are forthers still unimpressed with go lang? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-05-03 17:49 -0500
            Re: are forthers still unimpressed with go lang? "Rod Pemberton" <do_not_have@notemailnotq.cpm> - 2013-05-05 00:51 -0400
              Re: are forthers still unimpressed with go lang? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-05-05 04:12 -0500
                Re: are forthers still unimpressed with go lang? hughaguilar96@yahoo.com - 2013-05-06 23:17 -0700
                Re: are forthers still unimpressed with go lang? AKE <assadebrahim2000@gmail.com> - 2013-05-07 10:36 -0700
                Re: are forthers still unimpressed with go lang? "Rod Pemberton" <do_not_have@notemailnotq.cpm> - 2013-05-07 18:57 -0400
                Re: are forthers still unimpressed with go lang? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-05-08 02:54 -0500
                Re: are forthers still unimpressed with go lang? Paul Rubin <no.email@nospam.invalid> - 2013-05-08 02:03 -0700
                Re: are forthers still unimpressed with go lang? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-05-08 12:18 -0500
                Re: are forthers still unimpressed with go lang? hughaguilar96@yahoo.com - 2013-05-08 20:53 -0700
                Re: are forthers still unimpressed with go lang? the_gavino_himself <visphatesjava@gmail.com> - 2013-05-07 14:25 -0700
    Re: are forthers still unimpressed with go lang? the_gavino_himself <visphatesjava@gmail.com> - 2013-05-03 16:00 -0700

csiph-web