Any non-GPL compilers?

Guess I probably shouldn’t have asked. Sorry…
I don’t suppose there’s anyone here interested in working on a c++ compiler? If so, I’d be interested in hearing about it…

I’m not sure I understand what your intent is.

GCC is under GPL, but binaries created by GCC are not restricted to GPL - is this what your concern is?

BTW, sorry, I was too harsh.

As I understand it, gcc is the only compiler for BeOS or Haiku nowadays – for c++ that is. As for Metroworks, it no longer works with newer versions of BeOS (and definitely not Haiku), right? Also, for compiling Haiku itself, another compiler in another OS would not work would it – MS?, Intel?, Borland?

You can eventually close this thead… though if anyone is really interested in working on a c++ compiler, feel free to contact me. :slight_smile:

http://llvm.org, it seems to be a BSD licensed compiler written in C++.

Odd… I never even heard of that. :slight_smile: Thanks for the info. Is this really a true c++ compiler? How come I never heard of it and nobody uses it? Is it new or not very good or not really a full c++ compiler… or?

How about TenDRA? www.tendra.org

How about TenDRA? www.tendra.org
Funny that you should mention that. I have spoken with one individual who is still working on TenDRA and one who left the project. I am told TenDRA is not a c++ compiler, though they would like to have a c++ compiler. They would be interested in anyone who wanted to join the project to work on a C++ compiler. Also, the TenDRA code is rather poorly done, so the team is now in the process of a major rewrite. Anyways, that is if you really wanted to know all of that info :slight_smile: But still, thanks again. :slight_smile:

On another note, the llvm compiler looks quite interesting… upon further inspection it appears that the compiler is not fully free source… some of it relies on gcc; however, it is still much more feasable to turn something like llvm into a fully free compiler system.

I am a strong advocate for free source (as opposed to copyleft source) because of the freedom I feel the more liberal license gives to coders, hackers, and tinkerers, so I would very much like to see a free source compiler for c++. I still think it would be neat to have. :slight_smile:

In addition, I think things could also be expanded a little… Here’s a general concept:

  1. A c++ compiler and interpreter combination that relies on the same core. In this way changes to the core would affect both the compiler and interpreter; in addition, it would mean interpreted code would run exactly the same (albeit slower) than compiled code, so there’s few quirky differences between the two implementations.
  2. The compiler system would be all free source; no reliance on other code. By free source, I mean the “copycenter” licenses that Haiku allows like public domain, MIT, and BSD.
  3. Potentially integrate into Haiku (and even become the standard compiler for Haiku :slight_smile: ). Wonder if an interpreter included in Haiku could be used in any interesting ways?

Well, to add even more info on llvm…

Benefits of llvm:

  • compiles faster than gcc
  • easier to extend and work on (code) than gcc
  • designed to work better with IDEs than gcc
  • BSD license - I consider this a plus, as it has no copyleft; it’s also compatable with Haiku’s license policy
  • includes a JIT compiler and interpreter (in addition to the regular compiler)

Status:
The main developer working on the front end works for Apple, so it’s likely to be something that will actually get finished. The front end is intended to be for c, c++, and objective c. C is closer to being done than c++ is; to be exact, very little of the c++ front end is done, according to the video.

For Haiku:
I wonder if maybe this project could turn out to be something used to a large degree in Haiku in the future … maybe even as the standard compiler of choice for Haiku?

For Haiku, I’m also curious as to whether an IDE and some interesting designs could be developed around this compiler.

For example, for development purposes, would it be possible to specify portions of code in a program to be run in interpreted mode while the rest gets compiled… then you just change the interpreted mode, re-launch the program and test your new changes right away (no compile time)?

Taking that a step further… what about hot-swapping, where that same interpreted portion of the code gets changed, but instead of re-launching the app, it would show the changes in the program immediately? Although stuff like that is possible with Erlang, I’m not sure how feasible this is with a language like c++ that is not purely functional. There’s an article on doing something like hot-swapping here: http://llvm.org/ProjectsWithLLVM/2003-Fall-CS497YYZ-SPEDI.pdf

So… anyone here have any interest in compilers. What are the possibilities that some of these things could be done (and be useful)?

Some info on llvm.
LLVM is BSD licensed, but does not currently have a front end (the hardest part to make). It currently relies on GCC for the front end. However, I have been told that they are currently working on a front end. There is a video on llvm here:
http://video.google.com/videoplay?docid=1921156852099786640

There is a BSD licensed compiler I read about recently. http://undeadly.org/cgi?action=article&sid=20070915195203&mode=flat&count=0

Hope this helps.

Thanks for the extra link. I saw that same page only a few days ago. :slight_smile:

From what I can tell, PCC is only a C compiler (and not C++), is this correct?

Anyways, according to what I’ve been told, C++ compilers are actually very, very, very hard to make. I have also been told that there is only 2 actual, complete, production quality C++ compilers in the whole world: 1 is commercial, the other is GCC. I have no idea if this is true.
Considering that, it actually seems like a C compiler is rather trivial in comparison to C++ (you can find lots of C compilers, but no C++ compilers).

Having said, that the LLVM project seems like it could solve all of that. The developers are serious about making a C++ compiler (under a BSD license in this case). In fact, Apple hired the main developer of the LLVM project and gave him the freedom to continue working on it.

Bringing all of this back to the Haiku world, I think LLVM might present some great opportunities:
*) We might be able to get support for Java rather easily; LLVM supports Java and allows compiled, JIT, and Interpreted code (your choice).
*) We would end up with an open source, non-copyleft compiler system for Haiku.
*) LLVM, itself, is also faster, easier to maintain, and will support much greater functionality so that we can develop a better IDE for Haiku that would not be possible with GCC.

For the past few weeks, I have been doing some work on the LLVM website with some information about the compiler. At some point, I’d like to see if there might be a group who wants to pursue getting LLVM to a point where we can bundle it with with Haiku as a replacement to GCC.

I don’t suppose there’s any compiler developers on this forum, who might be reading this? :slight_smile:
BTW, if you are looking for info on the new LLVM front-end work, well, the page I’ve been working on is not public yet. Maybe in a few days? :slight_smile: Anyways, if you need it quickly, Lord willing, I could probably email it to you next week.

Kevin, Wikipedia is your friend & provides lots of information.

C++ Compilers:

Gnu gcc is the “de facto standard” ( the norm ) for C / C++ compiler for open source projects. It’ll be tough to dethrone or convince others to switch over to something else, like LLVM. Gcc is very popular.

The GPL license itself is not enough to stop using gcc.

I can’t say how much better LLVM will work but it sure is interesting to look at. I’d first suggest trying out compiling programs on Linux with LLVM and seeing what it can do.

But you have “high hopes” in trying to replace gcc in Haiku. You should talk about it with the developers on the mailing list to see what they think about it.

Interesting…
Would it be ok to provide some more details?

It’s in a kind of quote-reply fashion. :slight_smile:
Maybe it will help clear up some things (that and some of the info, I find to be rather interesting, so maybe someone else will too :slight_smile: ).

I only found out about this earlier, but it appears like the BSD Community has decided to drop gcc for just that reason. (That includes OpenBSD, NetBSD, PC-BSD, maybe FreeBSD, and probably the others.) There is something in the new version of the GPL (I don’t know what it is) that is causing major problems within the BSD community. I haven’t really looked into what the problem is exactly, but if it is a major issue across for the BSD community, then Haiku might need to take note – as it might affect Haiku as well.
Anyways, even without this interesting development, it should be noted that making a change because of licensing is still an honorable and legitimate reason. If it is possible to offer code to the world that is free of restrictions (including the copy-left restrictions in the GPL and LGPL), and get a better program in the process, then I say we should go for it. :slight_smile: [BTW, GCC and other GNU/GPL programs claim to be started because of licensing. In that same line of thought, I think it is fair for someone to suggest that a program be re-done under a non-restictive license.]

[quote]Gnu gcc is the “de facto standard” ( the norm ) for C / C++ compiler for open source projects. It’ll be tough to dethrone or convince others to switch over to something else, like LLVM. Gcc is very popular.[/quote]In recent months, it appears that not only are the BSDs wanting to abandon GCC, but Apple may be as well. The developer of LLVM now works for Apple; in addition, the person at Apple who maintained GCC, is also doing work on LLVM. So, it seems that people are already considering a “switch” away from GCC.
(BTW, I’m not sure if Apple is planning a switch away from GCC or not… nor do I know for sure the reasons for Apple wanting this; it may be a need for better IDE features, or it may be licensing, or both. However, I might could ask if someone wants to know. :))
Additionally, it might also be interesting to note that one of the goals of LLVM is gcc compatability. So, we would not be losing gcc so much as we would be getting a better compiler. GCC is really starting to show its age. Interestingly, GCC actually had problems from the start (those who were heavily involved early on may know more). As it stands right now, GCC suffers from several issues, among which are:
*) It’s slow
*) It uses a lot of memory (more than it needs to)
*) It’s very hard for developers to get involved in and help work on (you have to learn a lot of the compiler before you can get heavily involved).
*) It produces poor diagnostic/error messages – not good for IDEs.
*) The design is not conducive to allowing innovative new features for IDEs and other development tools.
*) The GCC community was rather quirky about implementing (or even allowing others to implement) better features in the compiler. This was mostly true in the past, and may not be so much the case now, but it has resulted in a poorer quality compiler than it could have been.
*) License: the GPL license (and to a lesser extent, every copy-left license) is specifically designed with the goal to “push out”, or to be antagonistic towards, commercial developers. This attitude just doesn’t feel like the true spirit of open source; nor does it appear to demonstrate that self-less spirit of true giving :frowning: – I think we can do better :).

I’ve also heard that Apple & BSD want to switch away from GCC but I have not followed the discussion.

I would imagine that most, if not all, the open source projects out there use GCC because it is free & open source itself.

I’m not saying GCC is the best out there but is the popular choice which is used by the majority of C / C++ programmers and switching to another compiler won’t be accepted as easy. Most coders out there either use GCC or one of the “commercial” C++ compilers.

If you can get LLVM working for Haiku then that would be great. I’m neither for or against LLVM or GCC. If they both work, then I prefer to use the one that gives better optimization or easier to use.

Keep in mind that you really have to convince the Admin Team to go along with replacing GCC with LLVM because they make decisions concerning Haiku.

http://haiku-os.org/about/teams/admin

You’ll find a few of them posting on the mailing list. You should take this discussion there and see what replies you get back.

PS
As for GCC being GPL license. It does not matter because this specifically applies to GCC’s source code only. Any binaries produced by GCC do not inherit GPL license & a project’s source code ( which is being compiled by GCC ) can be under any license the developer wishes ( & the compiled binaries go under that same license ). In other words, GCC’s GPL license does not affect open source projects that use GCC to compile themselves.

“LLVM is BSD licensed, but does not currently have a front end (the hardest part to make). It currently relies on GCC for the front end.”

The frontend for llvm is called clang
http://clang.llvm.org/

[quote=TechnoMancer]Sorry to dredge up a 2 yearold thread but…

[snip]
I think I got clang to compile llvm and clang on haiku too.

Well sorry again for dredging up the old thread but just wanted to update.[/quote]

When and where will it be available?

Sorry to dredge up a 2 yearold thread but…

LLVM is the compiler infrastructure.
clang is the C, C++, Obj-C, Obj-C++, OpenCL… frontend for llvm.

I have been working on getting both compiling and usable in haiku.
Both now compile and work, there may still be issues that I have not come across but I think it should have decent support for haiku now.

I think I got clang to compile llvm and clang on haiku too.

Well sorry again for dredging up the old thread but just wanted to update.

…and what about performance compilers (such as Intel one) ?

Some interesting links:
http://www.linuxjournal.com/article/6766


http://www.cse.scitech.ac.uk/disco/Benchmarks/Opteron_compilers.pdf

http://cmeerw.org/prog/freecpp/
http://www.pathscale.com/

I shall make experimental builds available at http://ports-space.haiku-files.org/ in the next week or so, it will be under sys-devel.

There are some quirks and things in haiku that need to be fixed but haven’t been yet so there will be a file detailing these in the archive, as well as install and minimal use instructions.