How many generators currently available?

General discussion for topics related to the FreeBASIC project or its community.
Post Reply
Cretin Ho
Posts: 182
Joined: Feb 04, 2021 13:01

How many generators currently available?

Post by Cretin Ho »

I know there are gcc, gas and emscripten. Don't know if there are more generators available.

Meanwhile, I wonder what would happen if we have gen g++ (generate C++ sources instead of C sources) and gen fpc (generate Free Pascal sources and use the fpc compiler to produce binaries) generators? It would be fun, I think. But I know there is no points for these generators to exist at all.
marcov
Posts: 3454
Joined: Jun 16, 2005 9:45
Location: Netherlands
Contact:

Re: How many generators currently available?

Post by marcov »

I think a non GCC compiler backend like Visual Studio would be the logical next step.
Cretin Ho
Posts: 182
Joined: Feb 04, 2021 13:01

Re: How many generators currently available?

Post by Cretin Ho »

marcov wrote:I think a non GCC compiler backend like Visual Studio would be the logical next step.
Following this logic I would vote for LLVM IR over Visual Studio. BTW, I have just looked at the compiler's code. The LLVM IR target seems to be already available.
marcov
Posts: 3454
Joined: Jun 16, 2005 9:45
Location: Netherlands
Contact:

Re: How many generators currently available?

Post by marcov »

Cretin Ho wrote:
marcov wrote:I think a non GCC compiler backend like Visual Studio would be the logical next step.
Following this logic I would vote for LLVM IR over Visual Studio.
Again, why? What do you know about LLVM IR and its long term stability? I'm told its all fairly in flux, on even an year, or couple of years scale. So the reasons are (probably) analogue to why FB doesn't tap into gcc's intermediate code either but generates C code.

E.g. GNU Pascal died when rewriting from GCC3 to GCC4 turned out to be a very significant enterprise.

So even if you go that way, it would be wise to have source level targets to fall back to. And then VS,GCC,LLVM for resp Windows,Linux/Android and Apple/BSD seems the most logical.
BTW, I have just looked at the compiler's code. The LLVM IR target seems to be already available.
Between getting something initial, and getting it production ready and long term usable there is often a larger gap than between having nothing and having something initial.
Last edited by marcov on Mar 11, 2021 14:07, edited 1 time in total.
Cretin Ho
Posts: 182
Joined: Feb 04, 2021 13:01

Re: How many generators currently available?

Post by Cretin Ho »

marcov wrote:
Cretin Ho wrote:
marcov wrote:I think a non GCC compiler backend like Visual Studio would be the logical next step.
Following this logic I would vote for LLVM IR over Visual Studio.
Again, why? What do you know about LLVM IR and its long term stability? I'm told its all fairly influx on even an year or couple of years scale. This is (probably) why FB doesn't tap into gcc's intermediate code either.

E.g. GNU Pascal died when rewriting from GCC3 to GCC4 turned out to be a very significant enterprise.

So even if you go that way, it would be wise to have source level targets to fall back to. And then VS,GCC,LLVM for resp Windows,Linux/Android and Apple/BSD seems the most logical.
BTW, I have just looked at the compiler's code. The LLVM IR target seems to be already available.
Between getting something initial, and getting it production ready and long term usable there is often a larger gap than between having nothing and having something initial.
Thanks for your explain. So it's my reasoning that wrong. But again I found Visual Studio support is not needed. I would rather vote for a Free Pascal backend. At least there seemed to have Nim lang that has a Free Pascal backend. So it's not weirded at all.
Post Reply