Microsoft's C/C++ compiler freely available

P

Phil Tomson

Thought this might be interesting to those stuck on win32...

http://www.winprog.org/tutorial/msvc.html

Of course, I only care for so much longer, since my Powerbook is on order
;-)

Another one makes the switch ;-) At OSCON this summer it seemed like
something close to half of the people had Powerbooks. It certainly looks
like OSX is making huge gains in the development community.

I'd really like to get one of those Powerbooks too, but can't seem to
figure out how to either come up with the $$ or convince Apple to give me
one ;-) So when I was last at Fry's drooling over one of those
new dual G5 boxes I did a 'ruby -v' at the commandline and found that it
had version 1.6.8, not 1.8.0. As I recall, we were trying to get 1.8.0
out in time to make it into OSX 10.3 - were we just too late?


BTW: I also noticed that Ruby is on the Knoppix 3.3 CD (again it's 1.6.8)
- I was kind of surprised (pleasantly) to find it there.

Phil
 
D

Daniel Carrera

Question:
Why would you want to use Microsoft's C/C++ compiler when gcc is
available? No sarcasm. This is an honest question.

* I saw a benchmark of compilers in which gcc and MS shared the second
place (1st was Intel):

http://www.willus.com/ccomp_benchmark.shtml?p1

(see the update for Sep 10/02)
This is impressive considering that Intel and MS only cater to one
hardware platform, whereas gcc caters to many.

* Given the above, wouldn't it make sense to use a compiler that isn't
tied to one particular hardware? Especially if you plan on using more
than one hardware.

Cheers,
Daniel.
 
D

Daniel Carrera

GCC on a win32 platform?

Zach


Yes.

http://www.mingw.org/

MinGW's port of gcc is what the author tested in his benchmarks. It tends
to be a little behind the GNU port of gcc, but not much (I don't think).

Cheers,
Daniel.

-----Original Message-----
From: Daniel Carrera [mailto:[email protected]]
Sent: Saturday, November 15, 2003 3:26 AM
To: ruby-talk ML
Subject: Re: Microsoft's C/C++ compiler freely available


Question:
Why would you want to use Microsoft's C/C++ compiler when gcc is
available? No sarcasm. This is an honest question.

* I saw a benchmark of compilers in which gcc and MS shared the second
place (1st was Intel):

http://www.willus.com/ccomp_benchmark.shtml?p1

(see the update for Sep 10/02)
This is impressive considering that Intel and MS only cater to one
hardware platform, whereas gcc caters to many.

* Given the above, wouldn't it make sense to use a compiler that isn't
tied to one particular hardware? Especially if you plan on using more
than one hardware.

Cheers,
Daniel.

Thought this might be interesting to those stuck on win32...

http://www.winprog.org/tutorial/msvc.html

Of course, I only care for so much longer, since my Powerbook is on order
;-)


Nathaniel

<:((><

--
Daniel Carrera | Aleph-0 bottles of beer on the wall, Aleph-0 bottles
PhD student. | of beer. Take one down, pass it around, Aleph-0
Math Dept. | bottles of beer on he wall...
UMD, | http://mathworld.wolfram.com/Aleph-0.html
 
G

Gour

Daniel said:
http://www.mingw.org/

MinGW's port of gcc is what the author tested in his benchmarks. It tends
to be a little behind the GNU port of gcc, but not much (I don't think).

And with MSYS you get practically the same comfort as on Linux i.e.
configure; make ; make install :)

Sincerely,
Gour
 
M

Mauricio Fernández

- Binary compatibility? I seem to remember someone saying that a Ruby
built with Mingw cannot load extensions that are built with MSVC, and vice
versa. And unlike Linux and its brethren (cousins, ancestors, etc), it is

I have been compiling extensions with Mingw and using them with Andy's
MSVC Ruby build.

It's quite a PITA however, since you have to either modify rbconfig.rb
to use Mingw or build ruby w/ Mingw, and then run (w/ that binary)
ruby extconf.rb # using the fresh-built Ruby (using Mingw)
make
... now make install won't do what you want so you'd have to install
by hand or
ruby extconf.rb
make install
using the MSVC ruby binary.

MSVC being free (beer) is good news.


--
_ _
| |__ __ _| |_ ___ _ __ ___ __ _ _ __
| '_ \ / _` | __/ __| '_ ` _ \ / _` | '_ \
| |_) | (_| | |_\__ \ | | | | | (_| | | | |
|_.__/ \__,_|\__|___/_| |_| |_|\__,_|_| |_|
Running Debian GNU/Linux Sid (unstable)
batsman dot geo at yahoo dot com

'Mounten' wird für drei Dinge benutzt: 'Aufsitzen' auf Pferde, 'einklinken'
von Festplatten in Dateisysteme, und, nun, 'besteigen' beim Sex.
-- Christa Keil
 
D

Daniel Carrera

I'm certainly not saying "You're an idiot if you use Mingw instead of
MSVC!"; if it works for you, great! But I am saying that one should use the
right tool for the job,

Thank you for the disclaimer.

I don't use MinGW for the simple reason that I don't use Windows. My
comments and my views come from gcc under Linux, Solaris and AIX. Under
these systems, gcc is fantastic. Certainly better than the Sun compiler.
I find it easier to use, and much more dependable.

You asked a non-sarcastic question, and this is my attempt at a
non-sarcastic answer. I hope it helps answer your question, but it is NOT
intended to start a holy war. Again, if you prefer using something like
Mingw on your computer, great. I don't.

Thank you for the disclaimer. I wondered for a second. It WAS just a
question. I don't use MinGW, like I just said.

Cheers,
 
C

Chris Thomas

I don't use MinGW for the simple reason that I don't use Windows. My
comments and my views come from gcc under Linux, Solaris and AIX.
Under
these systems, gcc is fantastic. Certainly better than the Sun
compiler.
I find it easier to use, and much more dependable.

That may not be difficult. Historically, Unix vendor compilers have
tended to suck. IMHO, GCC is adequate. I wouldn't call it "fantastic."
They're working on it, however. Each release is an improvement.

Chris
 
D

Daniel Carrera

That may not be difficult. Historically, Unix vendor compilers have
tended to suck. IMHO, GCC is adequate. I wouldn't call it "fantastic."
They're working on it, however. Each release is an improvement.


Well, I love it. It makes good code, fairly fast, not too large, it
complies things I'd expect it would, and it has a significant collection of
options. It comes with a debugger. I like the --Wall flag. I think that
it's conceptually better than the 'lint' program used by other unices (or is
it just Sun?). I don't like the idea of using different programs for
compiling and syntax checking, since they might have slightly different
ideas of what constitutes good code.

What problems have you had with it?

Cheers,
 
M

Martin Weber

Okay, we're getting way OT here..

(...) I like the --Wall flag. I think that
it's conceptually better than the 'lint' program used by other unices (or is
it just Sun?). (...)

Nope(*). lint by itself is a very nice tool for checking code for, let's say
valid but dubious C code. Consider the following two examples:

switch (ayaken) {
case BANZAI:
fprintf(stderr, "woohoo! banzai!\n");
default:
abort();
}

and

switch (ayaken) {
case BANZAI:
fprintf(stderr, "woohoo! banzai!\n");
/* FALLTHROUGH */
default:
abort();
}

gcc -Wall won't complain about either of these (except BANZAI/ayaken
might be an enum and we don't cover all of it here), but the second
case is lint-safe. It also documents that it is *no* forgetting of the
break;. lint checks code on another dimension than gcc. It also catches
(some/many/an awful lot of) problems gcc doesn't/can't/won't ever. The
use of lint is totally orthogonal to (g)cc -W<anything>. I think there's
a fair amount of documentation about the use of lint and where it makes
sense and where it doesn't. AFAIK there's even an O'Reilly Book (Code
checking with lint or sth similar).

I wouldn't call gdb (an absolutely orthogonal tool not having anything
to do with gcc except for reading debugging information from the executable
which gcc put there -- any compiler can do that) a useless tool either ...

Nor gprof, dmalloc or other allocation checker (programs or libraries).
Those are just a bunch of development tools, and using them wisely, and
knowing how to use them, WILL improve the quality of (C-) code you are
writing. Agreeing to their standards (most of the time) means agreeing to
what commonly is viewed as 'good' C-Code.

With kind regards,

-Martin

(*): Any unix should have a lint, really. BSD has one, I suppose linux
has one, too (mutter: although my last base installation didn't even have
RCS!!!), and it's fine solaris has one, too.
 
O

Ollivier Robert

had version 1.6.8, not 1.8.0. As I recall, we were trying to get 1.8.0
out in time to make it into OSX 10.3 - were we just too late?

At least it is complete with headers and libruby.dylib, something that was
missing in 10.2. Anyway, Ruby 1.8.1 and the CVS version compile w/o
problems. Be sure to have libreadline installed before recompiling or you
won't get readline support in irb.
 
O

Ollivier Robert

comments and my views come from gcc under Linux, Solaris and AIX. Under
these systems, gcc is fantastic. Certainly better than the Sun compiler.
I find it easier to use, and much more dependable.

That's true except for code quality. The proprietary compilers on Sun,
DEC^WCompaq^WHP and Intel (icc) are generally way better in code generation
than gcc. The main thing about gcc is that it is there and free.
 
B

Benjamin Peterson

Daniel Carrera said:
Question:
Why would you want to use Microsoft's C/C++ compiler when gcc is
available? No sarcasm. This is an honest question.


A better question these days might be: why would you want to use
Microsoft's C/C++ compiler when their C# compiler (and the .NET build
tools and runtimes) are also free?
 
R

Richard Kilmer

I tried working with Apple to do this (with special thanks to James
Duncan
Davidson) but it was just too late. They had already committed to
golden
master before 1.8 was finalized :-(
At least it is complete with headers and libruby.dylib, something that
was
missing in 10.2. Anyway, Ruby 1.8.1 and the CVS version compile w/o
problems. Be sure to have libreadline installed before recompiling or
you
won't get readline support in irb.

Yeah, I have a blog post on how to do it here:

http://richkilmer.blogs.com/ether/2003/10/building_ruby_1.html

-rich
 
F

Frank Schmitt

A better question these days might be: why would you want to use
Microsoft's C/C++ compiler when their C# compiler (and the .NET build
tools and runtimes) are also free?

Because C/C++ are both platform-independent?
Because C# is yet another obsolete offspring of C/C++?
Because I don't want garbage collection in my compiled language of choice?
Because I want templates?
Because...

oh well, enough rant for now :)
regards
frank
 
J

Josef 'Jupp' SCHUGT

Hi!

* Frank Schmitt; 2003-11-24, 13:08 UTC:
Because C/C++ are both platform-independent?

C# is platform-independent, too. Microsoft's C# compiler is not the
only one...
Because C# is yet another obsolete offspring of C/C++?

I wouldn't call it obsolete unless there is a good Ruby compiler...
Because I don't want garbage collection in my compiled language of
choice?

Most programs dynamically allocate and free memory so garbage
collection is a must. What you are talking about is *automatic*
garbage collection. In C# you can manually collect garbage or you can
have C# do that for you - it is possible to have both in one program.
Because I want templates?

Yes, that's a problem but MS is working on that. The major problem
with upcoming templates is that 'slipping deadline' brand campaign.

Josef 'Jupp' Schugt
 
N

Neil Spring

I tried working with Apple to do this (with special thanks
to James Duncan Davidson) but it was just too late. They
had already committed to golden master before 1.8 was
finalized :-(

Richard,

If you have a contact at apple managing Ruby, would you forward
a concern of mine along, or direct me (off list if appropriate)
to the proper way to report a problem with the ruby install on
OS X 10.3.1?

In rbconfig.rb, there are two oddities. First, CFLAGS includes
"-arch i386 -arch ppc", twice. I think this is very odd.

Second, and more importantly because it initially broke my
attempts to use rbconfig.rb to autoconfigure a modified ruby
interpreter,

CONFIG["LIBRUBY_A"] = "lib$(RUBY_INSTALL_NAME).a"
CONFIG["LIBRUBY_SO"] = "lib$(RUBY_INSTALL_NAME).so.$(MAJOR).$(MINOR).$(TEENY)"
CONFIG["LIBRUBY_ALIASES"] = "lib$(RUBY_INSTALL_NAME).so"
CONFIG["LIBRUBY"] = "$(LIBRUBY_A)"
CONFIG["LIBRUBYARG"] = "$(LIBRUBY_A)"

however, ".so" is not a shared library extension on these
machines (dylib is the proper extension) and libruby.a is
not installed (apparently apple dislikes static linking).
It would be great if I could test for the existence of
LIBRUBY_SO in libdir, or just compile with LIBRUBYARG. It's
hard for me to figure out how to use these rbconfig entries
to automatically discover how to build and install add-ons,
and I don't remember having this difficulty with fink's ruby
on jaguar.

thanks,
-neil
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,734
Messages
2,569,441
Members
44,832
Latest member
GlennSmall

Latest Threads

Top