[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: C++ / multiple instances / iostreams
From: |
Laurence Finston |
Subject: |
Re: C++ / multiple instances / iostreams |
Date: |
Wed, 21 Jul 2004 22:58:28 +0200 |
User-agent: |
IMHO/0.98.3+G (Webmail for Roxen) |
> Hans Aberg wrote:
-------------------
>
> I believe that the design criterion that BS expressed was that C++ should
> admit efficient implementations, but by no means as optimized as in C. Sed
> the book DEC++ ("Design and Evolution of C++").
>
> > One of the important
> >goals in the design of C++ was also not to lose the ability to program in a
> >low-level style efficiently.
>
> Right: C++ is a multiparadigm language. But the high level cannot be as
> efficient as optimized low-level programming.
>
I just read a relevant passage in _The C++ Programming Language_ the other
day, but unfortunately I don't have it here, so I can't quote it at you. In
both that book and _The Design and Evolution_ Stroustrup is very firm that C++
should be as efficient as C when only the common subset of C and C++ is used.
He argues, persuasively I think, for all of the features in C++ that are not
in C, and for the features provided by the standard library, that the
cost/benefit ratio is always reasonable. Of course, an implementation may be
particulary efficient or inefficient.
>From my point of view, in the case of an inefficient implementation of, say,
a standard library template class, my solution would be use it anyway, and
hope that the implementors of `libstdc++' improve it, as I'm confident they
will do. After all, my package isn't used for anything people's lives depend
on.
On the other hand, if I thought that C++ was significantly less efficient than
C, I would have used C. "Optimized" to me means optimized for a particular
machine. I'm not sure I'll ever get around to doing this, but I am curious
whether implementing matrix multiplication and inversion in assembler would
produce a performance benefit.
It was interesting to look at your code.
Laurence
- C++ / multiple instances / iostreams, Oliver Kowalke, 2004/07/18
- Re: C++ / multiple instances / iostreams, Laurence Finston, 2004/07/18
- Re: C++ / multiple instances / iostreams, Hans Aberg, 2004/07/18
- Re: C++ / multiple instances / iostreams, Oliver Kowalke, 2004/07/18
- Re: C++ / multiple instances / iostreams, Hans Aberg, 2004/07/19
- Re: C++ / multiple instances / iostreams, Laurence Finston, 2004/07/19
- Re: C++ / multiple instances / iostreams, Hans Aberg, 2004/07/20
- Re: C++ / multiple instances / iostreams, Laurence Finston, 2004/07/20
- Message not available
- Re: C++ / multiple instances / iostreams, Hans Aberg, 2004/07/21
- Re: C++ / multiple instances / iostreams,
Laurence Finston <=
- Re: C++ / multiple instances / iostreams, Hans Aberg, 2004/07/22
- Re: C++ / multiple instances / iostreams, Detlef Vollmann, 2004/07/21
- Re: C++ / multiple instances / iostreams, Hans Aberg, 2004/07/22
- Re: C++ / multiple instances / iostreams, Detlef Vollmann, 2004/07/23
- Re: C++ / multiple instances / iostreams, Hans Aberg, 2004/07/23
- Re: C++ / multiple instances / iostreams, Detlef Vollmann, 2004/07/24
- Re: C++ / multiple instances / iostreams, Hans Aberg, 2004/07/24
- Re: C++ / multiple instances / iostreams, Detlef Vollmann, 2004/07/24
- Re: C++ / multiple instances / iostreams, Hans Aberg, 2004/07/24
- Re: C++ / multiple instances / iostreams, Detlef Vollmann, 2004/07/24