Some general remarks on FreeBasic

General discussion for topics related to the FreeBASIC project or its community.
marcov
Posts: 3462
Joined: Jun 16, 2005 9:45
Location: Netherlands
Contact:

Post by marcov »

John Spikowski wrote:Personally I think it's a big mistake not to allow C includes. (with the new C emitter) Having to translate libraries so FB can use them is a pain to maintain.
It is both a mistake to do and to don't.

To do because from a birds eye it is the ultimate solution. (as defined as without changes to the calling code compared to the FB header)

To don't because many have tried and failed, or produced unworkable solutions.

This means you can never fully rule out "DO", since somebody might still come up with a workable solution. Any "half way" solution essentially turns the calling code into C with only minor syntax differences.

This discussion doesn't only happen here, it also rages in e.g. FPC.

So I think the current position of don't, till a working patch gets submitted is the most productive. If people with an academic interest come up with something, the stance can always change. However this is not routine Compilers 101 work.

I still think FPC->FB header translation is the way :_)
Last edited by marcov on Jul 13, 2010 11:06, edited 1 time in total.
John Spikowski
Posts: 453
Joined: Dec 24, 2005 2:32
Location: WA - USA
Contact:

Post by John Spikowski »

That's digging into the archives. ;-)

So what is the latest on the C emitter Victor started?

I bet if the users of FreeBASIC were to join forces, they could come up with a FB2C translator written in FreeBASIC in a reasonable timeframe. There is BCX and BaCon as examples to learn from.

Anyone up for the challenge? Any C/Basic gurus here that would be willing to lead the effort?
John Spikowski
Posts: 453
Joined: Dec 24, 2005 2:32
Location: WA - USA
Contact:

Post by John Spikowski »

I'm overwhelmed by the enthusiasm for this user sponsored FreeBASIC to C converter.

Lets face it, all the noise about development is just that. And you ask why the FreeBASIC open source project is stuck in the mud.
marcov
Posts: 3462
Joined: Jun 16, 2005 9:45
Location: Netherlands
Contact:

Post by marcov »

John Spikowski wrote:

So what is the latest on the C emitter Victor started?
Using C as backend, or using C from the frontend are two TOTALLY different subjects.
John Spikowski wrote:I'm overwhelmed by the enthusiasm for this user sponsored FreeBASIC to C converter.
Probably they were so overwhelmed by all that you have shown as a start of that project, that they were unable to speak.
John Spikowski
Posts: 453
Joined: Dec 24, 2005 2:32
Location: WA - USA
Contact:

Post by John Spikowski »

Probably they were so overwhelmed by all that you have shown as a start of that project, that they were unable to speak.
Hint:

Download the BCX latest source and extract the templated C code for runtime functions that match the FreeBASIC syntax. This should give the project a big boost.

Remember, open source projects are built with the combination of contributed talent and expanding on the efforts of others.
marcov
Posts: 3462
Joined: Jun 16, 2005 9:45
Location: Netherlands
Contact:

Post by marcov »

John Spikowski wrote:expanding on the efforts of others.
Well, you are sure trying that.
csde_rats
Posts: 114
Joined: Jun 02, 2007 21:13
Contact:

Post by csde_rats »

Isn't that becoming kind of off-topic now?

I think it would be a good start to create a small portal (maybe something similar to repository.freebasic.net?), where users can upload their bindings.

A suitable format would be to upload them as a zip file, which holds both the header itself and the dynamic and static library aswell as the DLL/SO. A directory structure similar to this one could be used:

Code: Select all

*.zip
+inc
   |- xy.bi
+lib
   |- static (static libs as the name implies)
        |- win32
        |- linux
   |- dynamic (import libs)
        |- win32
        |- linux
   |- runtime (runtime libs)
        |- win32
        |- linux
Every night or week the server assembles all uploaded bindings to one big file everyone can easily download and use.
John Spikowski
Posts: 453
Joined: Dec 24, 2005 2:32
Location: WA - USA
Contact:

Post by John Spikowski »

marcov wrote:
John Spikowski wrote:expanding on the efforts of others.
Well, you are sure trying that.
Please spend some time to update your understanding what the open source initiative is all about. I feel sorry for your wife if she has to wake up to your Πss poor attitude every morning.
marcov
Posts: 3462
Joined: Jun 16, 2005 9:45
Location: Netherlands
Contact:

Post by marcov »

John Spikowski wrote:
marcov wrote:
John Spikowski wrote:expanding on the efforts of others.
Well, you are sure trying that.
Please spend some time to update your understanding what the open source initiative is all about. I feel sorry for your wife if she has to wake up to your Πss poor attitude every morning.
Gee, let's not forget who started with the bad attitude:
John Spikowski wrote: I'm overwhelmed by the enthusiasm for this user sponsored FreeBASIC to C converter.

Lets face it, all the noise about development is just that. And you ask why the FreeBASIC open source project is stuck in the mud.
And my GF is not a leech, so I have no beef with her.
John Spikowski
Posts: 453
Joined: Dec 24, 2005 2:32
Location: WA - USA
Contact:

Post by John Spikowski »

Gee, let's not forget who started with the bad attitude:
Don't confuse bad attitude with defending myself from your constant abuse.
And my GF is not a leech, so I have no beef with her.
It's been a while since I have run into someone so clueless as you.
angros47
Posts: 2326
Joined: Jun 21, 2005 19:04

Post by angros47 »

We want a compiler: not a BCX clone. If you like BCX so much, please use BCX and stop asking to change FreeBasic in to a clone of BCX.

You already have your own basic-to-high-level-C translator, so keep working on it; FreeBasic is aimed at a different target, so, what do you want from it?
John Spikowski
Posts: 453
Joined: Dec 24, 2005 2:32
Location: WA - USA
Contact:

Post by John Spikowski »

angros47 wrote:We want a compiler: not a BCX clone. If you like BCX so much, please use BCX and stop asking to change FreeBasic in to a clone of BCX.

You already have your own basic-to-high-level-C translator, so keep working on it; FreeBasic is aimed at a different target, so, what do you want from it?
Maybe someone should tell Victor that the users of FreeBASIC aren't interested in his C emitter and stop further development. (if he hasn't done so already)

I guess you were so busy being Πss off at my post you didn't understand my point of writing a translator in the FreeBASIC (compiler) as a way to achieve portability and C source people can understand. The compiler isn't being replace by a translator if that was your concern. I could write a FreeBASIC to C translator in ScriptBasic if I didn't already have 2 other open source Basic projects I'm supporting.

The FreeBASIC group is turning in to a bunch of old grumpy programmers that have lost interest in anything that requires them to be open minded on where to take the FreeBASIC project from here.
vdecampo
Posts: 2992
Joined: Aug 07, 2007 23:20
Location: Maryland, USA
Contact:

Post by vdecampo »

@John Spikowski

From what I understand, the C emitted code is not for human consumption and is a middle step on the way to a final compiled exe. Just as ASM is currently emitted but not retained (unless specified with -R option) so too I believe will the C code stay in the background. Doing this lets us take advantage of many different options which include optimizations and also portability. The primary goal is not to just translate BASIC to C, but it is a goal. BCX's primary goal appears to be translating BASIC to C, which is fine, but not the primary goal of FreeBASIC.

-Vince
marcov
Posts: 3462
Joined: Jun 16, 2005 9:45
Location: Netherlands
Contact:

Post by marcov »

John Spikowski wrote:
Maybe someone should tell Victor that the users of FreeBASIC aren't interested in his C emitter and stop further development. (if he hasn't done so already)
And I've dismissed that idea since it was proposed. Long before BCX (or, to my best knowledge, you) arrived at this forum. The forum is my witness, just search.
I guess you were so busy being Πss off at my post
Oh grow up, not everything is about you.
you didn't understand my point of writing a translator in the FreeBASIC (compiler) as a way to achieve portability and C source people can understand.
That's because you never have posted a real technical description how this works. You only try to create momentum with populist posts without any meat in it. That might work with the gullible, but while I'm not a real compiler expert, I know some basics (and by that I don't mean to say that people believing in a C backend are gullible, just that people that arrive on that opinion due to John's posts are)

Example: In this very thread you mix up C as a backend and using C headers from FB. Two totally different subjects, since the first is backend and the second is frontend matter.
The FreeBASIC group is turning in to a bunch of old grumpy programmers that have lost interest in anything that requires them to be open minded on where to take the FreeBASIC project from here.
No. They are just grumpy towards you, since you obviously miss any technical insight in the matter.

I'm not entirely clean, I know that. Since I criticize some FB's policies and don't really contribute. I simply don't have the time due to other open source responsibilities, to which I have a long standing commitment.

But at least I'm honest about that, and don't pretend to have made great contributions (or worse, talk about imaginative contributions to be done if people would just do things my way)
Last edited by marcov on Jul 14, 2010 20:03, edited 1 time in total.
angros47
Posts: 2326
Joined: Jun 21, 2005 19:04

Post by angros47 »

John Spikowski wrote:Maybe someone should tell Victor that the users of FreeBASIC aren't interested in his C emitter and stop further development. (if he hasn't done so already)

I guess you were so busy being Πss off at my post you didn't understand my point of writing a translator in the FreeBASIC (compiler) as a way to achieve portability and C source people can understand.
A translated source code is not understandable!

You didn't understand V1ctor's project:

The idea is to use gcc as a high-level assembler....

The code generated is not human readable though.
(http://www.freebasic.net/forum/viewtopi ... 4063#84063)


The compiler isn't being replace by a translator if that was your concern. I could write a FreeBASIC to C translator in ScriptBasic if I didn't already have 2 other open source Basic projects I'm supporting.
So, do it, instead of complaining. Even better... make your ScriptBasic compatible with FreeBasic, as I've already told you.

The FreeBASIC group is turning in to a bunch of old grumpy programmers that have lost interest in anything that requires them to be open minded on where to take the FreeBASIC project from here.
So, why are you still here? We are here because we like FreeBasic: we like it in current status, and we want to improve it: we want to go on, not to go off on a tangent.

You should go to QB64 forum: it's a high level basic-to-C++ compiler, so it's closer to what you want.
Post Reply