FreeBasic in GCC?

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

FreeBasic in GCC?

Postby Nxx » Feb 02, 2009 5:52

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

Postby jdebord » Feb 02, 2009 10:37

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?

Postby AGS » Feb 03, 2009 0:20

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

Postby TheMG » Feb 03, 2009 0:27

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:

Postby HD_ » Feb 03, 2009 0:40

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

Postby TheMG » Feb 03, 2009 0:41

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

Postby VirusScanner » Feb 03, 2009 4:18

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

Postby BastetFurry » Feb 03, 2009 11:29

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

Postby marcov » Feb 03, 2009 15:15

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

Postby Trenton_net » Feb 03, 2009 16:24

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:

Postby John Spikowski » Feb 03, 2009 17:35

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

Postby TheMG » Feb 03, 2009 17:37

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

Postby Imortis » Feb 03, 2009 17:41

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:

Postby John Spikowski » Feb 03, 2009 18:20

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

Postby TheMG » Feb 03, 2009 22:10

How is the windows version different?

Return to “Community Discussion”

Who is online

Users browsing this forum: No registered users and 3 guests