User forums > General (but related to Code::Blocks)

pro's and pre's of compilers

<< < (4/7) > >>

thomas:
You're of course right, one has to use the tool that does the job. If gcc does not do you, it is quite obviously not your tool.

Now, what is "coolness", how to explain in less than 5000 words :)

Just two examples:
(1) gcc's extended inline assembly is a good example of "coolness". Instead of having to remember registers and reading from a memory reference inside your assembly (which you can still do of course, if you absolutely want), you can basically tell the compiler: "Listen up, moron. I don't care what you happen to have in any of your registers. I want to use these variables in my assembly, and I want you to do these instructions with those values."
You can specify about everything from "use something" or "use some data register" to "use this specific register". Gcc will make something out of it. If your variable happens to be in a register anyway, this register will be used. If gcc must free a register and it knows that the value is not being used in that function any more, it can just do so without the hassle of saving and restoring values. In all other cases, it does the same stuff you would otherwise have done, too, but you don't need to care. Oh yes, and it runs cse elimination and instruction scheduling beyond asm boundaries unless you tell it not to.
If you happen to need a cmpxchg8b in your code, and objdump -dS shows exactly one opcode inserted for that instruction (well, two, if you count in "lock"), then this is quite awesome. That may be a bad example because in the meantime, there is probably an intrinsic function for that particular operation (is there, don't know?), but you get the idea. The principle is cool.

(2) Attributes. Need I say more :)

Another reason why I like gcc is that it is free, of course. MSVC toolkit is not free. Mabye it does not cost anything, but it is not free. Free software is cool, too, in some way.

Vampyre_Dark:
:lol: I'll have to trust you on 1, as I don't use assembly.

:( What are attributes?

However, I happen to think that gcc's free is not really free.

GCC / MinGW
+ Doesn't cost anything.
+/-  Do what you will with it, but here is a license that dictates what you really want to do with it, and what you SHOULD do with it. If you do x, you MUST do y. Also, don't ask anybody about this license, as everyone will give you a different answer, and nobody really knows for sure. Also, we will force this license on anyone who wants to use this free stuff.
- MinGW might as well not exist when it comes to support from certain libraries, or examples. (Obviously that's not an issue to some, but we live in a windows world.)

VC++Toolkit:

+ Doesn't cost anything.
+ Do what you will with it.
-  Vendor Lock In. (Only an issue to some, and then maybe not. Depending on the code written.)
-  Apparently isn't cool.

AkiraDev:

--- Quote from: Vampyre_Dark on August 17, 2005, 01:47:22 pm ---:lol: I'll have to trust you on 1, as I don't use assembly.

:( What are attributes?

However, I happen to think that gcc's free is not really free.

GCC / MinGW
+ Doesn't cost anything.
+/-  Do what you will with it, but here is a license that dictates what you really want to do with it, and what you SHOULD do with it. If you do x, you MUST do y. Also, don't ask anybody about this license, as everyone will give you a different answer, and nobody really knows for sure. Also, we will force this license on anyone who wants to use this free stuff.
- MinGW might as well not exist when it comes to support from certain libraries, or examples. (Obviously that's not an issue to some, but we live in a windows world.)

VC++Toolkit:

+ Doesn't cost anything.
+ Do what you will with it.
-  Vendor Lock In. (Only an issue to some, and then maybe not. Depending on the code written.)
-  Apparently isn't cool.

--- End quote ---

Regarding the GPL, the notion that it restricts the developer's freedom is nothing but FUD.

Here's a few things we should keep in mind.
As long as you don't make any changes to the source code, you are free to use it in whatever form you like - commercially or not. Of course, if you distribute a GPL'ed program, you should also distribute or in some way indicate the program user where to find it's unchanged source code - which does not even affect you, since it is the very same source code that was available to you in the first place.

If you change the program, distribute the adapted source code as well. If you do not whish to distribute the altered version source code, well, rewrite it from scratch and use any ideas or notions you find useful - unless there are patents involved, but don't blame the GPL on that :lol:. This "restriction" is merely a defense mechanism against greedy developers who like to rip off other people's work.

Now the issue which often raises confusion is what happens with LGPL'ed code - such as that of libraries.

People often think that if you so much as link to a LGPL library, you proprietary code becomes "infected" by the GPL - this is FUD!
You can link dinamically to a LGPL library and your own code, while depending on said library, does not even become open-sourced. This means the following: you can build commercial software on top of LGPL (notice, not GPL) code, provided the code is not mixed. This means that nothing prevents software companies fom making commercial programs to run on Linux, as some already do.

Oh, and it is becoming less of a windows only world, btw - fortunately!

thomas:

--- Quote from: Vampyre_Dark on August 17, 2005, 01:47:22 pm ---GCC / MinGW
+ Doesn't cost anything.
+/-  Do what you will with it, but here is a license that dictates what you really want to do with it, and what you SHOULD do with it. If you do x, you MUST do y. Also, don't ask anybody about this license, as everyone will give you a different answer, and nobody really knows for sure. Also, we will force this license on anyone who wants to use this free stuff.
--- End quote ---

Where do you derive this from? Honestly, I do not see such thing in there:

--- Quote from: www.mingw.org/licensing.shtml ---MinGW runtime:MinGW base runtime package is uncopyrighted and placed in the public domain. This basically means that you can do what you want with the code.
w32api: You are free to use, modify and copy this package. No restrictions are imposed on programs or object files compiled with this library. You may not restrict the the usage of this library. Blah blah, no warranty...
gcc, make, etc. : GNU General Public License.

--- End quote ---
Maybe it is the GPL that you don't read correctly. If you build a compiler based on gcc's sources (or some other derivative work) or if you borrow code from its parser or whatever, then the program you produce must be licensed under the GPL.
If you just compile your own programs, then you are free to do whatever you want. Of course they would prefer seeing you write free software, but you are not compelled to do so.

EDIT:
Oh by the way... Do you realize that following your reasoning, you should not use code::blocks at all?
code::blocks is licensed under the GPL, so if you edit your sources with it, all your programs must follow that license :P

Vampyre_Dark:
I understand that. But You can't preach one thing, and then do another thing in practice. There are other free-er licenses, and they don't require what the GPL requires.

OpenGL is a free library. It doesn't place any restrictions on me.

DirectX is a free library. It doesn't place any restrictions on me.

I picked up a small utility library to help me with OpenGL extensions the other day. It's free to use and all you have to do is place credit for using it.

Freedom with a bunch of catches isn't really free. Look at what happened when they tried to post about codeblocks on the gcc forum. :) Where was the freedom there?

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version