By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,639 Members | 2,340 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,639 IT Pros & Developers. It's quick & easy.

Need a C++ compiler

P: n/a
I wanted a C++ compiler which would follow the ANSI C++ standards.
If you could tell me an IDE also, it would be more helpful.
Thanks.

Jun 16 '07 #1
Share this Question
Share on Google+
33 Replies


P: n/a
Nikhil Bokare wrote:
I wanted a C++ compiler which would follow the ANSI C++ standards.
If you could tell me an IDE also, it would be more helpful.
Thanks.
You can download one for free from
http://www.digitalmars.com/download/freecompiler.html

------
Walter Bright
Digital Mars C, C++, D programming language compilers
http://www.astoriaseminar.com Extraordinary C++
Jun 16 '07 #2

P: n/a
Nikhil Bokare wrote:
I wanted a C++ compiler which would follow the ANSI C++ standards.
If you could tell me an IDE also, it would be more helpful.
Thanks.
I believe G++ (the GNU C++ compiler), which is available freely, might
be a good choice; it is the "standard" on GNU/Linux and nearly all other
Linux-systems, AFAIK.

http://gcc.gnu.org/

For windows, it is available as MinGW or cygwin, try Google for that ones.

Yours,
Daniel
--
Got two Dear-Daniel-Instant Messages
by MSN, associate ICQ with stress --
so please use good, old E-MAIL!
Jun 16 '07 #3

P: n/a
Nikhil Bokare wrote:
I wanted a C++ compiler which would follow the ANSI C++ standards.
If you could tell me an IDE also, it would be more helpful.
Thanks.
Visual C++ 2005, Express edition. Free download from Microsoft. Good
support for ANSI C++, moderately good IDE (IMHO).

john
Jun 16 '07 #4

P: n/a
On Jun 17, 1:37 am, Daniel Kraft <d...@domob.euwrote:
Nikhil Bokare wrote:
I wanted a C++ compiler which would follow the ANSI C++ standards.
If you could tell me an IDE also, it would be more helpful.
Thanks.

I believe G++ (the GNU C++ compiler), which is available freely, might
be a good choice; it is the "standard" on GNU/Linux and nearly all other
Linux-systems, AFAIK.

http://gcc.gnu.org/

For windows, it is available as MinGW or cygwin, try Google for that ones.

Yours,
Daniel

--
Got two Dear-Daniel-Instant Messages
by MSN, associate ICQ with stress --
so please use good, old E-MAIL!
I do have GCC with me. But I use Windows platform and (it may feel a
bit stupid but) I am not getting how to use the GCC.
It was .tar file which was freely avaiable.

Jun 16 '07 #5

P: n/a
"Nikhil Bokare" <nb*****@gmail.comschreef in bericht
news:11**********************@i13g2000prf.googlegr oups.com...
>I wanted a C++ compiler which would follow the ANSI C++ standards.
If you could tell me an IDE also, it would be more helpful.
Thanks.
You have not said in what OS You want to use the compiler and IDE. The
following are for Windows but work on a Linux version of Openwatcom is being
done (according to the site).

Openwatcom has an IDE and I presume it follows ANSI C++ standards. Also
Visual C++ Express edition can be downloaded for free from M$-site nowadays.

Greetings,
Rene
Jun 16 '07 #6

P: n/a
On Sat, 16 Jun 2007 10:33:12 -0700, Nikhil Bokare wrote:
>I wanted a C++ compiler which would follow the ANSI C++ standards.
If you could tell me an IDE also, it would be more helpful.
Thanks.
Please, read the FAQ. In particular, see
<http://www.parashift.com/c++-faq-lite/how-to-post.htmland the entry
"Which newsgroup should I post my questions?". Note that almost
everyone will say their compiler is conforming (and you can see an
example here in this thread) but almost none is.

--
Gennaro Prota -- Need C++ expertise? I'm available
https://sourceforge.net/projects/breeze/
(replace 'address' with 'name.surname' to mail)
Jun 16 '07 #7

P: n/a
On Jun 16, 8:16 pm, Walter Bright <wal...@digitalmars-nospamm.com>
wrote:
Nikhil Bokare wrote:
I wanted a C++ compiler which would follow the ANSI C++ standards.
If you could tell me an IDE also, it would be more helpful.
You can download one for free fromhttp://www.digitalmars.com/download/freecompiler.html
Does it actually follow the ISO standard? I thought that the
EDG front end was the only one which did to date. And in
earlier discussions, you indicated that it didn't support
export, so it doesn't follow the standards any more than, say,
g++ or the free version of VC++.

--
James Kanze (Gabi Software) email: ja*********@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34

Jun 16 '07 #8

P: n/a
On Jun 16, 10:37 pm, Daniel Kraft <d...@domob.euwrote:
Nikhil Bokare wrote:
I wanted a C++ compiler which would follow the ANSI C++ standards.
If you could tell me an IDE also, it would be more helpful.
I believe G++ (the GNU C++ compiler), which is available freely, might
be a good choice; it is the "standard" on GNU/Linux and nearly all other
Linux-systems, AFAIK.
He asked for a compiler which followed the ISO C++ standards, so
I'm afraid G++ doesn't qualify; there are still important parts
of the standard (e.g. export) which it doesn't implement.

Other than that, of course, it's a pretty good compiler, and
about the only one I could recommend without knowing the target
platform. Since it's the only one that's available on just
about every platform.:-)

--
James Kanze (Gabi Software) email: ja*********@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34

Jun 16 '07 #9

P: n/a
On Jun 16, 9:27 pm, Gennaro Prota <addr...@yahoo.comwrote:
On Sat, 16 Jun 2007 10:33:12 -0700, Nikhil Bokare wrote:
I wanted a C++ compiler which would follow the ANSI C++ standards.
If you could tell me an IDE also, it would be more helpful.
Please, read the FAQ. In particular, see
<http://www.parashift.com/c++-faq-lite/how-to-post.htmland the entry
"Which newsgroup should I post my questions?". Note that almost
everyone will say their compiler is conforming (and you can see an
example here in this thread) but almost none is.
In the strictest sense, none are, because even in the best,
there will almost certainly be a bug or two which affects
conformance. The sad fact, however, is that almost none even
try---Comeau is a major exception.

I just noticed that he didn't say "free", unlike most postings
of this type. So the answer is clear: Comeau
(http://www.comeaucomputing.com/). Not only is it conforming,
but Comeau with the Dinkumware library is probably the best
compiler around in terms of overall quality as well.
Regretfully, the packaging is not up to the same level as the
rest, or wasn't when I tried it, so installing it is enough of a
chore to put off beginners. But that's about the end of the bad
news. Because it is a quality compiler, it has a lot of
options, and because it treats its users honestly, it doesn't
try to pretend that you can use it without understanding them.
And while not free, the price is extremely reasonable.

But the original poster didn't say why he wanted the compiler,
so it is impossible to say what he really needs. If his goal is
more or less to have something that works out of the box, to
play around with and start learning C++, without having to
attack all of the issues involved in producing professional code
in one go, then he likely doesn't need the features missing in
VC++ or g++, and while totally useless in a professional
environment, VC++ and the Visual Studios environment will get
him going easier and faster than having to learn a real editor,
how to write shell scripts and make files, and all the rest.
(If he wants to do professional development, he'll have to learn
these things sooner or later, since using them effectively makes
you a much more effective programmer. But you don't have to
learn everything at once, and there's no harm in starting with
something less powerful, but easier to get started with.)

--
James Kanze (Gabi Software) email: ja*********@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34

Jun 16 '07 #10

P: n/a
On Sat, 16 Jun 2007 12:56:24 -0700, James Kanze wrote:
>On Jun 16, 9:27 pm, Gennaro Prota <addr...@yahoo.comwrote:
>On Sat, 16 Jun 2007 10:33:12 -0700, Nikhil Bokare wrote:
>I wanted a C++ compiler which would follow the ANSI C++ standards.
If you could tell me an IDE also, it would be more helpful.
>Please, read the FAQ. In particular, see
<http://www.parashift.com/c++-faq-lite/how-to-post.htmland the entry
"Which newsgroup should I post my questions?". Note that almost
everyone will say their compiler is conforming (and you can see an
example here in this thread) but almost none is.

In the strictest sense, none are, because even in the best,
there will almost certainly be a bug or two which affects
conformance.
Indeed. In fact, in the initial writing the last occurrence of the
word "almost" was in parentheses. But then I felt I was being a little
too "hasty" (I know of many EDG bugs, for instance, but they
definitely try and be the most meticulous and professional standard
trackers one can think of --the only part they seem to neglect a bit,
last time I checked, is preprocessing)

[...Comeau]
>And while not free, the price is extremely reasonable.
I think I can say without fear of being considered "party" that it is
plain low :-)

--
Gennaro Prota -- Need C++ expertise? I'm available
https://sourceforge.net/projects/breeze/
(replace 'address' with 'name.surname' to mail)
Jun 16 '07 #11

P: n/a

Nikhil Bokare <nb*****@gmail.comwrote in message...
>
I do have GCC with me. But I use Windows platform and (it may feel a
bit stupid but) I am not getting how to use the GCC.
It was .tar file which was freely avaiable.
The easiest way to get GCC(MinGW) on windows is to install 'Dev-C++':

Dev-C++ IDE: http://www.bloodshed.net/

After installation, you can point other IDEs to the GCC(MinGW) compiler
(/bin) or point the 'Dev-C++' IDE to other compilers.

See below my sig for other IDEs ( 'Code::Blocks' is said to be THE new
up-n-comer.)

http://www.gnu.org for docs (be sure to get the ones for your GCC version).

--
Bob R
POVrookie
- -
Code::Blocks http://www.codeblocks.org/
MinGWStudio http://www.parinyasoft.com/
Quincy IDE 2005 DL URL:
http://pipou.net/down/Quincy2005Project.zip
MinGW (GNU compiler): http://www.mingw.org/
Jun 16 '07 #12

P: n/a
On Sat, 16 Jun 2007 12:36:44 -0700, James Kanze wrote:
>On Jun 16, 8:16 pm, Walter Bright wrote:
>Nikhil Bokare wrote:
You can download one for free fromhttp://www.digitalmars.com/download/fre=
ecompiler.html

Does it actually follow the ISO standard? I thought that the
EDG front end was the only one which did to date. And in
earlier discussions, you indicated that it didn't support
export, so it doesn't follow the standards any more than, say,
g++ or the free version of VC++.
Hardly. I tried it and it didn't compile even simple programs that
compile without much ado with current g++ and VC++ versions. I guess
Mr. Bright is more interested in a programming language that is not
C++.
--
Roland Pibinger
"The best software is simple, elegant, and full of drama" - Grady Booch
Jun 16 '07 #13

P: n/a
James Kanze wrote:
On Jun 16, 8:16 pm, Walter Bright <wal...@digitalmars-nospamm.com>
wrote:
>Nikhil Bokare wrote:
>>I wanted a C++ compiler which would follow the ANSI C++ standards.
If you could tell me an IDE also, it would be more helpful.
>You can download one for free fromhttp://www.digitalmars.com/download/freecompiler.html

Does it actually follow the ISO standard? I thought that the
EDG front end was the only one which did to date. And in
earlier discussions, you indicated that it didn't support
export, so it doesn't follow the standards any more than, say,
g++ or the free version of VC++.
DMC++ does not implement export.

------
Walter Bright
Digital Mars C, C++, D programming language compilers
http://www.astoriaseminar.com Extraordinary C++
Jun 16 '07 #14

P: n/a
Roland Pibinger wrote:
I tried it and it didn't compile even simple programs that
compile without much ado with current g++ and VC++ versions.
If you've got a bug report, please report it. You can either email them
to me, or post them in the Digital Mars C++ forums.
Jun 16 '07 #15

P: n/a
On Sat, 16 Jun 2007 15:15:16 -0700, Walter Bright wrote:
>Roland Pibinger wrote:
>I tried it and it didn't compile even simple programs that
compile without much ado with current g++ and VC++ versions.

If you've got a bug report, please report it. You can either email them
to me, or post them in the Digital Mars C++ forums.
My experience is pretty much the same as Roland's. Out of curiosity,
was this

<http://www.digitalmars.com/d/archives/c++/beta/596.html>

fixed?

--
Gennaro Prota -- Need C++ expertise? I'm available
https://sourceforge.net/projects/breeze/
(replace 'address' with 'name.surname' to mail)
Jun 16 '07 #16

P: n/a
Gennaro Prota wrote:
<http://www.digitalmars.com/d/archives/c++/beta/596.html>

fixed?
Not yet, sorry. BTW, nothing in boost is simple.
Jun 16 '07 #17

P: n/a
On Sat, 16 Jun 2007 15:52:40 -0700, Walter Bright wrote:
>Gennaro Prota wrote:
><http://www.digitalmars.com/d/archives/c++/beta/596.html>

fixed?

Not yet, sorry. BTW, nothing in boost is simple.
I don't know, but the example I provided was more than elementary (and
dynamic_bitset<is no rocket science either, really).

--
Gennaro Prota -- Need C++ expertise? I'm available
https://sourceforge.net/projects/breeze/
(replace 'address' with 'name.surname' to mail)
Jun 17 '07 #18

P: n/a
Gennaro Prota wrote:
On Sat, 16 Jun 2007 15:52:40 -0700, Walter Bright wrote:
>Gennaro Prota wrote:
>><http://www.digitalmars.com/d/archives/c++/beta/596.html>

fixed?
Not yet, sorry. BTW, nothing in boost is simple.

I don't know, but the example I provided was more than elementary (and
dynamic_bitset<is no rocket science either, really).
Over 99% of bugs turn out to be reproducible in 10 lines or less.
Whether that makes them elementary or not is debatable - C++ is an
incredibly complicated language. Simple appearing problems can have very
many subtle ramifications.

In the case of that particular problem, the workaround is simple - just
use the same identifier for the type name.
Jun 17 '07 #19

P: n/a
On 16 Jun, 21:58, rpbg...@yahoo.com (Roland Pibinger) wrote:
On Sat, 16 Jun 2007 12:36:44 -0700, James Kanze wrote:
On Jun 16, 8:16 pm, Walter Bright wrote:
Nikhil Bokare wrote:
You can download one for free fromhttp://www.digitalmars.com/download/fre=
ecompiler.html
Does it actually follow the ISO standard? I thought that the
EDG front end was the only one which did to date. And in
earlier discussions, you indicated that it didn't support
export, so it doesn't follow the standards any more than, say,
g++ or the free version of VC++.

Hardly. I tried it and it didn't compile even simple programs that
compile without much ado with current g++ and VC++ versions. I guess
Mr. Bright is more interested in a programming language that is not
C++.
There seems to be some cheap knocking going on here. First producing a
viable C++ compiler is a formidable achievement. Second in Walter
Brights case this work has fed into producing a language offspring of C
++ .. D. Having tried out D, overall I don't see any advantage over C+
+, however I believe that D does have one significant feature which C+
+ could learn a lot from, which is the approch to metaprogramming. I
have done a fair bit of metaprogramming in C++. Metaprogramming is a
great way to construct powerful types. In C++ you can achieve pretty
much what you want, but there are two problems.

First you need to know an awful lot about the C++ language to get
things working. The obvious effect of this is that C++
mertaprogramming is seen as for experts only, which is a shame as
metaprogramming is a beautiful technique which many less experienced
programmers would find rewarding if it was less complicated.

The other problem is that, because the techniques of metaprogramming
in C++ are basically based on hacks, there is a large cost in compile-
time. Once you create simple types using metaprogramming you find that
these can be used in theory to construct more complex types, but there
is a practical limit both in compile time and in compiler resources
which puts a cap on what you can do in practise.

In D metaprogramming has been designed in as part of the language. It
is much simpler to use and also compiles fast. I believe that Daveed
Vandevoorde has been working on a separate metaprogramming language
for C++. It is a shame that the two sides cant get together and try to
look at getting a C++ compiler with these extensions together in a
similar way that the ConceptGCC compiler has been used to test and
prove the Concept ideas.

regards
Andy Little
Jun 17 '07 #20

P: n/a
On Sat, 16 Jun 2007 15:15:16 -0700, Walter Bright wrote:
>Roland Pibinger wrote:
>I tried it and it didn't compile even simple programs that
compile without much ado with current g++ and VC++ versions.

If you've got a bug report, please report it. You can either email them
to me, or post them in the Digital Mars C++ forums.
Already done weeks ago.
--
Roland Pibinger
"The best software is simple, elegant, and full of drama" - Grady Booch
Jun 17 '07 #21

P: n/a
On Jun 17, 12:13 am, Walter Bright <wal...@digitalmars-nospamm.com>
wrote:
James Kanze wrote:
On Jun 16, 8:16 pm, Walter Bright <wal...@digitalmars-nospamm.com>
wrote:
Nikhil Bokare wrote:
I wanted a C++ compiler which would follow the ANSI C++ standards.
If you could tell me an IDE also, it would be more helpful.
You can download one for free fromhttp://www.digitalmars.com/download/freecompiler.html
Does it actually follow the ISO standard? I thought that the
EDG front end was the only one which did to date. And in
earlier discussions, you indicated that it didn't support
export, so it doesn't follow the standards any more than, say,
g++ or the free version of VC++.
DMC++ does not implement export.
So it doesn't follow the ISO C++ standards. This doesn't, in
itself, make it worse than a number of other compilers, but it
does mean that it's not the answer to the original question (any
more than is g++ or VC++), if the original question is to be
taken literally.

--
James Kanze (Gabi Software) email: ja*********@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34

Jun 17 '07 #22

P: n/a
James Kanze wrote:
On Jun 17, 12:13 am, Walter Bright <wal...@digitalmars-nospamm.com>
wrote:
>DMC++ does not implement export.

So it doesn't follow the ISO C++ standards. This doesn't, in
itself, make it worse than a number of other compilers, but it
does mean that it's not the answer to the original question (any
more than is g++ or VC++), if the original question is to be
taken literally.
English isn't a programming language - we don't expect what we say to be
taken *literally* unless someone annotates the description saying so.
One would expect such a question to be worded like:

"Does anyone know of a C++ compiler which is 100% conformant with the
C++ standard?"

instead of:

"I wanted a C++ compiler which would follow the ANSI C++ standards.
If you could tell me an IDE also, it would be more helpful."

which is not even grammatically correct. Do you really think that a
language lawyer would also ask for an IDE? For understanding English,
context is crucial. Pulling sentences out of context and trying to take
them literally is to risk seriously misunderstanding people.
Jun 17 '07 #23

P: n/a
Roland Pibinger wrote:
On Sat, 16 Jun 2007 15:15:16 -0700, Walter Bright wrote:
>If you've got a bug report, please report it. You can either email them
to me, or post them in the Digital Mars C++ forums.

Already done weeks ago.
Thank-you. My apologies.
Jun 17 '07 #24

P: n/a
kwikius wrote:
First you need to know an awful lot about the C++ language to get
things working. The obvious effect of this is that C++
mertaprogramming is seen as for experts only, which is a shame as
metaprogramming is a beautiful technique which many less experienced
programmers would find rewarding if it was less complicated.
A case in point: I attended a presentation by Scott Meyers that involved
doing some C++ template metaprogramming. A lot of the focus was on the
mechanics of what was, essentially, an array of types. It was pretty
clear that manipulating an array of types in C++ is hard, time
consuming, and when you make a mistake, how to fix it is often very
difficult to deduce.

But if it was an array of integers, rather than an array of types, the
presentation would have been over in 5 minutes. This seems to happen a
lot with C++ metaprogramming - once you get past the mechanics and
figure out what the programmer was trying to actually do, it's pretty
simple. And the reason it is simple is because it's *too hard* to do
anything else with C++ TMP.

So, a huge goal with D TMP is to be able to do simple things in a
straightforward, simple manner. One should be able to manipulate an
array of types as easily as an array of ints. Writing templates should
not be harder than writing a function.

The other problem is that, because the techniques of metaprogramming
in C++ are basically based on hacks, there is a large cost in compile-
time. Once you create simple types using metaprogramming you find that
these can be used in theory to construct more complex types, but there
is a practical limit both in compile time and in compiler resources
which puts a cap on what you can do in practise.
Right. Case in point: the factorial template which recursively
instantiates itself to compute a factorial at compile time. For every
iteration, the compiler must:

1) instantiate a template
2) encode the entire state of the template and all previous iterations
into the (mangled) name of the template
3) emit symbol table info (and possibly debug info) for each of these
templates, pretty much making an explosion of output

If you think about it, that's a fantastic amount of processing and
memory required to do something as trivial as a factorial. It is why
complex calculations cannot be done with C++ templates, even if they
theoretically can be. It's why C++ TMP compiles very, very slowly.

In D metaprogramming has been designed in as part of the language. It
is much simpler to use and also compiles fast. I believe that Daveed
Vandevoorde has been working on a separate metaprogramming language
for C++. It is a shame that the two sides cant get together and try to
look at getting a C++ compiler with these extensions together in a
similar way that the ConceptGCC compiler has been used to test and
prove the Concept ideas.
I'm not familiar with Daveed's work, nor did I know he was working on
such a language.

------
Walter Bright
Digital Mars C, C++, D programming language compilers
http://www.astoriaseminar.com Extraordinary C++
Jun 17 '07 #25

P: n/a
On Sun, 17 Jun 2007 11:05:26 -0700, Walter Bright wrote:
>James Kanze wrote:
>On Jun 17, 12:13 am, Walter Bright <wal...@digitalmars-nospamm.com>
wrote:
>>DMC++ does not implement export.

So it doesn't follow the ISO C++ standards. This doesn't, in
itself, make it worse than a number of other compilers, but it
does mean that it's not the answer to the original question (any
more than is g++ or VC++), if the original question is to be
taken literally.

English isn't a programming language - we don't expect what we say to be
taken *literally* unless someone annotates the description saying so.
Thank-you for the explanation. Now I hope we don't have to face
another 200-post thread like the one we had on c.l.c++.m a while ago.
The OP has enough material for making his own deductions.

--
Gennaro Prota -- Need C++ expertise? I'm available
https://sourceforge.net/projects/breeze/
(replace 'address' with 'name.surname' to mail)
Jun 17 '07 #26

P: n/a
On Jun 17, 8:05 pm, Walter Bright <wal...@digitalmars-nospamm.com>
wrote:
James Kanze wrote:
On Jun 17, 12:13 am, Walter Bright <wal...@digitalmars-nospamm.com>
wrote:
DMC++ does not implement export.
So it doesn't follow the ISO C++ standards. This doesn't, in
itself, make it worse than a number of other compilers, but it
does mean that it's not the answer to the original question (any
more than is g++ or VC++), if the original question is to be
taken literally.
English isn't a programming language - we don't expect what we say to be
taken *literally* unless someone annotates the description saying so.
English (like all human languages) has many different levels of
precision. A statement refering to ISO standard's is pretty
precise.
One would expect such a question to be worded like:
"Does anyone know of a C++ compiler which is 100% conformant with the
C++ standard?"
instead of:
"I wanted a C++ compiler which would follow the ANSI C++ standards.
If you could tell me an IDE also, it would be more helpful."
which is not even grammatically correct. Do you really think that a
language lawyer would also ask for an IDE? For understanding English,
context is crucial. Pulling sentences out of context and trying to take
them literally is to risk seriously misunderstanding people.
That's why I added the "if"---if the original question is to be
taken literally. I don't really know what the original poster
is looking for. As you say, would someone who understood
programming well enough to understand what standards conformance
means want an IDE? On the other hand, grammatical or not (and
the grammar errors could be due to sloppy thinking, or to
English not being his native langauge---we don't know), the
question explicitly mentions the standard. Why, if not that he
wanted standards conformance? As I say, I don't know what he
really wants or needs, but DMC++ is not an answer to his
question, as he stated it, any more than is g++ or VC++.

He also didn't state his platform. Now, it's probably a pretty
good guess that it is Windows, but if by chance it is Solaris,
DMC++ probably isn't a good answer either (and neither is VC++).

In fact, the only correct answer is: what do you really want and
need?

--
James Kanze (Gabi Software) email: ja*********@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
Jun 17 '07 #27

P: n/a

James Kanze <ja*********@gmail.comwrote in message ...
He also didn't state his platform. Now, it's probably a pretty
good guess that it is Windows, but....
The OP did state later that (s)he was intending to use window$.
But it sounds like the OP tried to put a Posix(?) version of GCC on the
windows machine.

--
Bob R
POVrookie
Jun 17 '07 #28

P: n/a
On 17 Jun, 19:49, Walter Bright <wal...@digitalmars-nospamm.com>
wrote:
kwikius wrote:
><snip kwikius>
If you think about it, that's a fantastic amount of processing and
memory required to do something as trivial as a factorial. It is why
complex calculations cannot be done with C++ templates, even if they
theoretically can be. It's why C++ TMP compiles very, very slowly.
Yep. However I prefer C++ to D mainly because I have spent quite a
long time learning it and it looks to me like D is becoming just as
complex and quirky as it evolves.

Still I did like the metaprogramming in D.

I would prefer to have my cake and eat it I guess.
In D metaprogramming has been designed in as part of the language. It
is much simpler to use and also compiles fast. I believe that Daveed
Vandevoorde has been working on a separate metaprogramming language
for C++. It is a shame that the two sides cant get together and try to
look at getting a C++ compiler with these extensions together in a
similar way that the ConceptGCC compiler has been used to test and
prove the Concept ideas.

I'm not familiar with Daveed's work, nor did I know he was working on
such a language.
I'm not sure if he still is but there is some info dated April 2003

http://www.open-std.org/jtc1/sc22/wg...2003/n1471.pdf

http://www.vandevoorde.com/Daveed/Ne...es/000015.html.

regards
Andy Little



Jun 18 '07 #29

P: n/a
kwikius wrote:
On 17 Jun, 19:49, Walter Bright <wal...@digitalmars-nospamm.com>
wrote:
>kwikius wrote:
>><snip kwikius>
>If you think about it, that's a fantastic amount of processing and
memory required to do something as trivial as a factorial. It is why
complex calculations cannot be done with C++ templates, even if they
theoretically can be. It's why C++ TMP compiles very, very slowly.

Yep. However I prefer C++ to D mainly because I have spent quite a
long time learning it and it looks to me like D is becoming just as
complex and quirky as it evolves.
That will inevitably happen. However, you can do much more complicated
things with D before the quirkiness sets in. And some day, D will get to
the point where E will become necessary.
Still I did like the metaprogramming in D.
The reports are that the same problems take dramatically less code to do
in D than in C++, and go together much faster.
I would prefer to have my cake and eat it I guess.
Wouldn't we all <g>. But I hear your issue with having spent a lot of
time learning C++. D is designed so most of what people know about C++
can be transferred to D, making it an easy language to master. I know
you already know this, so this is for the lurkers.

>>In D metaprogramming has been designed in as part of the language. It
is much simpler to use and also compiles fast. I believe that Daveed
Vandevoorde has been working on a separate metaprogramming language
for C++. It is a shame that the two sides cant get together and try to
look at getting a C++ compiler with these extensions together in a
similar way that the ConceptGCC compiler has been used to test and
prove the Concept ideas.
I'm not familiar with Daveed's work, nor did I know he was working on
such a language.

I'm not sure if he still is but there is some info dated April 2003

http://www.open-std.org/jtc1/sc22/wg...2003/n1471.pdf

http://www.vandevoorde.com/Daveed/Ne...es/000015.html.
Thank you, I'll have a look.

-------------
Walter Bright
http://www.digitalmars.com C, C++, D programming language compilers
http://www.astoriaseminar.com Extraordinary C++
Jun 18 '07 #30

P: n/a
On 18 Jun, 18:32, Walter Bright <wal...@digitalmars-nospamm.com>
wrote:
kwikius wrote:
<...>
Yep. However I prefer C++ to D mainly because I have spent quite a
long time learning it and it looks to me like D is becoming just as
complex and quirky as it evolves.

That will inevitably happen. However, you can do much more complicated
things with D before the quirkiness sets in. And some day, D will get to
the point where E will become necessary.
The problem I had when I tried D was that there seemed to be no
equivalent to the C++ explicit keyword. Its useful for example value
initialisation of my quan quantity types:

quan::length::mm x(1);

quan::length::mm y = 1; // Error quantity constructor is declared
explicit.

That may seem trivial but its just one of those tools that I am used
to having. However I figured that you have enough feedback and
requests for language features to contend with at the moment, and I
decided I would back off ;-)
Still I did like the metaprogramming in D.

The reports are that the same problems take dramatically less code to do
in D than in C++, and go together much faster.
I would agree with that from the short time I spent trying D out and
it certainly provides a good talking point for a separate C++
metaprogramming scheme, though my current hunch is that that is
unlikely to happen because the current metaprogramming hacks are
becoming firmly embedded, with time spent on honing the hacks ( e.g
variadic templates should help a lot)

The other thing of course is that none of the problems with C++
metaprogramming(compile time, compiler resources) are that visible in
textbooks or lectures... something about style over substance...

The other point is the 'macho' attitude, something I believe
contributed to the success of Dos/Win over Mac. Simply put,
programmers enjoy conquering ugly crap ;-) ( Maybe Linux is in there
too ;-)

<...>
I'm not familiar with Daveed's work, nor did I know he was working on
such a language.
I'm not sure if he still is but there is some info dated April 2003
http://www.open-std.org/jtc1/sc22/wg...2003/n1471.pdf
http://www.vandevoorde.com/Daveed/Ne...es/000015.html.

Thank you, I'll have a look.
It would be interesting to know what you make of it. I would think you
are probably The ideal person to comment, if anybody is.

regards
Andy Little


Jun 20 '07 #31

P: n/a
kwikius wrote:
On 18 Jun, 18:32, Walter Bright <wal...@digitalmars-nospamm.com>
wrote:
The problem I had when I tried D was that there seemed to be no
equivalent to the C++ explicit keyword. Its useful for example value
initialisation of my quan quantity types:

quan::length::mm x(1);

quan::length::mm y = 1; // Error quantity constructor is declared
explicit.

That may seem trivial but its just one of those tools that I am used
to having. However I figured that you have enough feedback and
requests for language features to contend with at the moment, and I
decided I would back off ;-)
There are plans to improve control over implicit conversions for
classes, and I think that will help with this.
>>Still I did like the metaprogramming in D.
The reports are that the same problems take dramatically less code to do
in D than in C++, and go together much faster.

I would agree with that from the short time I spent trying D out and
it certainly provides a good talking point for a separate C++
metaprogramming scheme, though my current hunch is that that is
unlikely to happen because the current metaprogramming hacks are
becoming firmly embedded, with time spent on honing the hacks ( e.g
variadic templates should help a lot)
I don't expect C++ TMP to change in any fundamental way. The C++0x
improvements just twiddle around the edges, there are no fundamental
improvements (other than variadic templates).

The other thing of course is that none of the problems with C++
metaprogramming(compile time, compiler resources) are that visible in
textbooks or lectures... something about style over substance...
I think these problems will get harder and harder to overlook and brush
aside, since there are now examples of how it doesn't have to be that way.

The other point is the 'macho' attitude, something I believe
contributed to the success of Dos/Win over Mac. Simply put,
programmers enjoy conquering ugly crap ;-) ( Maybe Linux is in there
too ;-)
As an old DOS programmer, I can attest that part of the attraction to
DOS was the system was 100% understandable, and one could write programs
that had complete control over the machine. Those days are certainly gone.
Jun 20 '07 #32

P: n/a
On 20 Jun, 21:12, Walter Bright <wal...@digitalmars-nospamm.com>
wrote:
I don't expect C++ TMP to change in any fundamental way. The C++0x
improvements just twiddle around the edges, there are no fundamental
improvements (other than variadic templates).
The major feature of C++0x for me is in making Concepts programming
entities rather than documentation entities.
There are other useful features such as decltype and auto(aka typeof)
which just should have been there with overloaded operators.

There are so many plus points for Concepts that it is another reason
for sticking with C++ ( I am aware that this isnt what you may want to
hear but I'm just laying it out ). Nor do I find it easy to explain.
An interesting example is a power function.

In case of std::pow the power is a runtime value. However in a
particular expression on quantities its not possible to make the power
a runtime value as the type of the result is dependent on it so it
must be a compile time value. To a layman this would appear to be a
limitation, but in practise every variable raisd to a power must
conform to some Concept,probably either a numeric or a quantity.

e.g. Calculate an area y from a length x;

///use doubles

double x =1;
double y = std::pow(x,2);

//use quantities
quan::length::m xx(1);
quan::area::m2 yy = quan::pow<2>(x);

In the first case the concepts are there but hidden, whereas in the
second case they are enforced and the whole expression is strongly
typed and further by revealing the concepts underlying the expression
the pow function has been given much clearer hint for optimisation.
( and the power must be a compile time value)

There are many calculations where, once the concepts are revealed then
values can be moved to compile time.

One area that I have explored and where there can be dramatic
optimisations of an order of magnitude is in 3D matrix concatenation,
where many values are multiplied by 1 or 0. Every 3D matrix is in
fact a type e.g a translation matrix, a rotation matrix etc. The
result type of a concatenation of the basic types is also a specific
type. which can be computed by the compiler from these 'primitive'
input types. ( You can also use quantities or numerics or combinations
within a matrix). Special static types are used for certian values
within the matrix which because all their properties are known at
compile time calculations on them with runtime types are very easy to
optimise away.

It works but...interestingly this is one area where C++ does suffer
really badly and is frustrating because in practise for the compiler
computing the result type of a matrix computation at compile time
reveals very much the problems ( long compile times, running out of
compiler resources (in VC7.1)) discussed previously.

However IMO the results of this work if the practical issues were
solved could be very positive for complexity of 3D games etc, so I'm
continuing plugging away.

hmm.. It might be worth trying this stuff in D and I reckon it would
be a good proof for D over C++. But therin lies another problem. Does
D have an equivalent of for example C++'s enable_if(SFINAE) construct
which gives primitive Concept support and is useful to get this stuff
running or indeed is there more comprehensive support for e.g
overloading based on Concepts planned in D?

(As you can see I am stuck between two cakes, neither with a liberal
enough quota of jam ;-) )

regards
Andy Little


Jun 21 '07 #33

P: n/a
kwikius wrote:
On 26 Jun, 01:49, Walter Bright <wal...@digitalmars-nospamm.comwrote:
>You might find these interesting:

http://www.digitalmars.com/pnews/rea...~ol/physical.d

Yep. I have already seen that. You might want to compare this :

( d code in above url)
<snip>
With this source at:
http://tinyurl.com/2k7ugv
authored by my very self ;-)
<snip>
Ahhh imitation is the best form of flattery ...That's the power of
Quan .... :-)
Guilty as charged. :) I'm well aware of Quan and its history. In fact, I
believe I still have a copy of pqs-1-00-00 lying around somewhere.
physical.d is just a quick hack that took less than an hour to code, and
I was looking for some small examples. I consider the similarities a
homage, but if you feel differently I'd be happy to remove them. I added
a small comment to the file for now.
BTW for those interested, though quan on sourceforge has been sleeping
for some time, I hope that soon she will be back in modified form,
hopefully on her own site, with a similar interface but with a much
more elegant implementation and a lot more comprehensive features,
she's too pretty to die so young ;-)
Sounds interesting!

/Oskar
Jul 3 '07 #34

This discussion thread is closed

Replies have been disabled for this discussion.