(If you are looking for my 'wisdom' on programming and FB tips, go here.)
FreeBasic (FB) is a 10+ year
old project that attempts to bring real power to the BASIC language and
try to support as much of the syntax as possible from the old QB4.5
BASIC.
It does not try to be a plug-in QB replacement.
It is NOT an interpreter - it is compiled.
It has versions that run in DOS, Linux, and Windows. ARM, BB, more. Release cycle
tries to be about every six months, but that changes.
The current version is 1.06. It is now fully 64 bit, along
with the original 32 bit.
It has 3 huge features (from my point of view.)
Execution is FAST. While it is not always as fast as that big many-multiple-pass C ...
monster out there, it isn't slow. My estimate and benchmarking
makes it from near as fast to maybe one-half the speed. Depends on
what you are doing. HOWEVER ... if you look at benchmarks of the other
languages - this is still better. I work in linux. That means pretty much
all I do is terminal/console bound. For graphics, you need to move to one
of the larger graphics libraries to get speed in graphics to the screens.
BUT - there are bindings for all the current libs.
It produces small files. My learning project of listing files in a
folder was only 20 k. Testing single functions can approach 10k.
It is simple. It is BASIC, after all, and that is what BASIC is
supposed to be. This means that it is simple to maintain your source
code - probably the single largest fault with C languages.
Now for the really good stuff.
It will produce a C output file for you if you want to really get into
the deep stuff. Not really, just kinda wrap your code a into c file that
is all FB library calls, so still - a little use there. However ...
Macros in the precompiler. Functions in UDT's. Sophisticated graphics possible.
Inline assembly. Thread/mutex/assert/bitwise/wide. Mouse! Not the BASIC
in my TRS80 (actually - LNW) or C64.
It will work very well, and with not too much difficulty, with any C
library. Sure, I complain about that language elsewhere on this site,
but I do embrace and respect the investment and effort by a great many
talented people that have produced mountains of excellent code that
will do about any job you desire.
And static libs. Write YOUR library - gui, disk, whatever - make a static
library for it, and you don't have to bulk up your source with it anymore.
It is pretty simple to set up - on Windows - on Linux. And the source
will work for either. DOS, also, but that is so restricted in
capability that one has to be careful. For example, ZERO real graphics.
The standard C routines have include files that makes their use
trivially simple. For Windows, an API interface is available. For both -
sound, graphics, tutorials, examples. Reinventing the wheel is, at the
least, egotistical.
You can do pointers. You can do objects. Up to you. (The developers
need to be careful, here. In trying to provide objects, containers and
inheritance, they are moving too much toward the current language
fashion of RTTI, properties, etc. that will slow down and bloat the
language into something like ... C++? The arguments are on the forums
about this. I hope the developers listen. My thought? The language
should do the work, not knowledge of hundreds of qualifiers/modifiers.
If I have to resort to a ton of pointers and exercise RTTI functions,
then the language is incomplete and has failed to be coherent. If they
hide it so I don't NEED it to do my work, that's fine - as long the
resultant code stays small and fast. I DO NOT want an answer to a
question on the forum to be incomprehensible glyphs that will scare
away a ten year old. Is it BASIC, or is it not?)
The only major thing missing WAS 64 bit.
It is here, now. VERY few bugs left in it (none?)
One can write libraries and have them precompiled to further reduce program
size and compile time when using your own custom routines.
The community is certainly the nicest, most helpful of any I have been
involved with. Helpful, VERY few trolls (one?), a wealth of old and new
postings organized such that topics are easy to search. Gentle
moderators.
The current principle developers/editors of the language are not so
full of it that they DO watch the boards, DO chip in frequently to even
tiny, newb questions, and DO pay close attention to the educated
conversations about directions the language should take as suggested by
the users. And have been willing to test a direction of the concensus
if it isn't too far away from the basic philosophies of the intent of
FreeBASIC.
Is it perfect? NO. I'm not perfect - so no one else gets to be perfect.
For me, you have to worry about how you ask a question. Not careful,
and you will get a tutoring lesson that *may* net some college credit
if you sit through it all. (Well, used to be able to give training
hours for payroll and training time requirements before I retired if I
spent time with techs in the field. Special account setup just for me.)
I should give what is now a standard warning to anyone that asks for advice from anyone:
Pay attention to who is answering your request for help. Examine the answer and see if it applies to YOU.
Be sure that this person does NOT have a stake in the answer. Worst problem: teachers and gurus.
They want to be THE PERSON that has the answers. And they want to always be right. If the answer is overly
technical, well, maybe it is overly technical. If you had a simple solution that didn't quite work, be
sure they answered what is WRONG with your approach, not just counselled you on what they thought was right.
In programming, the best example is - GOTO.
NEVER use GOTO - it means you [ insert a favorite insult here ]
This is mostly a support of arguments for object based programming. It originated with a guy
named Dijkstra. Bright guy. It is valuable for you to know how important he is to modern
programming. Unfortunately, no computer could exist if the GOTO statement did not exist.
He also said, basically, that anyone that started with BASIC in programming
was broken and couldn't be fixed.
Your teacher gives you a grade. You need to pass the class. Do what he says.
Just remember: teachers used to teach that the Earth was flat. And, for a long time,
continued to do so even when they knew it was incorrect.
For FB, my most frustrating issue WAS that it may decide to just do a
dump of all the asm code, rather than compile my program(s). If I find
the right place to add or remove a blank line, it might work. The same
listing compiles just fine with option -gen gcc. (Alternate gcc
toolchain compiler.) Two of the key guys involved have tried a bit to
find it, but no real luck. I(we) thought the issue was related to using
what might be asm register names as variable names. (Known bug.) I did
whittle one program down to 20 lines or so, and this was the problem.
HOWEVER ...
Well, no simple variable names, now, and no more problems.
The current set of programs I am working on is at least 27000 lines
long in 65+ files.
Bottom line: Freebasic is fast, not bloated, simple, powerful.