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


Groups > comp.lang.forth > #19080

Re: Opinions on googl's go language?

From anton@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups comp.lang.forth
Subject Re: Opinions on googl's go language?
Date 2013-01-24 12:46 +0000
Organization Institut fuer Computersprachen, Technische Universitaet Wien
Message-ID <2013Jan24.134605@mips.complang.tuwien.ac.at> (permalink)
References (5 earlier) <6254658.Mv3jkHfHv8@sunwukong.fritz.box> <2013Jan8.172256@mips.complang.tuwien.ac.at> <epSdnWDCqKgw-3HNnZ2dnUVZ_vednZ2d@supernews.com> <2013Jan23.174039@mips.complang.tuwien.ac.at> <B82dnbaWzYobgp3MnZ2dnUVZ_rKdnZ2d@supernews.com>

Show all headers | View raw


Andrew Haley <andrew29@littlepinkcloud.invalid> writes:
>Anton Ertl <anton@mips.complang.tuwien.ac.at> wrote:
>> Andrew Haley <andrew29@littlepinkcloud.invalid> writes:
>>>Anton Ertl <anton@mips.complang.tuwien.ac.at> wrote:
>>>> Depends what you mean by "high-level".  I expected him to change to C
>>>> for reworking the books.  I did not think that reworking from MIX to
>>>> MMIX is any easier or less fundamental than from MIX to C.
>>>
>>>You can't do it because there are no instruction timings for C, so no
>>>way to compare performance.
>> 
>> He could have made timing assignments for various operations in C,
>> just like he did for MMIX.  Sure it's not reality, but neither is
>> MMIX.
>
>Perhaps, but to do so you'd have to convert each C expression into a
>sequence of instructions.  It's easier to see what is going on in
>assembly.

For algorithms?  Then I wonder why people program algorithms in other
languages than assembly.  Many even write articles and books that
present algorithms in languages other than assembly.  Wasn't Algol
even named as a language for writing algorithms?

Concerning performance, given the way that CPUs work these days, you
don't see that much more that's relevant to performance in assembly
language (or even machine language), either.

>> What is the difference between "mostly legal" and "meaningless"?
>
>It doesn't have any undefined behaviour.  However, the exact result of
>the hash is implementation-dependent.

I wouldn't be surprised if it was flamed if I posted this code in
comp.lang.c (at least pointing out non-standardness was the only thing
that posters there did the last time I posted there).

>[ I don't understand this parenthetical remark.

Sorry, I had not caught that you had changed the type of w.

>> However, that is contrary to my mental model of C performance, which
>> says that function calls have a much higher cost than a memory access
>> through a pointer.
>
>Your mental model of C performance is wrong.

It is?  You mean, that every version of every C compiler with any
optimization options will compile this memcpy() to a simple unaligned
memory-to-register load?

>> One might say that I need to adjust my mental model, but if I use
>> memcpy() with a non-constant third argument, it really is slow. 
>
>As you'd expect, no?

Yes.  So my mental model of C performance is not so wrong after all.

>> A low-level language also needs understandable performance; fast
>> operations should be available through language features, not
>> through compiler optimization of special expressions of
>> otherwise-slow features.
>
>This doesn't make any sense.  A read of a word-sized object into a
>local is fast, regardless of whether it's done by a memcpy() or an
>assignment, as long as the machine can actually do the unaligned
>access.

No, it's only fast with memcpy() if the compiler can perform this
optimization in general and if if succeeds in performing this
optimization in this particular case.  If it does not, not only will
the call to memcpy() be slow, but other accesses to this local will be
slow, too, because the local is forced into memory.

>> Yes, Forth does not provide language features for unaligned access,
>> either.
>
>Either?  C clearly does.

Not as I mean language feature in this context.  The unary * is a
language feature in C.  Function calls are a language feature.  A
special pattern of calling a library function is not a language
feature in this sense.

If we use your sense of "language feature", we have it in Forth, too:
MOVE.

- anton
-- 
M. Anton Ertl  http://www.complang.tuwien.ac.at/anton/home.html
comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
     New standard: http://www.forth200x.org/forth200x.html
   EuroForth 2012: http://www.euroforth.org/ef12/

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


Thread

Opinions on googl's go language? the_gavino_himself <visphatesjava@gmail.com> - 2012-12-26 02:13 -0800
  Re: Opinions on googl's go language? Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-12-27 16:53 -0800
    Re: Opinions on googl's go language? The Beez <the.beez.speaks@gmail.com> - 2012-12-28 02:49 -0800
      Re: Opinions on googl's go language? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-12-28 07:59 -0600
        Re: Opinions on googl's go language? "A. K." <akk@nospam.org> - 2012-12-28 16:26 +0100
          Re: Opinions on googl's go language? Richard Owlett <rowlett@pcnetinc.com> - 2012-12-28 11:21 -0600
            Re: Opinions on googl's go language? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-12-28 17:23 +0000
              Re: Opinions on googl's go language? Richard Owlett <rowlett@pcnetinc.com> - 2012-12-28 16:20 -0600
                Re: Opinions on googl's go language? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-01-08 17:55 +0000
              Re: Opinions on googl's go language? mhx@iae.nl (Marcel Hendrix) - 2012-12-28 23:48 +0200
              Re: Opinions on googl's go language? Bernd Paysan <bernd.paysan@gmx.de> - 2012-12-28 23:56 +0100
                Re: Opinions on googl's go language? gavino_himself <visploveslisp@gmail.com> - 2013-01-06 03:53 -0800
                Re: Opinions on googl's go language? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-01-08 16:22 +0000
                Re: Opinions on googl's go language? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-01-08 12:34 -0600
                Re: Opinions on googl's go language? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-01-23 16:40 +0000
                Re: Opinions on googl's go language? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-01-23 11:36 -0600
                Re: Opinions on googl's go language? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-01-24 12:46 +0000
                Re: Opinions on googl's go language? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-01-24 09:17 -0600
                Re: Opinions on googl's go language? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-01-24 17:23 +0000
                Re: Opinions on googl's go language? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-01-24 13:16 -0600
                Re: Opinions on googl's go language? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-02-05 17:59 +0000
                Re: Opinions on googl's go language? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-02-05 12:38 -0600
            Re: Opinions on googl's go language? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-12-30 03:24 -0600
              Re: Opinions on googl's go language? Richard Owlett <rowlett@pcnetinc.com> - 2012-12-30 12:14 -0600
                Re: Opinions on googl's go language? Bernd Paysan <bernd.paysan@gmx.de> - 2012-12-30 22:17 +0100
          Re: Opinions on googl's go language? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-12-30 03:22 -0600
            Re: Opinions on googl's go language? Bernd Paysan <bernd.paysan@gmx.de> - 2012-12-30 14:25 +0100
        Re: Opinions on googl's go language? Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-12-28 20:55 -0800
          Re: Opinions on googl's go language? The Beez <the.beez.speaks@gmail.com> - 2012-12-29 03:35 -0800
            Re: Opinions on googl's go language? Doug Hoffman <glidedog@gmail.com> - 2012-12-29 11:49 -0500
              Re: Opinions on googl's go language? The Beez <the.beez.speaks@gmail.com> - 2012-12-30 01:57 -0800
                Re: Opinions on googl's go language? Doug Hoffman <glidedog@gmail.com> - 2012-12-30 07:01 -0500
                Re: Opinions on googl's go language? The Beez <the.beez.speaks@gmail.com> - 2012-12-31 00:29 -0800
                Re: Opinions on googl's go language? Doug Hoffman <glidedog@gmail.com> - 2013-01-02 09:18 -0500
                Re: Opinions on googl's go language? Hugh Aguilar <hughaguilar96@yahoo.com> - 2013-01-02 20:32 -0800
                Re: Opinions on googl's go language? Doug Hoffman <glidedog@gmail.com> - 2013-01-03 06:56 -0500
                Re: Opinions on googl's go language? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-01-08 15:50 +0000
                Re: Opinions on googl's go language? Doug Hoffman <glidedog@gmail.com> - 2013-01-08 21:41 -0500
                Re: Opinions on googl's go language? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-01-23 16:55 +0000
                Re: Opinions on googl's go language? Bernd Paysan <bernd.paysan@gmx.de> - 2013-01-23 20:23 +0100
                Re: Opinions on googl's go language? Doug Hoffman <glidedog@gmail.com> - 2013-01-24 09:46 -0500
          Re: Opinions on googl's go language? Alex McDonald <blog@rivadpm.com> - 2012-12-29 07:41 -0800
      Re: Opinions on googl's go language? gavino_himself <visploveslisp@gmail.com> - 2012-12-29 19:29 -0800
  Re: Opinions on googl's go language? tcholoka@gmail.com - 2013-01-03 09:36 -0800
    Re: Opinions on googl's go language? Hugh Aguilar <hughaguilar96@yahoo.com> - 2013-01-06 00:32 -0800
      Re: Opinions on googl's go language? Mark Wills <forthfreak@gmail.com> - 2013-01-06 01:26 -0800
      Re: Opinions on googl's go language? gavino_himself <visploveslisp@gmail.com> - 2013-01-06 03:57 -0800
      Re: Opinions on googl's go language? tcholoka@gmail.com - 2013-01-06 06:02 -0800
        Re: Opinions on googl's go language? Hugh Aguilar <hughaguilar96@yahoo.com> - 2013-01-07 23:41 -0800
          Re: Opinions on googl's go language? tcholoka@gmail.com - 2013-01-08 00:15 -0800
    Re: Opinions on googl's go language? gavino_himself <visploveslisp@gmail.com> - 2013-01-06 03:56 -0800

csiph-web