Re: [9fans] C question on struct Biobuf in bio.h

2014-10-08 Thread Charles Forsyth
On 7 October 2014 18:27, Álvaro Jurado elbingm...@gmail.com wrote:


 , and ld could not assign right the values if declarations are not
 specified ansi style (variable initialization it's made by ld, not by the
 compiler): you will get some dragons in some cases.


Initialisations of externals is done by the compiler, which lays things out
as .long etc. ld doesn't do anything special; it doesn't even know about
them.


[9fans] C question on struct Biobuf in bio.h

2014-10-07 Thread Carsten Kunze
Hello,

in bio.h there is a

struct  Biobuf
{
Biobufhdr;
uchar   b[Bungetsize+Bsize];
};

where Biobufhdr is declared as

typedef struct  Biobufhdr   Biobufhdr;

To make it compile with gcc under UNIX I changed the struct to

struct  Biobuf
{
Biobufhdr Biobufhdr;
uchar   b[Bungetsize+Bsize];
};

but is that what is meant by the original description above?

   Carsten



Re: [9fans] C question on struct Biobuf in bio.h

2014-10-07 Thread Bence Fábián
hi,

no, it is an anonym field.  and it is used in a way that is not part
of ansi c.  there is an extension in newer versions of gcc which
supports it, but if you wan't to port plan 9 c to unix you can use the
libs from plan9port.  that's far more easier.

bence

2014-10-07 17:24 GMT+02:00 Carsten Kunze carsten.ku...@arcor.de:

 Hello,

 in bio.h there is a

 struct  Biobuf
 {
 Biobufhdr;
 uchar   b[Bungetsize+Bsize];
 };

 where Biobufhdr is declared as

 typedef struct  Biobufhdr   Biobufhdr;

 To make it compile with gcc under UNIX I changed the struct to

 struct  Biobuf
 {
 Biobufhdr Biobufhdr;
 uchar   b[Bungetsize+Bsize];
 };

 but is that what is meant by the original description above?

Carsten




Re: [9fans] C question on struct Biobuf in bio.h

2014-10-07 Thread David du Colombier
 in bio.h there is a

 struct  Biobuf
 {
 Biobufhdr;
 uchar   b[Bungetsize+Bsize];
 };

 where Biobufhdr is declared as

 typedef struct  Biobufhdr   Biobufhdr;

This is an unnamed structure. Recent versions of GCC
should be able to handle them when setting the
-fplan9-extension flag.

Otherwise, your change is fine, but hdr would probably be
a better name than Biobufhdr. Also, don't forget to update
your code to use b-hdr.fid instead of b-fid, and so on.

-- 
David du Colombier



Re: [9fans] C question on struct Biobuf in bio.h

2014-10-07 Thread Carsten Kunze
 Otherwise, your change is fine, but hdr would probably be
 a better name than Biobufhdr. Also, don't forget to update
 your code to use b-hdr.fid instead of b-fid, and so on.

Thanks for all answers!

(They also helped to find a short documentation in /sys/doc/compiler)

   Carsten



Re: [9fans] C question on struct Biobuf in bio.h

2014-10-07 Thread Álvaro Jurado
I'm using gcc to compile plan9 code from some time (4.7/4.8) and that
option are masking real behaviour. Do not warns or put out an error about
anonymous structs, but you will have a conflict if to structs in the same
source are including a, for example, Lock; element, and ld could not
assign right the values if declarations are not specified ansi style
(variable initialization it's made by ld, not by the compiler): you will
get some dragons in some cases.
Look at LP49 source code and you will see that authors used your second way.

Álvaro Jurado Cuevas
colmenar.biz.tm

2014-10-07 17:58 GMT+02:00 Carsten Kunze carsten.ku...@arcor.de:

  Otherwise, your change is fine, but hdr would probably be
  a better name than Biobufhdr. Also, don't forget to update
  your code to use b-hdr.fid instead of b-fid, and so on.

 Thanks for all answers!

 (They also helped to find a short documentation in /sys/doc/compiler)

Carsten




Re: [9fans] c compiler bug

2013-02-21 Thread Comeau At9Fans
On Mon, Feb 18, 2013 at 9:38 AM, Charles Forsyth
charles.fors...@gmail.comwrote:

 On 18 February 2013 13:02, Comeau At9Fans comeauat9f...@gmail.com wrote:

 seems to be doing is setting up allowing the call to compile and once
 that is satisfied then the subsequent definition has to match it, as
 perhaps a way to do type punning.


 No, the compiler is simply applying scope rules. Without that inner
 declaration explicitly overriding the outer declaration--whether static or
 extern is used--
 it will not compile (eg, if you put static void fn(Outer*); or extern
 void fn(Outer*); and remove static from fn in the file scope).

 The behaviour is undefined in ANSI C if two declarations that refer to the
 same object or function do not have compatible types
 (normally, you're protected by another rule that you can't have
 incompatible declarations *in the same scope*).

 ANSI C does, however, forbid the inner static declaration (which surprised
 me)
 The declaration of an identifier for a function that has block scope
 shall have no explicit storage-class specifier other than extern. (6.7.1)


We're probably saying the same thing.  As you say ANSI C forbids it hence
my comment about normally a diagnostic from a so-called mainstream
compiler.   And as you say without a declaration it would not compile
either.  The declaration should normally be in global scope (it could have
been), which would have also produced a diagnostic since Inner/Outer don't
match.  That leaves the declaration where Eric showed it, which the Plan 9
compiler obviously allowed.  As you note the net effect is it's undefined
(if we're using ANSI C as the metric) hence created a kind of type pun
(even if the original code did it as a mistake).

-- 
Greg Comeau / 4.3.10.1 with C++0xisms now in beta!
Comeau C/C++ ONLINE == http://www.comeaucomputing.com/tryitout
World Class Compilers:  Breathtaking C++, Amazing C99, Fabulous C90.
Comeau C/C++ with Dinkumware's Libraries... Have you tried it?


Re: [9fans] c compiler bug

2013-02-21 Thread Comeau At9Fans
On Mon, Feb 18, 2013 at 10:02 AM, erik quanstrom quans...@quanstro.netwrote:

  No, the compiler is simply applying scope rules.  Without that inner
  declaration explicitly overriding the outer declaration--whether
  static or extern is used-- it will not compile (eg, if you put static
  void fn(Outer*); or extern void fn(Outer*); and remove static from
  fn in the file scope).

 since nested functions are not allowed, applying nested scope seems
 a bit odd.  anyway, ...


It's often to be refrained from even if it were extern and not static.


 if the declaration were in the same place but the referenced
 function were in another file, the -T would have prevented the
 link.  my question is, why doesn't the c compiler internally
 apply the same rule?


Wild guessing that it's probably an oversight that it got allowed.

-- 
Greg Comeau / 4.3.10.1 with C++0xisms now in beta!
Comeau C/C++ ONLINE == http://www.comeaucomputing.com/tryitout
World Class Compilers:  Breathtaking C++, Amazing C99, Fabulous C90.
Comeau C/C++ with Dinkumware's Libraries... Have you tried it?


Re: [9fans] c compiler bug

2013-02-21 Thread hiro
can you please stop sending html mails? thanks

On 2/21/13, Comeau At9Fans comeauat9f...@gmail.com wrote:
 On Mon, Feb 18, 2013 at 9:38 AM, Charles Forsyth
 charles.fors...@gmail.comwrote:

 On 18 February 2013 13:02, Comeau At9Fans comeauat9f...@gmail.com
 wrote:

 seems to be doing is setting up allowing the call to compile and once
 that is satisfied then the subsequent definition has to match it, as
 perhaps a way to do type punning.


 No, the compiler is simply applying scope rules. Without that inner
 declaration explicitly overriding the outer declaration--whether static
 or
 extern is used--
 it will not compile (eg, if you put static void fn(Outer*); or extern
 void fn(Outer*); and remove static from fn in the file scope).

 The behaviour is undefined in ANSI C if two declarations that refer to
 the
 same object or function do not have compatible types
 (normally, you're protected by another rule that you can't have
 incompatible declarations *in the same scope*).

 ANSI C does, however, forbid the inner static declaration (which
 surprised
 me)
 The declaration of an identifier for a function that has block scope
 shall have no explicit storage-class specifier other than extern.
 (6.7.1)


 We're probably saying the same thing.  As you say ANSI C forbids it hence
 my comment about normally a diagnostic from a so-called mainstream
 compiler.   And as you say without a declaration it would not compile
 either.  The declaration should normally be in global scope (it could have
 been), which would have also produced a diagnostic since Inner/Outer don't
 match.  That leaves the declaration where Eric showed it, which the Plan 9
 compiler obviously allowed.  As you note the net effect is it's undefined
 (if we're using ANSI C as the metric) hence created a kind of type pun
 (even if the original code did it as a mistake).

 --
 Greg Comeau / 4.3.10.1 with C++0xisms now in beta!
 Comeau C/C++ ONLINE == http://www.comeaucomputing.com/tryitout
 World Class Compilers:  Breathtaking C++, Amazing C99, Fabulous C90.
 Comeau C/C++ with Dinkumware's Libraries... Have you tried it?




Re: [9fans] c compiler bug

2013-02-21 Thread John Floren
I think his mail client is just too world-class,  breathtaking,
amazing, and fabulous--have you tried it?

On Thu, Feb 21, 2013 at 10:13 AM, hiro 23h...@gmail.com wrote:
 can you please stop sending html mails? thanks

 On 2/21/13, Comeau At9Fans comeauat9f...@gmail.com wrote:
 On Mon, Feb 18, 2013 at 9:38 AM, Charles Forsyth
 charles.fors...@gmail.comwrote:

 On 18 February 2013 13:02, Comeau At9Fans comeauat9f...@gmail.com
 wrote:

 seems to be doing is setting up allowing the call to compile and once
 that is satisfied then the subsequent definition has to match it, as
 perhaps a way to do type punning.


 No, the compiler is simply applying scope rules. Without that inner
 declaration explicitly overriding the outer declaration--whether static
 or
 extern is used--
 it will not compile (eg, if you put static void fn(Outer*); or extern
 void fn(Outer*); and remove static from fn in the file scope).

 The behaviour is undefined in ANSI C if two declarations that refer to
 the
 same object or function do not have compatible types
 (normally, you're protected by another rule that you can't have
 incompatible declarations *in the same scope*).

 ANSI C does, however, forbid the inner static declaration (which
 surprised
 me)
 The declaration of an identifier for a function that has block scope
 shall have no explicit storage-class specifier other than extern.
 (6.7.1)


 We're probably saying the same thing.  As you say ANSI C forbids it hence
 my comment about normally a diagnostic from a so-called mainstream
 compiler.   And as you say without a declaration it would not compile
 either.  The declaration should normally be in global scope (it could have
 been), which would have also produced a diagnostic since Inner/Outer don't
 match.  That leaves the declaration where Eric showed it, which the Plan 9
 compiler obviously allowed.  As you note the net effect is it's undefined
 (if we're using ANSI C as the metric) hence created a kind of type pun
 (even if the original code did it as a mistake).

 --
 Greg Comeau / 4.3.10.1 with C++0xisms now in beta!
 Comeau C/C++ ONLINE == http://www.comeaucomputing.com/tryitout
 World Class Compilers:  Breathtaking C++, Amazing C99, Fabulous C90.
 Comeau C/C++ with Dinkumware's Libraries... Have you tried it?





Re: [9fans] c compiler bug

2013-02-21 Thread erik quanstrom
On Thu Feb 21 13:23:26 EST 2013, j...@jfloren.net wrote:
 I think his mail client is just too world-class,  breathtaking,
 amazing, and fabulous--have you tried it?
 
 On Thu, Feb 21, 2013 at 10:13 AM, hiro 23h...@gmail.com wrote:
  can you please stop sending html mails? thanks

why does this bother anybody?  i hadn't even noticed, and i
use nedmail to read my mail.  which is somewhat of an
admission of failure.  i used to just bring up my mail box in
acme until google started base64ing heavily.  which is oddly
another admission of defeat.  after 40 years of trying, we still don't
have 8-bit clean email.

- erik



Re: [9fans] c compiler bug

2013-02-21 Thread Comeau At9Fans
On Thu, Feb 21, 2013 at 1:39 PM, erik quanstrom quans...@quanstro.netwrote:

 On Thu Feb 21 13:23:26 EST 2013, j...@jfloren.net wrote:
  I think his mail client is just too world-class,  breathtaking,
  amazing, and fabulous--have you tried it?
 
  On Thu, Feb 21, 2013 at 10:13 AM, hiro 23h...@gmail.com wrote:
   can you please stop sending html mails? thanks

 why does this bother anybody?  i hadn't even noticed, and i
 use nedmail to read my mail.  which is somewhat of an
 admission of failure.  i used to just bring up my mail box in
 acme until google started base64ing heavily.  which is oddly
 another admission of defeat.  after 40 years of trying, we still don't
 have 8-bit clean email.


It's just gmail, perhaps my own admission of failure? :)

-- 
Greg Comeau / 4.3.10.1 with C++0xisms now in beta!
Comeau C/C++ ONLINE == http://www.comeaucomputing.com/tryitout
World Class Compilers:  Breathtaking C++, Amazing C99, Fabulous C90.
Comeau C/C++ with Dinkumware's Libraries... Have you tried it?


Re: [9fans] c compiler bug

2013-02-21 Thread Kurt H Maier
On Thu, Feb 21, 2013 at 01:39:14PM -0500, erik quanstrom wrote:
 On Thu Feb 21 13:23:26 EST 2013, j...@jfloren.net wrote:
  I think his mail client is just too world-class,  breathtaking,
  amazing, and fabulous--have you tried it?
  
  On Thu, Feb 21, 2013 at 10:13 AM, hiro 23h...@gmail.com wrote:
   can you please stop sending html mails? thanks
 
 why does this bother anybody?  i hadn't even noticed, and i
 use nedmail to read my mail.  which is somewhat of an
 admission of failure.  i used to just bring up my mail box in
 acme until google started base64ing heavily.  which is oddly
 another admission of defeat.  after 40 years of trying, we still don't
 have 8-bit clean email.
 
 - erik
 

Are you seriously marking this request WORKSFORME




Re: [9fans] c compiler bug

2013-02-21 Thread John Floren
On Thu, Feb 21, 2013 at 10:46 AM, Comeau At9Fans
comeauat9f...@gmail.com wrote:
 On Thu, Feb 21, 2013 at 1:39 PM, erik quanstrom quans...@quanstro.net
 wrote:

 On Thu Feb 21 13:23:26 EST 2013, j...@jfloren.net wrote:
  I think his mail client is just too world-class,  breathtaking,
  amazing, and fabulous--have you tried it?
 
  On Thu, Feb 21, 2013 at 10:13 AM, hiro 23h...@gmail.com wrote:
   can you please stop sending html mails? thanks

 why does this bother anybody?  i hadn't even noticed, and i
 use nedmail to read my mail.  which is somewhat of an
 admission of failure.  i used to just bring up my mail box in
 acme until google started base64ing heavily.  which is oddly
 another admission of defeat.  after 40 years of trying, we still don't
 have 8-bit clean email.


 It's just gmail, perhaps my own admission of failure? :)


Gmail has interesting ideas sometimes about when it should send HTML.
I seem to have figured out how to make it always send plain-text, but
unfortunately I can't remember how exactly I did that.


john



Re: [9fans] c compiler bug

2013-02-21 Thread hiro
Sorry, google's inconsistent mail interface made me post to the list
instead of private. I didn't mean to make this a discussion of
google's web technolgy, I just want to promote the sending of certain
compatible formats that everyone can read without problems.

My gmail only sends

Content-Type: text/plain; charset=UTF-8

Your's can, too.



Re: [9fans] c compiler bug

2013-02-21 Thread David Leimbach
Can I run it on my iPhone?

Sent from my iPhone

On Feb 21, 2013, at 11:58 AM, andrey mirtchovski mirtchov...@gmail.com wrote:

 good day. is this the p9p on osx help forum?
 



Re: [9fans] c compiler bug

2013-02-21 Thread steve
no, but drawterm will (i believe).


On 21 Feb 2013, at 20:27, David Leimbach leim...@gmail.com wrote:

 Can I run it on my iPhone?
 
 Sent from my iPhone
 
 On Feb 21, 2013, at 11:58 AM, andrey mirtchovski mirtchov...@gmail.com 
 wrote:
 
 good day. is this the p9p on osx help forum?
 



Re: [9fans] c compiler bug

2013-02-18 Thread Comeau At9Fans
On Sat, Feb 16, 2013 at 9:38 PM, erik quanstrom quans...@quanstro.netwrote:

 i don't think this should link, since wrongaddr calls
 fn with an Outer* not an Inner*.
 ...


Normally in more mainstream C the nested static void fn(Outer*);
declaration would produce a diagnostic and instead what it (the compiler
and the code) seems to be doing is setting up allowing the call to compile
and once that is satisfied then the subsequent definition has to match
it, as perhaps a way to do type punning.

-- 
Greg Comeau / 4.3.10.1 with C++0xisms now in beta!
Comeau C/C++ ONLINE == http://www.comeaucomputing.com/tryitout
World Class Compilers:  Breathtaking C++, Amazing C99, Fabulous C90.
Comeau C/C++ with Dinkumware's Libraries... Have you tried it?


Re: [9fans] c compiler bug

2013-02-18 Thread Charles Forsyth
On 18 February 2013 13:02, Comeau At9Fans comeauat9f...@gmail.com wrote:

 seems to be doing is setting up allowing the call to compile and once that
 is satisfied then the subsequent definition has to match it, as perhaps a
 way to do type punning.


No, the compiler is simply applying scope rules. Without that inner
declaration explicitly overriding the outer declaration--whether static or
extern is used--
it will not compile (eg, if you put static void fn(Outer*); or extern
void fn(Outer*); and remove static from fn in the file scope).

The behaviour is undefined in ANSI C if two declarations that refer to the
same object or function do not have compatible types
(normally, you're protected by another rule that you can't have
incompatible declarations *in the same scope*).

ANSI C does, however, forbid the inner static declaration (which surprised
me)
The declaration of an identifier for a function that has block scope shall
have no explicit storage-class specifier other than extern. (6.7.1)


Re: [9fans] c compiler bug

2013-02-18 Thread erik quanstrom
 No, the compiler is simply applying scope rules.  Without that inner
 declaration explicitly overriding the outer declaration--whether
 static or extern is used-- it will not compile (eg, if you put static
 void fn(Outer*); or extern void fn(Outer*); and remove static from
 fn in the file scope).

since nested functions are not allowed, applying nested scope seems
a bit odd.  anyway, ...

if the declaration were in the same place but the referenced
function were in another file, the -T would have prevented the
link.  my question is, why doesn't the c compiler internally
apply the same rule?

- erik



Re: [9fans] c compiler bug

2013-02-18 Thread Charles Forsyth
On 18 February 2013 15:02, erik quanstrom quans...@quanstro.net wrote:

 since nested functions are not allowed, applying nested scope seems
 a bit odd.


Nevertheless, that is what it is.


[9fans] c compiler bug

2013-02-16 Thread erik quanstrom
i don't think this should link, since wrongaddr calls
fn with an Outer* not an Inner*.

#include u.h
#include libc.h

typedef struct  Inner   Inner;
typedef struct  Outer   Outer;

struct Inner {
int x;
};

struct Outer {
charbuf[0x1000];
Inner;
};

void
wrongaddr(Outer *o)
{
static void fn(Outer*);

fn(o);
}

void
main(void)
{
Outer *o;

o = malloc(sizeof *o);
memset(o, 0, sizeof *o);
print(addr o   %#p\n, o);
print(addr o.x %#p\n, o-x);
wrongaddr(o);
}

static void
fn(Inner *i)
{
print(fn addr i.x  %#p\n, i-x);
}
; 6.cbug
addr o  0x4018f0
addr o.x0x4028f0
fn addr i.x 0x4018f0



Re: [9fans] c++

2012-12-04 Thread hiro
On Mon, Dec 3, 2012 at 4:29 PM, Kurt H Maier kh...@intma.in wrote:
 If you ask around, you'll find tons of stories from people who took
 entry-level programming courses, taught in C++, who got in trouble for
 submitting C-compliant or similar code.  Many schools teach design
 patterns and top-down object cruft as gospel, and actively punish
 students who merely submit clean, efficient code.

this is an other example of the kind of stuff I have to do to please
my professors:
http://www.youtube.com/watch?v=7RJmoCWx4cE



Re: [9fans] C++

2012-12-03 Thread faif
IMHO Go as a system programming language would be a step forward,
but C++, obviously not... It's a beast and there are no good compact
books about it.



Re: [9fans] c++

2012-12-03 Thread Ethan Grammatikidis
On Thu, 22 Nov 2012 15:54:11 +0100
Hugo Rivera uai...@gmail.com wrote:

  the fact that there are bigger problems in the world does not imply
  that we ourselves are in a position to do anything about them.  heck,
  i see problems very close to home that i can't do much about.  i can
  try to make arguments, but very often there is no direct influence that
  can be made.  and being right is no comfort.
 
 
 Of course, it depends on the problem considered. But I think the big
 problems in the world have little to do with programming languages,
 particularly c++, which is the topic at hand.
 

As far as I can see, a lot of the problems in the world are caused by
people preferring to believe in things which seem clever but which turn
out to be meaningless or actually wrong on deeper inspection. C++ seems
to be much the same way, which doesn't make it part of the problem but
does mean that if you teach it as a good and normal thing you are
encouraging bad reasoning practices similar to those which cause the
serious problems. 

Of course, teaching it as a good and normal thing is a far cry from
responding to the OP's question, I don't mean to insult anyone who was
doing that.

On Thu, 22 Nov 2012 12:34:16 +0100
hiro 23h...@gmail.com wrote:

 C++ and java feel highly inconsistent and are full of stupid busywork
 and strange programming philosophies that you have to learn about,
 but teach you nothing.

I quoted this because it's so similar to my own thoughts on the matter,
but also is it just me or does anyone else think strange [...]
philosophies that you have to learn about, but teach you nothing,
sounds just like it's referring to some religion?

-- 
Developing the austere intellectual discipline of keeping things
sufficiently simple is in this environment a formidable challenge,
both technically and educationally.
 -- Dijstraka, EWD898, 1984



Re: [9fans] c++

2012-12-03 Thread Charles Forsyth
 C++ and java feel highly inconsistent and are full of stupid busywork
 and strange programming philosophies that you have to learn about,

I've written programs in both languages and you don't really have to
worry about the philosophies,
if by that is meant things like the Pattern stuff, when using the
standard libraries or collections.
I found Christopher Alexander's book fascinating, but I didn't really
take to the Gang of Four's,
which left me cold. I thought it was an interesting attempt, but I
just didn't think it worked,
although that was clearly a minority opinion! I thought it made simple
things elaborate, and
complicated things harder to follow.



Re: [9fans] c++

2012-12-03 Thread Kurt H Maier
On Mon, Dec 03, 2012 at 02:13:53PM +, Charles Forsyth wrote:
  C++ and java feel highly inconsistent and are full of stupid busywork
  and strange programming philosophies that you have to learn about,
 
 I've written programs in both languages and you don't really have to
 worry about the philosophies,
 if by that is meant things like the Pattern stuff, when using the
 standard libraries or collections.

This may be true, but this is not what is being taught at the university
level.  



Re: [9fans] c++

2012-12-03 Thread Charles Forsyth
I see. That might be tedious.

On 3 December 2012 14:58, Kurt H Maier kh...@intma.in wrote:
 This may be true, but this is not what is being taught at the university
 level.



Re: [9fans] c++

2012-12-03 Thread Kurt H Maier
On Mon, Dec 03, 2012 at 03:21:37PM +, Charles Forsyth wrote:
 I see. That might be tedious.
 

If you ask around, you'll find tons of stories from people who took
entry-level programming courses, taught in C++, who got in trouble for
submitting C-compliant or similar code.  Many schools teach design
patterns and top-down object cruft as gospel, and actively punish
students who merely submit clean, efficient code.

It's a problem.



Re: [9fans] C++

2012-11-27 Thread Eugene Gorodinsky
Yay! A C++ vs the world flamewar! Again.

Let me just point out that writing a game engine consists of a little bit
more than just calls to opengl. Game engine programmers tend to embed
scripting languages in their engines as opposed to writing the engines in
Java, C#, Python or Lua.

P.S. Coincidentally, here's a link to Carmack's rant about how script
interpreters suck:
http://www.codingthewheel.com/game-dev/john-carmack-script-interpreters-considered-harmful
P.P.S. idTech4 and above use C++. Carmack probably doesn't write idiomatic
C anymore, considering his tips on doing functional programming in C++ (
http://www.altdevblogaday.com/2012/04/26/functional-programming-in-c/)

2012/11/23 dexen deVries dexen.devr...@gmail.com

 On Friday 23 of November 2012 10:47:09 Gorka Guardiola wrote:
  On Thu, Nov 22, 2012 at 11:32 PM, Winston Kodogo kod...@gmail.com
 wrote:
   But, let the record show, C++ has been scientifically shown to be an
   unbelievably crap and monstrously complex language, even though I earn
   my daily bread by using it. I was a contemporary of Dr Stroustrup when
   he was spending his time dragging the Cambridge mainframe to its knees
   using the Simula compiler - the kindest description I ever heard from
   friends in the computer lab was stubborn-  and occasionally, ok
   frequently, or indeed always, am tempted to view C++ as his revenge on
   the world for pointing out that he doesn't have a clue how to program
   efficiently.
 
  Yes, this is why most games, which do not need speed or efficiency at all
  are programmed in C++. (...)

 you've just stepped on my pet peeve, apologies in advance for what follows.

 'NITPICK'
 the bulk of in-game graphics processing is done via OpenGL calls/DirectX
 calls/whatever goes on the PS3' Cell CPU. the C++ parts could be replaced
 with
 Python and noone would be any the wiser.

 similarily, Youtube flash player does not decode nor scale video in Flash'
 Actionscript; the GPU does it. unless you have broken drivers like i had
 once,
 in which case it is /slow/.

 C++ for the assembly-line-style game development [1] is choosen as PHB's
 safe
 bet  -- a.k.a. ``industry's stadard practice'' -- and not on technical
 merits.
 cue picture of Scott Adams (of Dilbert fame).

 if you really must, John Carmak writes idomatic C, not C++.
 NITPICK;


 [1] http://news.ycombinator.com/item?id=4821152 and countless other
 stories.

 --
 dexen deVries

 [[[↓][→]]]


 Reality is just a convenient measure of complexity.
 -- Alvy Ray Smith




Re: [9fans] C++

2012-11-27 Thread David Leimbach
Haskell


On Tue, Nov 27, 2012 at 9:09 AM, Eugene Gorodinsky
e.gorodin...@gmail.comwrote:

 Yay! A C++ vs the world flamewar! Again.

 Let me just point out that writing a game engine consists of a little bit
 more than just calls to opengl. Game engine programmers tend to embed
 scripting languages in their engines as opposed to writing the engines in
 Java, C#, Python or Lua.

 P.S. Coincidentally, here's a link to Carmack's rant about how script
 interpreters suck:
 http://www.codingthewheel.com/game-dev/john-carmack-script-interpreters-considered-harmful
 P.P.S. idTech4 and above use C++. Carmack probably doesn't write idiomatic
 C anymore, considering his tips on doing functional programming in C++ (
 http://www.altdevblogaday.com/2012/04/26/functional-programming-in-c/)

 2012/11/23 dexen deVries dexen.devr...@gmail.com

 On Friday 23 of November 2012 10:47:09 Gorka Guardiola wrote:
  On Thu, Nov 22, 2012 at 11:32 PM, Winston Kodogo kod...@gmail.com
 wrote:
   But, let the record show, C++ has been scientifically shown to be an
   unbelievably crap and monstrously complex language, even though I earn
   my daily bread by using it. I was a contemporary of Dr Stroustrup when
   he was spending his time dragging the Cambridge mainframe to its knees
   using the Simula compiler - the kindest description I ever heard from
   friends in the computer lab was stubborn-  and occasionally, ok
   frequently, or indeed always, am tempted to view C++ as his revenge on
   the world for pointing out that he doesn't have a clue how to program
   efficiently.
 
  Yes, this is why most games, which do not need speed or efficiency at
 all
  are programmed in C++. (...)

 you've just stepped on my pet peeve, apologies in advance for what
 follows.

 'NITPICK'
 the bulk of in-game graphics processing is done via OpenGL calls/DirectX
 calls/whatever goes on the PS3' Cell CPU. the C++ parts could be replaced
 with
 Python and noone would be any the wiser.

 similarily, Youtube flash player does not decode nor scale video in Flash'
 Actionscript; the GPU does it. unless you have broken drivers like i had
 once,
 in which case it is /slow/.

 C++ for the assembly-line-style game development [1] is choosen as PHB's
 safe
 bet  -- a.k.a. ``industry's stadard practice'' -- and not on technical
 merits.
 cue picture of Scott Adams (of Dilbert fame).

 if you really must, John Carmak writes idomatic C, not C++.
 NITPICK;


 [1] http://news.ycombinator.com/item?id=4821152 and countless other
 stories.

 --
 dexen deVries

 [[[↓][→]]]


 Reality is just a convenient measure of complexity.
 -- Alvy Ray Smith





Re: [9fans] C++

2012-11-27 Thread Kurt H Maier
On Tue, Nov 27, 2012 at 11:57:43AM -0800, David Leimbach wrote:
 Haskell

No.



Re: [9fans] C++

2012-11-24 Thread David Leimbach
On Nov 23, 2012 6:03 AM, lu...@proxima.alt.za wrote:

  Are operating systems written in C for it's technical merits or because
  it is industry standard practice?

 Neither: pragmatism.  The language and Unix grew up together, teaching
 each other many tricks.

 ++L


And they are not all written in C.



Re: [9fans] c++

2012-11-24 Thread David Leimbach
On Nov 22, 2012 8:31 AM, lu...@proxima.alt.za wrote:

  it's an Xbox game. and yes, you
  need it ;)

 Xbox-360?  Surely it runs IBM code?


Yes.  IBM power pc
 :-)

 ++L




Re: [9fans] c++

2012-11-23 Thread Balwinder S Dheeman

On 11/22/2012 10:52 PM, tlaro...@polynum.com wrote:

On Thu, Nov 22, 2012 at 05:18:03PM +, Charles Forsyth wrote:

Yes, that would be silly. You need only the screwdriver, provided it's sonic,
but I suppose that just emphasises your point about tools.



You did not get the big picture: the screwdriver is for the engine; the
hammer is to deal with people coming arguing about why you use a
screwdriver...


LOL! ROTF!


On 22 November 2012 17:10, Kurt H Maier kh...@intma.in wrote:

If someone came to me and asked me to rebuild an engine with a hammer
and a screwdriver.


--
Balwinder S bdheeman Dheeman
(http://werc.homelinux.net/contact/)



Re: [9fans] C++

2012-11-23 Thread Gorka Guardiola
On Thu, Nov 22, 2012 at 11:32 PM, Winston Kodogo kod...@gmail.com wrote:

 But, let the record show, C++ has been scientifically shown to be an
 unbelievably crap and monstrously complex language, even though I earn
 my daily bread by using it. I was a contemporary of Dr Stroustrup when
 he was spending his time dragging the Cambridge mainframe to its knees
 using the Simula compiler - the kindest description I ever heard from
 friends in the computer lab was stubborn-  and occasionally, ok
 frequently, or indeed always, am tempted to view C++ as his revenge on
 the world for pointing out that he doesn't have a clue how to program
 efficiently.


Yes, this is why most games, which do not need speed or efficiency at all
are programmed in C++. I don't like C++, but it is a tool and as such, it
has shown it is useful in some environments. Is it aesthetically pleasant?
no. Is it more complex than needed? yes. But claiming that it is not possible
to program efficiently in C++ (or implying so) is going into religious grounds
and negating reality.

BTW, making ad-hominem attacks against a language author says more
about you than the language itself.


G.



Re: [9fans] C++

2012-11-23 Thread dexen deVries
On Friday 23 of November 2012 10:47:09 Gorka Guardiola wrote:
 On Thu, Nov 22, 2012 at 11:32 PM, Winston Kodogo kod...@gmail.com wrote:
  But, let the record show, C++ has been scientifically shown to be an
  unbelievably crap and monstrously complex language, even though I earn
  my daily bread by using it. I was a contemporary of Dr Stroustrup when
  he was spending his time dragging the Cambridge mainframe to its knees
  using the Simula compiler - the kindest description I ever heard from
  friends in the computer lab was stubborn-  and occasionally, ok
  frequently, or indeed always, am tempted to view C++ as his revenge on
  the world for pointing out that he doesn't have a clue how to program
  efficiently.
 
 Yes, this is why most games, which do not need speed or efficiency at all
 are programmed in C++. (...)

you've just stepped on my pet peeve, apologies in advance for what follows.

'NITPICK'
the bulk of in-game graphics processing is done via OpenGL calls/DirectX 
calls/whatever goes on the PS3' Cell CPU. the C++ parts could be replaced with 
Python and noone would be any the wiser.

similarily, Youtube flash player does not decode nor scale video in Flash' 
Actionscript; the GPU does it. unless you have broken drivers like i had once, 
in which case it is /slow/.

C++ for the assembly-line-style game development [1] is choosen as PHB's safe 
bet  -- a.k.a. ``industry's stadard practice'' -- and not on technical merits. 
cue picture of Scott Adams (of Dilbert fame).

if you really must, John Carmak writes idomatic C, not C++.
NITPICK;


[1] http://news.ycombinator.com/item?id=4821152 and countless other stories.

-- 
dexen deVries

[[[↓][→]]]


Reality is just a convenient measure of complexity.
-- Alvy Ray Smith



Re: [9fans] C++

2012-11-23 Thread Pedro Lamarão
Em 23/11/2012 08:21, dexen deVries escreveu:

 C++ for the assembly-line-style game development [1] is choosen as PHB's safe 
 bet  -- a.k.a. ``industry's stadard practice'' -- and not on technical 
 merits. 
 cue picture of Scott Adams (of Dilbert fame).

Are operating systems written in C for it's technical merits or because
it is industry standard practice?

--
 P.



Re: [9fans] C++

2012-11-23 Thread lucio
 Are operating systems written in C for it's technical merits or because
 it is industry standard practice?

Neither: pragmatism.  The language and Unix grew up together, teaching
each other many tricks.

++L




[9fans] C++

2012-11-23 Thread Winston Kodogo
 Been trying to read through this thread through the day and well I think
 the absurdity of your claim pretty much sums up a large portion of the
 thread, unfortunately.  Ay Caramba indeed :(


Hey, I haven't really been following this thread either. I have a day
job, and was just channeling my inner Boyd and venting in my spare
time because I entirely agree with Linus and jwz about C++. But thanks
for the compliment about my summarising prowess.

Bakul was right - that was rude. But he was also wrong, in that game
programmers pretty much all write in C, a most excellent language,
described in one of the finest books ever written about programming,
rather than C++. But I've bought every single copy of The C++
Programming Language since it came out, have waded through the
pompous and ponderous prose, grappled with the lack of a decent index,
and seriously, can you read chapter 22 of the Special Edition with a
straight face?



Re: [9fans] c++

2012-11-22 Thread Balwinder S Dheeman

On 11/20/2012 03:42 PM, Steve Simon wrote:

How do you studiously not do something? Doesn't the imply working
hard at something?


Indeed, everything I did read about Go made it look very attractive so I am 
ignoring it
as I know myself. If I read more I will start to get annoyed that I am wasting 
my time learning C++
when Go is a much better solution. Its the sam reason I use plan9 and not 
Windows/Linux/OSX etc.

its a backhanded compliment to the Go authors that I must not look at their 
work (yet).


Me, OTOH, would like see Go go out of fashion ASAP; What's so special a 
C/C++ programmer can't do what she/he can do with Go?


--
Balwinder S bdheeman Dheeman
(http://werc.homelinux.net/contact/)



Re: [9fans] c++

2012-11-22 Thread lucio
 Me, OTOH, would like see Go go out of fashion ASAP; What's so special a 
 C/C++ programmer can't do what she/he can do with Go?

What is so special a COBOL programmer can't do?

++L




Re: [9fans] c++

2012-11-22 Thread Lluís Batlle i Rossell
On Thu, Nov 22, 2012 at 09:54:34AM +, Balwinder S Dheeman wrote:
 On 11/20/2012 03:42 PM, Steve Simon wrote:
 How do you studiously not do something? Doesn't the imply working
 hard at something?
 
 Indeed, everything I did read about Go made it look very attractive so I am 
 ignoring it
 as I know myself. If I read more I will start to get annoyed that I am 
 wasting my time learning C++
 when Go is a much better solution. Its the sam reason I use plan9 and not 
 Windows/Linux/OSX etc.
 
 its a backhanded compliment to the Go authors that I must not look at their 
 work (yet).
 
 Me, OTOH, would like see Go go out of fashion ASAP; What's so
 special a C/C++ programmer can't do what she/he can do with Go?

I find big wins in go, but I hope it will be still improved.

The lack of header files is very nice, to mention only one big annoyance I see
in C/C++. :)

C/C++ don't have so fast (and ready) 'goroutines'. I hate writing state
machines; let the per-goroutine-stack hold every state!



Re: [9fans] c++

2012-11-22 Thread Nemo
Halo 4

On Nov 22, 2012, at 11:07 AM, lu...@proxima.alt.za wrote:

 What is so special a COBOL programmer can't do?




Re: [9fans] c++

2012-11-22 Thread David Leimbach
On Mon, Nov 19, 2012 at 7:10 AM, Kurt H Maier kh...@intma.in wrote:

 On Mon, Nov 19, 2012 at 09:56:33AM -0500, Calvin Morrison wrote:
  On 19 November 2012 04:59, Steve Simon st...@quintile.net wrote:
 
  Isn't all C code valid C++? problem solved.


 As of c99, they have diverged.

 They weren't the same in 1998 either.


Re: [9fans] c++

2012-11-22 Thread erik quanstrom
On Thu Nov 22 08:50:13 EST 2012, 23h...@gmail.com wrote:
 Java was not in high school, but in 9th grade in a normal German school.

i think you're trying to make a subtile distinction about
the german educational system using american terms.  if so,
it would be much less confusing with untranslated terms.

9th grade is usually 1st year high school in the us.

- erik



Re: [9fans] c++

2012-11-22 Thread Dan Cross
VisitorFactoryBuilderFactorySingletonDecoratorFactory.


On Thu, Nov 22, 2012 at 6:57 AM, Charles Forsyth
charles.fors...@gmail.comwrote:

 I'm writing Java now, after a long gap, and it's ok.
 It has its share of annoying aspects, but it's not too bad.
 Java is a bit like a high-level assembler for the JVM,
 and there are too many packages, many with intricate interfaces and
 conventions.
 C# fixes every one of my complaints about the Java language,
 and generally seems more thoughtful.

 I simply ignore the philosophy as much as I can,
 although it's hard to escape the terminology (all those factories).

 On 22 November 2012 11:34, hiro 23h...@gmail.com wrote:
  java feel highly inconsistent and are full of stupid busywork
  and strange programming philosophies that you have to learn about,
  but teach you nothing.




Re: [9fans] c++

2012-11-22 Thread Dan Cross
Personally, I think that all of this language posturing is
geekier-than-thou nonsense.

Calling C++ or Java a disease?  Really?
Suggesting that if you use one of those languages you're somehow mentally
deficient?  Really?
Suggesting someone change jobs because they're asked to program in C++?
 Really?

In the big scheme of things, absolutely none of this matters.  Whether one
programs in Java, C, Go, COBOL or 370 assembler doesn't really make any
difference; one could die tomorrow, and would anyone care what language
s/he programmed in?  really?  This world has bigger problems than that.

Programming languages are tools; nothing more.  Use whichever one fits the
problem at hand.  If you're the kind of person who geeks out on and enjoys
playing around with new tools; the kind that appreciates the relative
aesthetic quality of one versus the other, more power to you: but
understand that trying to reformulate problems so that one can apply one's
whizz-bang new shiny SuperHammer when the thing that comes out of parents'
toolbox will do is just wasting time.

I came across this recently, and it really resonated:
http://www.lindsredding.com/2012/03/11/a-overdue-lesson-in-perspective/

- Dan C.


Re: [9fans] c++

2012-11-22 Thread erik quanstrom
i agree with your point.  but i think that you the statments you point
out are hyperbole.

 In the big scheme of things, absolutely none of this matters.  Whether one
 programs in Java, C, Go, COBOL or 370 assembler doesn't really make any
 difference; one could die tomorrow, and would anyone care what language
 s/he programmed in?  really?  This world has bigger problems than that.

this argument isn't a good one.  this is a variation of the
finish your plate there are starving kids in africa argument.  the fact
that there are starving kids in africa has no bearing on if the kid in
the quote has had enough to eat.

the fact that there are bigger problems in the world does not imply
that we ourselves are in a position to do anything about them.  heck,
i see problems very close to home that i can't do much about.  i can
try to make arguments, but very often there is no direct influence that
can be made.  and being right is no comfort.

- erik



Re: [9fans] c++

2012-11-22 Thread Bakul Shah
On Nov 22, 2012, at 9:54 AM, Balwinder S Dheeman 
bsd.sans...@anu.homelinux.net wrote:
  
 
 Me, OTOH, would like see Go go out of fashion ASAP; What's so special a C/C++ 
 programmer can't do what she/he can do with Go?

Is this opinion born out of experience with Go or due to a lack of experience? 
They are all Turing complete but if that was the only important criterion most 
prog. languages wouldn't exist.


Re: [9fans] c++

2012-11-22 Thread dexen deVries
On Thursday 22 of November 2012 09:38:06 Dan Cross wrote:
 In the big scheme of things, absolutely none of this matters.  Whether one
 programs in Java, C, Go, COBOL or 370 assembler doesn't really make any
 difference; one could die tomorrow, and would anyone care what language
 s/he programmed in?  really?  This world has bigger problems than that.
 
 Programming languages are tools; nothing more.  (...)

that assumes any programming language is (at best) a constant or linear factor 
in problem solving time and complexity. some circles hold opinion that more 
powerfull programming languages provide polynominal or exponential factor.

aside of that, in various publications number of bugs is found to correlate 
with line counts or similar metrics, making a more concise language a net win.


-- 
dexen deVries

[[[↓][→]]]


Reality is just a convenient measure of complexity.
-- Alvy Ray Smith



Re: [9fans] c++

2012-11-22 Thread lucio
 Halo 4

Whatever it is, I haven't needed it in the past 38 years, should I
have?

++L




Re: [9fans] c++

2012-11-22 Thread tlaronde
On Thu, Nov 22, 2012 at 03:54:11PM +0100, Hugo Rivera wrote:
 
 Of course, it depends on the problem considered. But I think the big
 problems in the world have little to do with programming languages,
 particularly c++, which is the topic at hand.

But you are wrong... There are numerous big and desastrous problems
caused because of the inteconnections, the almost instantaneous and
worldwide speculation, not to count instantaneous and worldwide bugs,
all linked to programming.

This is not butterfly's wings in Far East that can cause a 
earthquake in Occident, but a software bug in something used or relied
upon everywhere...

-- 
Thierry Laronde tlaronde +AT+ polynum +dot+ com
  http://www.kergis.com/
Key fingerprint = 0FF7 E906 FBAF FE95 FD89  250D 52B1 AE95 6006 F40C



Re: [9fans] c++

2012-11-22 Thread lucio
 C++ and java feel highly inconsistent and are full of stupid busywork
 and strange programming philosophies that you have to learn about,

Chances are Go would not be what it is, if it was anything at all,
without the mistakes of C++ and Java (the latter are a mystery to me I
am not even remotely interested in unravelling - but I'm lucky that
way).

For what that's worth.  I enjoy the facility with which bugs are
identified and often even avoided in Go, I'm not as keen on the
Program development by progressive approximation development
technique I seem to have fallen into :-)

++L




Re: [9fans] c++

2012-11-22 Thread erik quanstrom
On Thu Nov 22 10:48:35 EST 2012, tlaro...@polynum.com wrote:
 On Thu, Nov 22, 2012 at 03:54:11PM +0100, Hugo Rivera wrote:
  
  Of course, it depends on the problem considered. But I think the big
  problems in the world have little to do with programming languages,
  particularly c++, which is the topic at hand.
 
 But you are wrong... There are numerous big and desastrous problems
 caused because of the inteconnections, the almost instantaneous and
 worldwide speculation, not to count instantaneous and worldwide bugs,
 all linked to programming.
 
 This is not butterfly's wings in Far East that can cause a 
 earthquake in Occident, but a software bug in something used or relied
 upon everywhere...

putting aside that i don't believe that the big problems like war and hunger
have anything to do with programming errors, 

i don't know which bugs you're talking about, but there is little
chance that any of us choose the programming language these unknown systems
were implemented in.  so i see this as a perpetuation of the clean your
plate argument.  it's spurious.

and even that aside, can you cite studies that show that the choice of 
programming
language is the dominant term in determining the error rate of the resulting
code?

- erik



Re: [9fans] c++

2012-11-22 Thread lucio
 Of course, it depends on the problem considered. But I think the big
 problems in the world have little to do with programming languages,
 particularly c++, which is the topic at hand.

Well, in the unequal world of long-post-apartheid rural South Africa
where I live, my hope is to teach unspoilt, but also uneducated kids
programming using Go on a Plan 9 platform (the teaching, mostly).
Doing the same in C++ or Java would demand much more effort on my part
and much more powerful resources than I have at my disposal.
Eventually, we may get over these obstacles, but by then I'm hoping
the ability to solve problems using Go will already be an asset for
the kids.

Am I delusional?  Maybe, but it's worth a try.

++L




Re: [9fans] c++

2012-11-22 Thread erik quanstrom
 Well, in the unequal world of long-post-apartheid rural South Africa
 where I live, my hope is to teach unspoilt, but also uneducated kids
 programming using Go on a Plan 9 platform (the teaching, mostly).
 Doing the same in C++ or Java would demand much more effort on my part
 and much more powerful resources than I have at my disposal.
 Eventually, we may get over these obstacles, but by then I'm hoping
 the ability to solve problems using Go will already be an asset for
 the kids.
 
 Am I delusional?  Maybe, but it's worth a try.

that sounds reasonable to me!  and good for you.

- erik



Re: [9fans] c++

2012-11-22 Thread Hugo Rivera
Great, you have my admiration, for what's worth. I truly mean that, no
sarcasm or anything alike. It would be much better if I could offer my
support instead, and maybe some day I could try to do something
similar as you are.

2012/11/22  lu...@proxima.alt.za:
 Of course, it depends on the problem considered. But I think the big
 problems in the world have little to do with programming languages,
 particularly c++, which is the topic at hand.

 Well, in the unequal world of long-post-apartheid rural South Africa
 where I live, my hope is to teach unspoilt, but also uneducated kids
 programming using Go on a Plan 9 platform (the teaching, mostly).
 Doing the same in C++ or Java would demand much more effort on my part
 and much more powerful resources than I have at my disposal.
 Eventually, we may get over these obstacles, but by then I'm hoping
 the ability to solve problems using Go will already be an asset for
 the kids.

 Am I delusional?  Maybe, but it's worth a try.

 ++L





-- 
Hugo



Re: [9fans] c++

2012-11-22 Thread Christopher Nielsen
Exactly this, Dan. Thanks.

On Thu, Nov 22, 2012 at 6:38 AM, Dan Cross cro...@gmail.com wrote:
 Personally, I think that all of this language posturing is
 geekier-than-thou nonsense.

 Calling C++ or Java a disease?  Really?
 Suggesting that if you use one of those languages you're somehow mentally
 deficient?  Really?
 Suggesting someone change jobs because they're asked to program in C++?
 Really?

 In the big scheme of things, absolutely none of this matters.  Whether one
 programs in Java, C, Go, COBOL or 370 assembler doesn't really make any
 difference; one could die tomorrow, and would anyone care what language s/he
 programmed in?  really?  This world has bigger problems than that.

 Programming languages are tools; nothing more.  Use whichever one fits the
 problem at hand.  If you're the kind of person who geeks out on and enjoys
 playing around with new tools; the kind that appreciates the relative
 aesthetic quality of one versus the other, more power to you: but understand
 that trying to reformulate problems so that one can apply one's whizz-bang
 new shiny SuperHammer when the thing that comes out of parents' toolbox will
 do is just wasting time.

 I came across this recently, and it really resonated:
 http://www.lindsredding.com/2012/03/11/a-overdue-lesson-in-perspective/

 - Dan C.





-- 
Christopher Nielsen
They who can give up essential liberty for temporary safety, deserve
neither liberty nor safety. --Benjamin Franklin
The tree of liberty must be refreshed from time to time with the
blood of patriots  tyrants. --Thomas Jefferson



Re: [9fans] c++

2012-11-22 Thread lucio
 and even that aside, can you cite studies that show that the choice of 
 programming
 language is the dominant term in determining the error rate of the resulting
 code?

Come on, Erik, are you suggesting that because there are no studies,
the situation could not exist?

It is only my opinion, but I miss the ability to design and build
arbitrary adapters for the most common desktop platform(s) available
with my limited skills, something I could do and did in the early
1980s.  The growth in complexity in that platform has created a much
higher entry bar that I certainly can't surmount any more.  The
associated growth in complexity in programming paradigms goes hand in
hand with the more powerful, but less accessible platforms and the
occurrence of bugs has almost certainly grown with both.

For one of those bugs to creep into a decision making computer and
cause real harm is not to be excluded.

Sorry if the relevance isn't obvious, I'm always fearful of boring the
reader :-)

++L




Re: [9fans] c++

2012-11-22 Thread tlaronde
On Thu, Nov 22, 2012 at 11:00:51AM -0500, erik quanstrom wrote:
 
 putting aside that i don't believe that the big problems like war and hunger
 have anything to do with programming errors, 

There have been already numerous hundreds of millions if not billions of
money losses by financial teams due to software bugs. And since, more
and more, programs make decisions based only on superficiality (no
semantics), software acts as an amplifier.

There is the example of big mirrors that are hand polished, not because
a human is less error prone : on the contrary, but because a machine
makes few errors but always the sames, in this case always in the same
area, while a human will make far more errors but random ones, not
localized leading to a more even surface.

 
 and even that aside, can you cite studies that show that the choice of 
 programming
 language is the dominant term in determining the error rate of the resulting
 code?

No, i have none since I'm already too busy programming so I have time to
gain not to loose... 

But I will make an assumption: one will find that the most desastrous
software bugs are from the softwares the most widely deployed and
the more high level ones; that these are put in the wild because they
are easy and need to catch an audience in the hurry; and that these
have been wanted by people with the most high level view of
programming that is the more farther, enforcing the use of the
language du jour. So the results are biaised: the languages are
not bad by themselves, but because some people use them not by need
and not by understanding the needs, but because this is the mandatory
language of the trend...

-- 
Thierry Laronde tlaronde +AT+ polynum +dot+ com
  http://www.kergis.com/
Key fingerprint = 0FF7 E906 FBAF FE95 FD89  250D 52B1 AE95 6006 F40C



Re: [9fans] c++

2012-11-22 Thread Nemo
it's an Xbox game. and yes, you
need it ;)

On Nov 22, 2012, at 4:37 PM, lu...@proxima.alt.za wrote:

 Halo 4
 
 Whatever it is, I haven't needed it in the past 38 years, should I
 have?
 
 ++L
 



Re: [9fans] c++

2012-11-22 Thread lucio
 Great, you have my admiration, for what's worth. I truly mean that, no
 sarcasm or anything alike. It would be much better if I could offer my
 support instead, and maybe some day I could try to do something
 similar as you are.

Nice as it is to receive support, I must warn you that I have not yet
embarked on much of a project, although I have the excuse that right
now the kids are writing exams and I am busy with an active task that
involves programming in Go and learning the ropes as I go.  I do not
want to give the impression that this is an accomplished thing, just
something I am hopefully getting closer to achive.

But thanks for the kind words, they do serve to encourage me.

++L




Re: [9fans] c++

2012-11-22 Thread lucio
 it's an Xbox game. and yes, you
 need it ;)

Xbox-360?  Surely it runs IBM code?

:-)

++L




Re: [9fans] c++

2012-11-22 Thread erik quanstrom
On Thu Nov 22 11:15:36 EST 2012, lu...@proxima.alt.za wrote:
  and even that aside, can you cite studies that show that the choice of 
  programming
  language is the dominant term in determining the error rate of the resulting
  code?
 
 Come on, Erik, are you suggesting that because there are no studies,
 the situation could not exist?

i don't know that they do or don't.  but to me that was the clear
assumption.

my hunch is that there is more evidence that development practice
and culture have a stronger bearing on the quality of the code than
the implementation language.  

for example, the folks who wrote the space shuttle software
(originally ibm) downplayed their language, but made a point of
talking about how they developed code.

their results were quite good.  one software-caused failsafe in
all the launches.

so that's just an anecdote.  i'd like to know more about the subject.

- erik



Re: [9fans] c++

2012-11-22 Thread Richard Miller
 9th grade is usually 1st year high school in the us.

DeutschlandUSA
-   -
Hochschule  college
Gymnasium   high school
Sporthalle  gymnasium




Re: [9fans] c++

2012-11-22 Thread Bakul Shah
On Nov 22, 2012, at 8:06 AM, lu...@proxima.alt.za wrote:

 Of course, it depends on the problem considered. But I think the big
 problems in the world have little to do with programming languages,
 particularly c++, which is the topic at hand.
 
 Well, in the unequal world of long-post-apartheid rural South Africa
 where I live, my hope is to teach unspoilt, but also uneducated kids
 programming using Go on a Plan 9 platform (the teaching, mostly).
 Doing the same in C++ or Java would demand much more effort on my part
 and much more powerful resources than I have at my disposal.
 Eventually, we may get over these obstacles, but by then I'm hoping
 the ability to solve problems using Go will already be an asset for
 the kids.

Linux + python seems to be succeeding in the raspberryPi world.
Then there are things like MIT Scratch which is even easier for kids.
In the end what matters is developing thinking/problem solving skills.
Simpler languages allow to focus on problem solving.

Also, many uneducated or less educated kids have problems with
more basic skills of math etc. Hopefully inexpensive tablets can be
used to develop proficiency in such subjects (very few good teachers
in the kind of places you mention). A friend is developing such
web/tablet based lessons for similar kids in India (India has as big a
problem of poor ed. as the whole of Africa). 




Re: [9fans] c++

2012-11-22 Thread Dan Cross
On Nov 22, 2012 9:50 AM, erik quanstrom quans...@quanstro.net wrote:

 i agree with your point.  but i think that you the statments you point
 out are hyperbole.

That is fair to an extent.

  In the big scheme of things, absolutely none of this matters.  Whether
one
  programs in Java, C, Go, COBOL or 370 assembler doesn't really make any
  difference; one could die tomorrow, and would anyone care what language
  s/he programmed in?  really?  This world has bigger problems than that.

 this argument isn't a good one.  this is a variation of the
 finish your plate there are starving kids in africa argument.  the fact
 that there are starving kids in africa has no bearing on if the kid in
 the quote has had enough to eat.

 the fact that there are bigger problems in the world does not imply
 that we ourselves are in a position to do anything about them.  heck,
 i see problems very close to home that i can't do much about.  i can
 try to make arguments, but very often there is no direct influence that
 can be made.  and being right is no comfort.

Well, my point was Not, there are kids starving in X, so instead of
complaining about language Y, go there and dig a well... but rather to try
and put these things in perspective.  The point was really aimed at those
who seem emotionally consumed by trivial things like programming languages
and command shells: there are probably more important things in their own
lives that they could devote that same energy towards to better effect.

To put it another way, I consider emotional arguments about programming
languages so unimportant that they pale in comparison to encouraging my
daughter to eat a healthy breakfast; starving kids in other countries
didn't even enter my mind.

- Dan C.


Re: [9fans] c++

2012-11-22 Thread Dan Cross
On Nov 22, 2012 9:56 AM, dexen deVries dexen.devr...@gmail.com wrote:

 On Thursday 22 of November 2012 09:38:06 Dan Cross wrote:
  In the big scheme of things, absolutely none of this matters.  Whether
one
  programs in Java, C, Go, COBOL or 370 assembler doesn't really make any
  difference; one could die tomorrow, and would anyone care what language
  s/he programmed in?  really?  This world has bigger problems than that.
 
  Programming languages are tools; nothing more.  (...)

 that assumes any programming language is (at best) a constant or linear
factor
 in problem solving time and complexity. some circles hold opinion that
more
 powerfull programming languages provide polynominal or exponential factor.

I'm not sure what that has to do with programming languages being tools: I
can drive a nail by banging on it with a screwdriver or my fist, but it's
much more convenient to use a hammer.  Which tool I choose really depends
on the problem I'm trying to solve.

In other words, what it assumes is that different languages are better
suited to different tasks.

 aside of that, in various publications number of bugs is found to
correlate
 with line counts or similar metrics, making a more concise language a net
win.

Ha!  Ever programmed in APL?

- Dan C.


Re: [9fans] c++

2012-11-22 Thread Kurt H Maier
On Thu, Nov 22, 2012 at 09:38:06AM -0500, Dan Cross wrote:
 Personally, I think that all of this language posturing is
 geekier-than-thou nonsense.

And the rest of this email is wiser-than-thou bullshit.  Programming
languages ARE tools.  If you enjoy using shitty tools to earn your
living, when superior tools are available, you ARE mentally deficient.
If someone came to me and asked me to rebuild an engine with a hammer
and a screwdriver, I would change jobs.  With sufficient effort, I'm
sure it's possible, but my work would not be enjoyable.

It's not all about blogging, Dan.



Re: [9fans] c++

2012-11-22 Thread tlaronde
On Thu, Nov 22, 2012 at 05:18:03PM +, Charles Forsyth wrote:
 Yes, that would be silly. You need only the screwdriver, provided it's sonic,
 but I suppose that just emphasises your point about tools.
 

You did not get the big picture: the screwdriver is for the engine; the
hammer is to deal with people coming arguing about why you use a
screwdriver...

 On 22 November 2012 17:10, Kurt H Maier kh...@intma.in wrote:
  If someone came to me and asked me to rebuild an engine with a hammer
  and a screwdriver,

-- 
Thierry Laronde tlaronde +AT+ polynum +dot+ com
  http://www.kergis.com/
Key fingerprint = 0FF7 E906 FBAF FE95 FD89  250D 52B1 AE95 6006 F40C



Re: [9fans] c++

2012-11-22 Thread Bakul Shah
On Thu, 22 Nov 2012 18:22:33 +0100 tlaro...@polynum.com  wrote:
 On Thu, Nov 22, 2012 at 05:18:03PM +, Charles Forsyth wrote:
  Yes, that would be silly. You need only the screwdriver, provided it's soni
 c,
  but I suppose that just emphasises your point about tools.
  
 
 You did not get the big picture: the screwdriver is for the engine; the
 hammer is to deal with people coming arguing about why you use a
 screwdriver...

A big enough screwdriver can be used to deal with people.
You guys are so spoiled!



Re: [9fans] c++

2012-11-22 Thread lucio
 so that's just an anecdote.  i'd like to know more about the subject.

It's not going to be a popular subject, I don't think your curiosity
will be rewarded.

I do agree that culture is very important.  I also think that I was
extremely lucky to learn computing at the time when there were many
diverse architectures and assembler programming was how you gat the
most from the limited resources available.  I wish I could teach my
target audience the same way, despite the perception that such
knowledge is no longer relevant.

++L




Re: [9fans] c++

2012-11-22 Thread lucio
 A friend is developing such
 web/tablet based lessons for similar kids in India (India has as big a
 problem of poor ed. as the whole of Africa). 

The BBC reports exceptional success by some NGOs introducing tablets
in rural (central) Africa amongst children.  But the price is wrong.
Scrappy, perfectly adequate, if antiquated, computer equipment
discarded in the West and even locally, by urban residents and
organisations, on the other hand, is much more affordable.
Electricity is an issue, but the cost of PV panels and inverters is
dropping.

Please continue with suggestions, I have a few weeks to get started
and there may well be many ideas I have not considered (MIT Scratch is
one such idea Charles already mentioned) and may make all the
difference.  Maybe in private mail?

Also, I have never seen any educational games for the PS2 (I bought
one a while back as an experiment).  I would have thought it would be
something worthwhile, maybe I'm too far from the mainstream to have
come across such games?

++L




Re: [9fans] c++

2012-11-22 Thread hiro
On Thu, Nov 22, 2012 at 5:32 PM, Richard Miller 9f...@hamnavoe.com wrote:
 9th grade is usually 1st year high school in the us.

 DeutschlandUSA
 -   -
 Hochschule  college
 Gymnasium   high school
 Sporthalle  gymnasium



It's much more complex than that, so I didn't even attempt to explain.
We can talk about this in Greek though if you like...



Re: [9fans] c++

2012-11-22 Thread lucio
 Ha!  Ever programmed in APL?

Don't knock it, to learn APL I had to shift paradigm and it was a
very important lesson in my programming education.

++L




Re: [9fans] c++

2012-11-22 Thread Pavel Klinkovsky
 and even that aside, can you cite studies that show that the choice of 
 programming
 language is the dominant term in determining the error rate of the resulting
 code?

Could it help?
http://archive.adaic.com/intro/ada-vs-c/cada_art.html

Pavel



Re: [9fans] c++

2012-11-22 Thread lucio
 dan, I don't care about your children.

You may sing a different tune if/when Dan's daughter becomes the
President of the USA.

++L




Re: [9fans] c++

2012-11-22 Thread Dan Cross
Nor should you. What she eats is my problem not yours, and it's an
incredibly minor problem. Like, only a little more important than worrying
about C++ and Java.
On Nov 22, 2012 12:33 PM, hiro 23h...@gmail.com wrote:

 dan, I don't care about your children.




Re: [9fans] c++

2012-11-22 Thread Dan Cross
Thanks for making my point for me.
On Nov 22, 2012 12:13 PM, Kurt H Maier kh...@intma.in wrote:

 On Thu, Nov 22, 2012 at 09:38:06AM -0500, Dan Cross wrote:
  Personally, I think that all of this language posturing is
  geekier-than-thou nonsense.

 And the rest of this email is wiser-than-thou bullshit.  Programming
 languages ARE tools.  If you enjoy using shitty tools to earn your
 living, when superior tools are available, you ARE mentally deficient.
 If someone came to me and asked me to rebuild an engine with a hammer
 and a screwdriver, I would change jobs.  With sufficient effort, I'm
 sure it's possible, but my work would not be enjoyable.

 It's not all about blogging, Dan.




Re: [9fans] c++

2012-11-22 Thread lucio
 a computer is a multiple purpose device, not an education.

Prove it.

++L




Re: [9fans] c++

2012-11-22 Thread Dan Cross
On Nov 22, 2012 12:43 PM, lu...@proxima.alt.za wrote:
  Ha!  Ever programmed in APL?

 Don't knock it, to learn APL I had to shift paradigm and it was a
 very important lesson in my programming education.

No doubt. As a learning exercise, such things are great. But I don't know
that the brand of brevity engendered by APL really leads to fewer defects.
:-)

- Dan C.


Re: [9fans] c++

2012-11-22 Thread Paul Lalonde
PS2 development is generally too expensive for the cost model of education
games, sadly.


On Thu, Nov 22, 2012 at 9:39 AM, lu...@proxima.alt.za wrote:

  A friend is developing such
  web/tablet based lessons for similar kids in India (India has as big a
  problem of poor ed. as the whole of Africa).

 The BBC reports exceptional success by some NGOs introducing tablets
 in rural (central) Africa amongst children.  But the price is wrong.
 Scrappy, perfectly adequate, if antiquated, computer equipment
 discarded in the West and even locally, by urban residents and
 organisations, on the other hand, is much more affordable.
 Electricity is an issue, but the cost of PV panels and inverters is
 dropping.

 Please continue with suggestions, I have a few weeks to get started
 and there may well be many ideas I have not considered (MIT Scratch is
 one such idea Charles already mentioned) and may make all the
 difference.  Maybe in private mail?

 Also, I have never seen any educational games for the PS2 (I bought
 one a while back as an experiment).  I would have thought it would be
 something worthwhile, maybe I'm too far from the mainstream to have
 come across such games?

 ++L





Re: [9fans] c++

2012-11-22 Thread lucio
 In the big scheme of things, absolutely none of this matters.  Whether one
 programs in Java, C, Go, COBOL or 370 assembler doesn't really make any
 difference; one could die tomorrow, and would anyone care what language
 s/he programmed in?  really?  This world has bigger problems than that.

My experience with APL suggested otherwise.  Assembler programming
teaches you what computers can and cannot do and a language like APL
teaches you what concepts your mind is able to embrace.  COBOL shows
you the value of code discipline and fortran the benefits of
shortcutting functionality you don't really need in a certain sphere
of programming.  No one language gives you everything and many
programmers only get to see and solve a fraction of the possible
problem space.

I think it is important for programmers to at least know that their
knowledge base is incomplete and, hopefully, come closer to rather
than further away from a broader knowledge by attempting to use more
rather than fewer tools.  That some tools may lead to bad habits, that
could be termed a judgement call, or an occupational hazard.

++L




Re: [9fans] c++

2012-11-22 Thread lucio
 No doubt. As a learning exercise, such things are great. But I don't know
 that the brand of brevity engendered by APL really leads to fewer defects.

No, although you don't have to look as far to find the errors :-)

++L




Re: [9fans] c++

2012-11-22 Thread tlaronde
On Thu, Nov 22, 2012 at 05:40:25PM +, Pavel Klinkovsky wrote:
  and even that aside, can you cite studies that show that the choice of 
  programming
  language is the dominant term in determining the error rate of the resulting
  code?
 
 Could it help?
 http://archive.adaic.com/intro/ada-vs-c/cada_art.html

The study is interesting and the conclusion so too, since there is a way
to use a language, partly due to the language, partly due to the
know-how and habits of the language (Ada programmers made more comments
about what the code was supposed to do, and there was a better locality
of bugs indicating a better partitionning).

FWIW, litterate programming (cweb) has improved the quality of my C
code, precisely because of comments (but learning not to make books, but
to get to the point), and subdivision. Fixing or improving is also
easier then.

But it took me some time to find my style or to understand
better how to use it, and the first uses were disastrous (a lengthy
discussion beating around the bush and not helping in anyway to
describe the problem---not to speak about smart reflexions that were,
on re-reading, mathematical nonsense---, followed by a lengthy code 
that was not directly related to the discussion since I had spent
to much time discussing and needed to have the job done...). It
was no miracle per se, but a tool helping to improve if used
correctly.

The situation is complexe. But there are languages that give you the
power but enforcing some strict rules (I simply hate the implicit
features or automatic polymorphic features of languages; source code
where non visible chars have syntactic meaning; I prefer strong
type checking enforcements etc.) And there are habits that are taught
and learned, and with the very same language, there may be schools,
correct and bad ones...

That's why, BTW, the trend to think that a programmer or a developer
should be dropped when he gets old, is dropping the know-how that has
probably not a small effect on the quality of code, independantly from
the language by itself.

-- 
Thierry Laronde tlaronde +AT+ polynum +dot+ com
  http://www.kergis.com/
Key fingerprint = 0FF7 E906 FBAF FE95 FD89  250D 52B1 AE95 6006 F40C



Re: [9fans] c++

2012-11-22 Thread lucio
 I remembering finding Iverson's book A Programming Language quite 
 interesting.

I don't remember the book any more, but I did read the library copy in
its entirety, maybe even more than once and was thrilled when the
university almost accidentally got an APL interpreter from Univac for
their 1106.  It got me into real trouble with the cycle counters, it
was expensive to run and interactive time was even more expensive.

Today it is just a topic for nostalgic conversation, but it really
made a difference to me, it was as if a switch had been thrown in my
head.

++L




Re: [9fans] c++

2012-11-22 Thread lucio
 Books do still get printed btw.

I'm still looking for a copy of Hollindale and Toothill's Digital
Computers (from memory, of course), which I remember being another of
the formative books I was privileged to read.

++L




Re: [9fans] c++

2012-11-22 Thread Richard Miller
 I remembering finding Iverson's book A Programming Language quite 
 interesting.
 ...
 Today it is just a topic for nostalgic conversation,

What Iverson did next:

http://9fans.net/archive/2009/07/265




Re: [9fans] c++

2012-11-22 Thread Kurt H Maier
On Thu, Nov 22, 2012 at 07:47:07PM +0200, lu...@proxima.alt.za wrote:
  a computer is a multiple purpose device, not an education.
 
 Prove it.
 

Have you even contacted IAEP or one of the dozens of OLPC working groups
in your area? 



Re: [9fans] c++

2012-11-22 Thread Kurt H Maier
On Thu, Nov 22, 2012 at 12:45:51PM -0500, Dan Cross wrote:
 Thanks for making my point for me.


Someone had to.  It sure wasn't you.



Re: [9fans] c++

2012-11-22 Thread Matthew Veety



On Thu, 22 Nov 2012, Richard Miller wrote:


9th grade is usually 1st year high school in the us.


DeutschlandUSA
   -   -
Hochschule  college
Gymnasium   high school
Sporthalle  gymnasium





I thought that Uni was equal to college here in the states.

--
Veety



Re: [9fans] c++

2012-11-22 Thread Matthew Veety

Only if she give me free healthcare and hookers.

--
Veety




Re: [9fans] c++

2012-11-22 Thread Bakul Shah

On Nov 22, 2012, at 10:02 AM, Charles Forsyth wrote:

 I remembering finding Iverson's book A Programming Language quite 
 interesting.


I highly recommended Iverson's Turing Award lecture Notation as a tool of 
thought.

http://www.jsoftware.com/papers/tot.htm
http://awards.acm.org/images/awards/140/articles/9147499.pdf


Re: [9fans] c++

2012-11-22 Thread Bakul Shah

On Nov 22, 2012, at 10:12 AM, lu...@proxima.alt.za wrote:

 I remembering finding Iverson's book A Programming Language quite 
 interesting.
 
 I don't remember the book any more, but I did read the library copy in
 its entirety, maybe even more than once and was thrilled when the
 university almost accidentally got an APL interpreter from Univac for
 their 1106.  It got me into real trouble with the cycle counters, it
 was expensive to run and interactive time was even more expensive.

At school I had a part time job with a cancer epidemiology group
(associated with the same school). I used up so much of their funny
money at the school computer center (all IBM computers with
expensive compute time) by using APL, I had to drop back to using
PL/I for them! The thing is, you make far fewer mistakes in APL but
they can cause a lot more damage! I wonder if the financial quants
made such mistakes in 2008 :-)

 Today it is just a topic for nostalgic conversation, but it really
 made a difference to me, it was as if a switch had been thrown in my
 head.

Iverson's papers are still very useful when programming in APL2 or
languages like k, j or q.


Re: [9fans] c++

2012-11-22 Thread erik quanstrom
 To put it another way, I consider emotional arguments about programming
 languages so unimportant that they pale in comparison to encouraging my
 daughter to eat a healthy breakfast; starving kids in other countries
 didn't even enter my mind.

emotional areguments are poor arguments, regardless of the subject.

i'm not sure though that i follow that x is more important than y
implies that i should not be bothered about potentially important
topics within y.

- erik



[9fans] C++

2012-11-22 Thread Winston Kodogo
Ay, Curamba!

This discussion is exactly why we need Boyd.

But, let the record show, C++ has been scientifically shown to be an
unbelievably crap and monstrously complex language, even though I earn
my daily bread by using it. I was a contemporary of Dr Stroustrup when
he was spending his time dragging the Cambridge mainframe to its knees
using the Simula compiler - the kindest description I ever heard from
friends in the computer lab was stubborn-  and occasionally, ok
frequently, or indeed always, am tempted to view C++ as his revenge on
the world for pointing out that he doesn't have a clue how to program
efficiently.



Re: [9fans] c++

2012-11-22 Thread lucio
 On Thu, Nov 22, 2012 at 07:47:07PM +0200, lu...@proxima.alt.za wrote:
  a computer is a multiple purpose device, not an education.
 
 Prove it.
 
 
 Have you even contacted IAEP or one of the dozens of OLPC working groups
 in your area? 

Sounds more like an accusation than a response.  What I choose to do
with a general-purpose tool (your argument) is to use it for
education.  Show me how your argument invalidates my objectives.

As for your issue with suppliers of computing resources, there are
political dynamics in place around me that render the question moot.
Plus, I don't want to get involved in conventional teaching (C++,
Java, Windows, etc.) and that closes quite a few doors.

++L




Re: [9fans] c++

2012-11-22 Thread Kurt H Maier
On Fri, Nov 23, 2012 at 05:31:52AM +0200, lu...@proxima.alt.za wrote:
  On Thu, Nov 22, 2012 at 07:47:07PM +0200, lu...@proxima.alt.za wrote:
   a computer is a multiple purpose device, not an education.
  
  Prove it.
  
  
  Have you even contacted IAEP or one of the dozens of OLPC working groups
  in your area? 
 
 Sounds more like an accusation than a response.  What I choose to do
 with a general-purpose tool (your argument) is to use it for
 education.  Show me how your argument invalidates my objectives.

There was a typo in my message.  The word even should have read
ever.  I love your instant defensive whining, however, as well as your
misattribution of the other email.  So far, you're the only proven
general-purpose tool here.

 As for your issue with suppliers of computing resources, there are
 political dynamics in place around me that render the question moot.
 Plus, I don't want to get involved in conventional teaching (C++,
 Java, Windows, etc.) and that closes quite a few doors.

This is frankly bizarre, since IAEP and OLPC aren't in the business of
peddling C++, Java, or Windows.  I apologize for misinterpreting your
message as anything but another attempt to climb to some rhetorical
moral high ground; I thought you were interested in using computers to
further education in underserved areas.  I withdraw my interest, and
apologize for attempting to point out relevant efforts in the areas you
claim to espouse.  My bad.  Carry on.



Re: [9fans] c++

2012-11-20 Thread Steve Simon
 How do you studiously not do something? Doesn't the imply working
 hard at something?

Indeed, everything I did read about Go made it look very attractive so I am 
ignoring it
as I know myself. If I read more I will start to get annoyed that I am wasting 
my time learning C++
when Go is a much better solution. Its the sam reason I use plan9 and not 
Windows/Linux/OSX etc.

its a backhanded compliment to the Go authors that I must not look at their 
work (yet).

-Steve



  1   2   >