A Serious Article Debating the Pros and Cons of FreeBASIC

General discussion for topics related to the FreeBASIC project or its community.
Post Reply
angros47
Posts: 2414
Joined: Jun 21, 2005 19:04

Post by angros47 »

John Spikowski wrote: The less framework code I have to write to get the job done is being smart and doing my clients a service.
I agree with you at 100%: frameworks are a PAIN, sometimes they cannot be avoided, but I don't like to be forced to use them always.
cha0s wrote:What should be done IMO, is that if people that have the skills feel like it'd be cool to have the compiler written in FB, then THAT should be the fork, and no one should care when it breaks, it'd be a toy.

Having the compiler written in C doesn't impact the language at all. The PHP interpreter is written in C.
Since a compiler written in C wouldn' use the code of FB, it wouldn't be FB, it'd be a FreeBasic Compatible Compiler.

Are you talking about a port of all FB code into C, or about a rewrite from scratch? A port could bring a better code documentation, so could be useful, and also new improvements in the C version could be used in the old, FB version; a rewrite would mean a 100% new program, don't know how many people could be interested in testing a new compiler that, in its earlier stage, will necessarily be a big backstep
cha0s
Site Admin
Posts: 5319
Joined: May 27, 2005 6:42
Location: USA
Contact:

Post by cha0s »

angros47 wrote:Since a compiler written in C wouldn' use the code of FB, it wouldn't be FB, it'd be a FreeBasic Compatible Compiler.
Again, are you telling me that PHP isn't PHP, it's 'PHP-compatible', because it's written in C?
angros47 wrote:a 100% new program, don't know how many people could be interested in testing a new compiler that, in its earlier stage, will necessarily be a big backstep
You mean like the original FB? ;)
Eponasoft
Posts: 264
Joined: Jul 26, 2007 2:40

Post by Eponasoft »

angros47 wrote:Since a compiler written in C wouldn' use the code of FB, it wouldn't be FB, it'd be a FreeBasic Compatible Compiler.
I'm sorry but this is the most ridiculous thing I've ever read on this forum. The vast majority of compilers are written in C. Self-hosting compilers are a relic from the past that should have died out long ago, gcc and some assemblers being the exception.
John Spikowski
Posts: 453
Joined: Dec 24, 2005 2:32
Location: WA - USA
Contact:

Post by John Spikowski »

Well, to be fair, you have a point. I've done PHP development for a bit now and I've seen examples. However there's a bit of a difference here with scripting, I think. I'll give an example of what I mean:
Okay, I'm spoiled. With ScriptBasic, you don't have to DIM or DECLARE any variables and that includes arrays. Data is data and it's type is determined at time of use.

Example:

Code: Select all

a ="1"
PRINT 5 + a
Returns: 6
PRINT 5 & a
Returns: 51
Scripting languages are expected to be easy to use and smart enough to assume the obvious.
angros47
Posts: 2414
Joined: Jun 21, 2005 19:04

Post by angros47 »

cha0s wrote: Again, are you telling me that PHP isn't PHP, it's 'PHP-compatible', because it's written in C?
Eponasoft wrote: I'm sorry but this is the most ridiculous thing I've ever read on this forum. The vast majority of compilers are written in C. Self-hosting compilers are a relic from the past that should have died out long ago, gcc and some assemblers being the exception.
Sorry, my mistake: I mean that FB is the current compiler, with the current source code. If somebody modify or improve this compiler, will make a new version of FreeBasic.
If somebody starts a new compiler, in another language, without using current code, how can he say that his work is FreeBasic?
It's like saying that FreeBasic is QBasic (or that QB64 is QBasic): they are not, although they are compatible. Using the same name can be confusing.
cha0s wrote: You mean like the original FB? ;)
Original FB had features that weren't available in other compilers (QB compatibility, working in windows and linux.

A "freebasic reloaded" which advantages could bring?
Also, it reminds me of QuickerBasic: http://sourceforge.net/projects/qkrbasic/

Was not a big success, was it?
cha0s
Site Admin
Posts: 5319
Joined: May 27, 2005 6:42
Location: USA
Contact:

Post by cha0s »

IMHO, qkrbasic should have gotten more recognition than it did. That is more of a sidenote, however.
counting_pine
Site Admin
Posts: 6323
Joined: Jul 05, 2005 17:32
Location: Manchester, Lancs

Post by counting_pine »

I'm theoretically in favour of a rebuild from scratch (and I don't see enough reason to include dialects in a rebuild), although until it's mature I'm happy to continue work with the current one.

I'm wondering about the best language to do a rewrite in though...

C would be more friendly to the people outside the project, and allow external libraries to be used, which could save a lot of reinventing. But part of me wonders whether a language without support for things like garbage collection and trees, or first-class strings, is a good choice for compiler writing.
In a way C is a step down from FB, which does have strings, and can technically use C libs if the headers can be ported, and shouldn't be a huge mental hurdle for C programmers. I'm not sure either are best suited for this kind of work though.

But that said, I've never built my own compiler from scratch - It's on my list of potential projects which is ever expanding but rarely shrinks - so to a certain extent I'm only speculating here.


I think my personal feel about implicit variables is that they work best in a language that can type them implicitly too. It saves having to explain to someone why a = "hello world" doesn't work, or a = 3.1 doesn't work as expected when the default type is integer.
John Spikowski
Posts: 453
Joined: Dec 24, 2005 2:32
Location: WA - USA
Contact:

Post by John Spikowski »

May I suggest another option? Why not contribute to the BCX project that is mature and feature rich and continue supporting FreeBASIC as long as you are able. I have a hard time understanding why bright and talented people have this need to start from scratch and everything else is crap. I don't know about you but I'm 57 and I'm maximizing the time I have left. That's why I contribute to Basic in general and hope it does some good.
Eponasoft
Posts: 264
Joined: Jul 26, 2007 2:40

Post by Eponasoft »

angros47 wrote:Sorry, my mistake: I mean that FB is the current compiler, with the current source code. If somebody modify or improve this compiler, will make a new version of FreeBasic.
If somebody starts a new compiler, in another language, without using current code, how can he say that his work is FreeBasic?
It's like saying that FreeBasic is QBasic (or that QB64 is QBasic): they are not, although they are compatible. Using the same name can be confusing.
FB is not just a compiler, it's also a dialect. Two different compilers could easily be called FB if they still functioned the same way.
Richard
Posts: 3096
Joined: Jan 15, 2007 20:44
Location: Australia

Post by Richard »

I think cha0s has made some good points. There comes a point in the life of any continuing project when it is necessary to stop and think about where it is going. FB has grown out of it's original specifications, several times.

No matter how intelligent and tolerant the developers might be, there will be some point where the project just gets too difficult to expand while maintaining reliability. If it has become too complex for current developers to advance and maintain, then it must be even more difficult for newly recruited developers. That is where FB is now, stagnant but stable.

Stagnation is an indication of a need for rationalisation. It is therefore necessary to redefine the project, to fork and to rationalise the source code prior to the next advance. The decision to rationalise is always a difficult one because in order to go forward it is necessary to take a step backward and then consolidate that position. If at all possible it is clearly better to advance a new FB fork than to remain stagnant. The longer we procrastinate, the longer FB stagnates.

The C or C++ decision is one for the developers. Each language has pros and each has cons, (almost back on topic). It probably does not matter to the FB user which language is chosen so long as the ongoing developers select it wisely. Developer retention and productivity is determined by developer happiness, which in turn is determined by their environment.

If FB was a rose then it would be described as moribund. There is good stock there, but it is in need of a good pruning, so that it might flower prolifically next year.
TeeEmCee
Posts: 375
Joined: Jul 22, 2006 0:54
Location: Auckland

Post by TeeEmCee »

Thanks for your heartwarming post, cha0s. The number of zealots on these forums who find the idea of a FB compiler written in something other than FB repulsive astounds me. They seem unaware that half of FB is written in C.

I don't think C is really a better language than FB for compilers; what do you gain aside from speed? FB is nearly a superset of C. It's the act of rewriting that gives you all the benefits.

Hey John, how far apart are the BCX and FB dialects? Let's have a straight answer: what's your opinion on the difficulty of 100% FB compatibility in BCX? Your constant plugging is starting to make me doubt my efforts...
angros47
Posts: 2414
Joined: Jun 21, 2005 19:04

Post by angros47 »

TeeEmCee wrote:It's the act of rewriting that gives you all the benefits.
Every time I saw a project being "rewritten", I saw it die. The new version is weaker than the old one, the old one isn't developed, so users loose all interest. So I doubt that rewriting the program could be of any use.

What advantages do you (and cha0s) expect from it, to justify it?
John Spikowski
Posts: 453
Joined: Dec 24, 2005 2:32
Location: WA - USA
Contact:

Post by John Spikowski »

Hey John, how far apart are the BCX and FB dialects? Let's have a straight answer: what's your opinion on the difficulty of 100% FB compatibility in BCX? Your constant plugging is starting to make me doubt my efforts...
BCX's initial design goal was to be a PowerBASIC like convertor to C. It evolved with the contributions from very talented developers over the years. I'm just getting started with the language/translator and my first impression is it's a cross between PowerBASIC and VB Classic that allows embedding C into your Basic code. Being able to use .h files directly has been a huge time saver.

I'm going to let BCX speak for itself by sharing a few links that should give you an overview of syntax and feel of the Basic.


BCX-32 & BCX Universal example running on Windows, Linux and the Mac
Fast File Scan

COM - Excel

BCX User Group Forum - Source code and snippets

BCX User Group - Source code repository
angros47
Posts: 2414
Joined: Jun 21, 2005 19:04

Post by angros47 »

What do you have in mind? To kill FB and switch to BCX?

You can go to BCX, but why everyone else should be forced to do?
John Spikowski
Posts: 453
Joined: Dec 24, 2005 2:32
Location: WA - USA
Contact:

Post by John Spikowski »

Please !

FreeBASIC users are not sheep and are here because they use the language or have interest in doing so. There are thousands of open source projects you are welcome to help out with. I use 4 or 5 different dialects of Basic depending on the task, delivery schedule and budget that determine what tools I use. I happen to like Basic due to it's diversity and (normally) friendly groups behind the projects.

FreeBASIC isn't on life support yet and for those that enjoy programming using an enhance QB derivative, you can beat it. All that contributed should be proud of the coordinated effort few projects achieve.

Add some spice to your programming life and try other Basic variations. Expanding your skills can't be a bad thing in this economy.
Post Reply