FreeBasic in GCC?

General discussion for topics related to the FreeBASIC project or its community.
Nxx
Posts: 32
Joined: Dec 23, 2007 20:50

FreeBasic in GCC?

Post by Nxx »

Will FreeBasic ever be included in GCC along FreePascal which is already there?
jdebord
Posts: 547
Joined: May 27, 2005 6:20
Location: Limoges, France
Contact:

Post by jdebord »

As far as I know, FreePascal does not depend on GCC. It's GPC (GNU Pascal) which depends on it.

As with FB, it's still an independent project. I think the integration with GCC is planned, but no date has been given.
AGS
Posts: 1284
Joined: Sep 25, 2007 0:26
Location: the Netherlands

Re: FreeBasic in GCC?

Post by AGS »

Nxx wrote:Will FreeBasic ever be included in GCC along FreePascal which is already there?
FreePASCAL is not included in GCC.

The FreeBASIC compiler uses the GCC toolchain (assembler, linker) to aid in compiling a FreeBASIC program.

To be included in GCC there would have to be a FreeBASIC frontend to GCC. This frontend would be a FreeBASIC parser that translates FreeBASIC sourcecode into 'something' the GCC backend can understand (some sort of abstract syntax tree). No one has written such a frontend yet and afaik no one is writing one.

There are plans to build a FreeBASIC-to-C translator. That way GCC could be used without the need to write a FreeBASIC frontend to GCC.
Some work has been done on this translator and more work needs to be done on it (it's not ready to be 'officially' released yet).
TheMG
Posts: 376
Joined: Feb 08, 2006 16:58

Post by TheMG »

Converting to C sounds very slow. It will practically double every compile time. More, I would expect, as GCC has a lot of optimization.
HD_
Posts: 215
Joined: Jun 10, 2006 12:15
Contact:

Post by HD_ »

It's not as bad as it sounds- if the current compiler is still an option, then you would only need the c compiler for a release version.
TheMG
Posts: 376
Joined: Feb 08, 2006 16:58

Post by TheMG »

Unless even testing required speed increases only GCC can offer. Or new functionality (OOP) is introduced for GCC only.
VirusScanner
Posts: 775
Joined: Jul 01, 2005 18:45

Post by VirusScanner »

I don't think it would be, since the current C backend doesn't emit C++, only plain C, and since current FB has everything plain C does (as far as I know), there would be no reason to have features in only C mode.
BastetFurry
Posts: 255
Joined: Jan 05, 2006 0:56

Post by BastetFurry »

Would it?
What about coding AVR/PIC/InsertOtherMCUHere Stuff in FreeBASIC?
marcov
Posts: 3462
Joined: Jun 16, 2005 9:45
Location: Netherlands
Contact:

Post by marcov »

BastetFurry wrote:Would it?
What about coding AVR/PIC/InsertOtherMCUHere Stuff in FreeBASIC?
What about it? Do you think that FB is particularly suitable for this?
Trenton_net
Posts: 44
Joined: Jun 16, 2008 1:42

Post by Trenton_net »

FBC --> GCC would totally be neat. Something that could forever push it over the edge to being something really portable.
John Spikowski
Posts: 453
Joined: Dec 24, 2005 2:32
Location: WA - USA
Contact:

Post by John Spikowski »

Trenton_net wrote:FBC --> GCC would totally be neat. Something that could forever push it over the edge to being something really portable.
Wouldn't this make FreeBASIC a translator like BCX rather then a Basic compiler? I thought Victor was clear that the design of FreeBASIC was to create a Basic compiler that would be expanded using it's own core language syntax.

If you need a C intermediate step, use BCX. They are both GPL open source projects so there shouldn't be a competitive attitude about using either.

Maybe I'm missing the point/reason for changing FreeBASIC's direction and all the hard work getting the project this far. I'm seeing slow progress just getting to 1.0. A total rewrite to create another Basic to C translator seems like blue sky thinking to me. IMHO
TheMG
Posts: 376
Joined: Feb 08, 2006 16:58

Post by TheMG »

I agree that a C translator just seems like an easy way out.
Imortis
Moderator
Posts: 1924
Joined: Jun 02, 2005 15:10
Location: USA
Contact:

Post by Imortis »

Actually, the C emitter is not the default. It is an option. The purpose for which is that you could compiler with FB for WIN, LIN, DOS, but if you needed Mac, or something similar, you can emit C code and compile for that hardware. It is not supposed to be used all the time.

Plus, right now it only sort of works...
John Spikowski
Posts: 453
Joined: Dec 24, 2005 2:32
Location: WA - USA
Contact:

Post by John Spikowski »

FreeBASIC for Windows seems to be the most mature and feature rich version being offered. If I needed to run my FreeBASIC application on Linux or the Mac, I would use CrossOver/Wine. It works great and runs at native platform speeds with all the benefits of the winapi in your toolbox. (including COM support)

It would be great if Matthew (counting_pine) would post what the goals for 1.0 are and finish the project that was started before doing a 180 at the 11th hour.
TheMG
Posts: 376
Joined: Feb 08, 2006 16:58

Post by TheMG »

How is the windows version different?
Post Reply