Open Watcom Effort Makes First Public Release
epowers writes: "It's been a long time since /. ran this story, but a few days ago the Open Watcom Project made it's first public release. It's only a binary patch targeted at 11.0a/b owners, but it's still an important roadmark on the way to the planned full open source release of both the Watcom C/C++ and Fortran compilers. Most programmers, particularly game programmers, should remember the amount of prestige id software's DOOM generated for the Watcom compiler and the sudden proliferation of 32-bit DOS games with the tell-tale "DOS/4GW" startup banner. The download is available for free, but Open Watcom requests a $1-$50 donation to help support the development effort required to remove code Sybase doesn't own and to prepare the open source release."
More compilers means more techniques applied and evaluated, benefits from compare & contrast, ability to more easily identify errors specific to a compiler and not code, and possibly more generic code in a more diverse environment.\
I don't read ACs: If a post isn't worth so much as a nom de plume to its author then I wont bother either.
I wish EVERY substantial Free/Open software project had a donation page pop up before download. There are several programs that I use regularly for which I would donate when downloading or upgrading.
;-)
In fact, Free/Open software is much more valuable to me than the alternatives.
So in other words, I will only pay for Free software!
(Too bad they use Amazon for their donations, for those of us boycotting them.)
yes, we do need another C/C++ compiler for linux.
The only C compilers for linux are gcc, lcc, and one from intel.
lcc is great for learning about compiler design (that's why it was created), but it doesn't optimize very well, hasn't been stress tested in a real world environment, and has odd licensing issues (you can get the source code for free, but if you want to compile a program and sell it, you need to include a copy of the book as well). Also, the 2 authors are currently Microsoft employees, so you are at the mercy of Redmond.
gcc is the "defacto" standard, but the inline assembler is only slightly less painful than having your asshole ham-slammed to goatse.cx proportions. Also, the since it's licensed under the restrictive GPL license, any programs it compiles contain GPL-licensed code, which makes it impossible to compile and sell closed-source programs with it, unless you pay the "stallman tax", which is one reason commercial linux apps are rarer than pork-eating muslims. Also, gcc is big, slow, requires lots of resources, and produces mediocre code.
Intel's c/c++ compiler is rumored to produce blazingly fast code. However, it is a commercial product, so no linux user has ever used it, and no one really knows if it exists or not.
So yes, another C/C++ compiler would be a good thing for linux.
Very true. GCC is probably the best compiler currently available for targeting code to multiple platforms. However, there are many aspects of a modern compiler that GCC either does not implement, or that GCC implements poorly (for example, the last time I checked, GCC's register allocation was a complete mess). Consequently, while GCC is very useful for those looking for portability or for something free, it's not necessarily the best choice for those in other situations.
... could someone please provide a brief history of what the watcom compiler is or does differently than other compilers, and why it's suited to making DOOM-type games where other compilers aren't?
The OpenWATCOM site wasn't terribly informative. Apparently, this is a big deal since it made Slashdot, but I guess I don't see the significance. Thanks!
The good old Borland C only allowed 16 bits segments. It was really lousy.
There was some hacks to avoid this. I wrote some assembly code to enable the flat mode (only one big linear page up to 2 Gb), and Borland C finally could access 32-bits segments. But the page was still 16-bits by default, so all 32-bits operations had to be prefixed.
I wrote some games and demos with this, but Borland's produced code was very bad. On a version of Borland C, while(1) was compiled as mov ax,1 then test ax, compare with zero and jump if 1 != 0. Awesome.
It's why I tried Watcom. Watcom's code was better. Moreover it had specific optimizations for 486 and Pentium-class processors. And with DOS4GW, it was easy to access 32 bits pages. However :
So Watcom was an excellent compiler, but it was really, really buggy. I always had to review the assembly code by hand. But I liked the fact that "char" was unsigned by default.
Then, I tried DJGPP. DJGPP is a port of GCC to DOS platforms. It cames with a free DOS4GW-like called PMode.
The resulting code wasn't that bad. For floating-point arithmetic, GCC produced slower code than Watcom (can't remember why, maybe GCC didn't use the arithmetic coprocessor). But it didn't matter, demos always use fixed-point anyway.
GCC didn't produce buggy code like Watcom. And the code was...logical. Have a look at Ping for instance. It's a smooth pong-like game with carebears, bonuses, funny sounds, etc. I wrote that game with DJGPP, but if you look at the source code, you'll see that it looks a lot a assembly code. It's designed in a way that the compiler can translate one line of C in one line of assembler, and everything is pre-optimized. GCC respected this. I tried to recompile important parts of the code (sprite routines) with Watcom. The result was illogical. It tried to reorder some stuff, but this only gave slower code.
The first releases of PMode were buggy, too. They worked very bad with Qemm. But then, it got better and finally was an excellent drop-in replacement for DOS4GW. But once and again, allocating a big page was faster than multiple pages.
Why Watcom was cool : fast compiler (gcc was sooo sllooowww to compile), good optimizations for floating-point operations.
Why DJGPP was better : free, comes with emulation of many Unix system calls, gives optimized code if the source code is already optimized. And GNU-assembler syntax is way better than TASM-like syntax.
{{.sig}}