Compiler talk

Whether you're a newbie or an experienced programmer, any questions, help, or just talk of any language will be welcomed here.

Moderator: Coders of Rage

Post Reply
User avatar
gamenovice
Chaos Rift Cool Newbie
Chaos Rift Cool Newbie
Posts: 78
Joined: Fri Nov 12, 2010 7:49 pm
Current Project: wii u dev, sdl, and some unity 3D
Favorite Gaming Platforms: PC, GAMEBOY, GAMECUBE, WII, 3DS,PS2
Programming Language of Choice: C#,C++,Java
Location: Tampa,FL
Contact:

Compiler talk

Post by gamenovice »

Hey guys,

So I've been using gcc and g++ for god knows how long now, but every now and then I hear terms like clang, and kinda wonder what all compilers are out there (for now only c/c++) and which would be best to use in some cases. If you guys have any info, I'd love to know.

Also according to falco, gcc sucks ass but I don't really know why...
without code, we wouldnt have life as we know it...
User avatar
dandymcgee
ES Beta Backer
ES Beta Backer
Posts: 4709
Joined: Tue Apr 29, 2008 3:24 pm
Current Project: https://github.com/dbechrd/RicoTech
Favorite Gaming Platforms: NES, Sega Genesis, PS2, PC
Programming Language of Choice: C
Location: San Francisco
Contact:

Re: Compiler talk

Post by dandymcgee »

Real men write their own compilers.

On a more serious note, I've only ever used gcc a few times. Most of my development is done in Visual Studio, so I use the built-in compiler.
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches! :twisted:
User avatar
gamenovice
Chaos Rift Cool Newbie
Chaos Rift Cool Newbie
Posts: 78
Joined: Fri Nov 12, 2010 7:49 pm
Current Project: wii u dev, sdl, and some unity 3D
Favorite Gaming Platforms: PC, GAMEBOY, GAMECUBE, WII, 3DS,PS2
Programming Language of Choice: C#,C++,Java
Location: Tampa,FL
Contact:

Re: Compiler talk

Post by gamenovice »

dandymcgee wrote:Real men write their own compilers.

On a more serious note, I've only ever used gcc a few times. Most of my development is done in Visual Studio, so I use the built-in compiler.
Funnily enough i found a couple of wikibooks about writing your own compiler, which I'll be going through sometime this summer (after I get the snes assembly working...took forever to compile the binaries for it).
links here:
http://en.wikibooks.org/wiki/Compiler_Construction
http://en.wikibooks.org/wiki/How_to_Write_a_Compiler

I actually do what i can to avoid IDEs like the plague, mainly because it feels more satisfying knowing exactly where and how I'm building out my source files and linking everything. That and everytime I try to link dlls or libs using visual studio, i swear to god the interface for doing that makes me feel dyslexic (i always have to rewatch tutorials on how to do it for some reason :\)
without code, we wouldnt have life as we know it...
User avatar
Falco Girgis
Elysian Shadows Team
Elysian Shadows Team
Posts: 10294
Joined: Thu May 20, 2004 2:04 pm
Current Project: Elysian Shadows
Favorite Gaming Platforms: Dreamcast, SNES, NES
Programming Language of Choice: C/++
Location: Studio Vorbis, AL
Contact:

Re: Compiler talk

Post by Falco Girgis »

GCC isn't so bad if you're on Linux or a Mac, but it's a horrible piece of shit on Windows (MinGW), and considering the fact its main benefit to a developer is platform independence, I would dare say that's pretty shitty. Unfortunately pretty much every microprocessor and operating system supports GCC as its primary compiler, so it's not like it'll go anywhere anytime soon... I pretty much want to throw my Macbook through the fucking WIndows when it takes 15+ minutes to do a fresh build on ESTk, and it's 3+ minutes just to link the executable after I change a single line. Then the exact same code on the exact same machine compiles and links in just a few minutes when I boot to my OSX partition... MinGW (Minimal GCC for Windows) is notoriously shittily written and does all kinds of asinine dynamic memory allocations in the background slowing everything down... It's a slow resource hog.

Fortunately CLANG is really starting to gain some grounding, at least on Linux and OSX. It's supposedly compatible with GCC object code, supports almost every feature of GCC, and it is FAR less of a resource hog. It's actually pretty damn impressive... It's also outperforming GCC-compiled executables in terms of size and speed as well.

I was a Visual Studio loyalist for about 5 years, back during Visual Studio 2010. It's a great compiler, really offering an unbeatable development environment on Windows that is a billion times more user-friendly than XCode on OSX or Make/CMake on Linux systems. Unfortunately it's platform dependent (although supposedly this is now changing), and it was very slow to implement the C++11 standard, which pushed me away years ago.

I swear by Qt Creator as my multiplatform IDE. It's by far the most intuitive environment, utilizing MinGW on Windows, and GCC or CLANG on OSX and Linux as its back-end compiler. The Qt "project files" offer an almost Makefile-like level of control over the build process without the hassle of writing your own (Qt basically converts your project to a makefile for you)... and unlike Code::Blocks and every other "supposedly" cross-platform IDE, Qt Creator ACTUALLY works identically on each platform, which is insanely important to me considering how many builds we're supporting with ES.

So there's my 2 cents...
User avatar
gamenovice
Chaos Rift Cool Newbie
Chaos Rift Cool Newbie
Posts: 78
Joined: Fri Nov 12, 2010 7:49 pm
Current Project: wii u dev, sdl, and some unity 3D
Favorite Gaming Platforms: PC, GAMEBOY, GAMECUBE, WII, 3DS,PS2
Programming Language of Choice: C#,C++,Java
Location: Tampa,FL
Contact:

Re: Compiler talk

Post by gamenovice »

so crossplatform aside, what reasons would I choose visual studio over Qt?
without code, we wouldnt have life as we know it...
User avatar
dandymcgee
ES Beta Backer
ES Beta Backer
Posts: 4709
Joined: Tue Apr 29, 2008 3:24 pm
Current Project: https://github.com/dbechrd/RicoTech
Favorite Gaming Platforms: NES, Sega Genesis, PS2, PC
Programming Language of Choice: C
Location: San Francisco
Contact:

Re: Compiler talk

Post by dandymcgee »

gamenovice wrote:so crossplatform aside, what reasons would I choose visual studio over Qt?
For C++, I can't think of a single reason. Both have incredible debuggers and are great environments for general purpose development

I do most of my work (job work) in C#, which obviously requires Visual Studio. The amount of shit it does for you is an insane time-saver for rapid prototyping and rapid development. When you're writing an application that runs on $10,000 dedicated server a few times a day, your boss doesn't really give a fuck if it takes 0.2 seconds or 3 minutes to analyze yesterday's data. Your boss cares about how many hours you're going to spend writing it.

So basically:
Windows development? Visual Studio.
Cross-platform? Qt Creator.

Everything else is personal preference. Try them both, you'll undoubtedly like one better.
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches! :twisted:
K-Bal
ES Beta Backer
ES Beta Backer
Posts: 701
Joined: Sun Mar 15, 2009 3:21 pm
Location: Germany, Aachen
Contact:

Re: Compiler talk

Post by K-Bal »

Maybe you should just stop worrying about this. Use something that fulfills all your needs. You might come to point where you realize your compiler is not the right tool. That is the right point to start looking for alternatives.

Personally, I'm using QtCreator with GCC on Linux at work and at home, although I don't really have big projects for which I care a lot about compile time. I also have a clang compiler environment set up, just in case I want to compare some builds.

Btw, I also lately became a fan of clang-format. I can't imagine coding without it anymore.
Post Reply