New to FreeBASIC? Post your questions here.
Posts: 1
Joined: May 14, 2015 23:34


Postby pattim » May 14, 2015 23:39

Wow - this is amazing. I just discovered freebasic. I remember switching from an early visual basic to compiled QB and the speed improvement was dramatic. TurboPascal was somewhat faster still. Nowadays languages have converged a lot. I'm wondering how the speed of languages compare. I was reading about D and the comment was that the optimizers aren't developed that well for D, so it can be noticeably slower than, say C or C++. Now, it would seem, that it's all down to the quality of the built-in optimizations. Does fbc do any optimizations? I guess it uses gcc, so maybe it uses gcc/gfort optimization?

Are there a listing of any largish projects which have used fbc?

Thanks for a great language!

EDIT: I installed under opensuse 13.1 with the install script. I fired up Geany (installed from the OS repo) and it automatically detected fbc. The parsing colors are good also. Excellent!

EDIT2: Found this... viewtopic.php?f=17&t=23267
Site Admin
Posts: 3217
Joined: Jul 28, 2005 14:45
Location: Germany


Postby dkl » May 16, 2015 19:04


fbc uses a custom ASM backend for 32bit x86, this includes some optimizations. The generated code is ok, but not as good as gcc's. You can probably find some benchmarks here on this forum to compare that... depends on the program whether it makes a noticable difference though.

For other targets (64bit, ARM, ...) fbc uses a C backend, using gcc to compile to ASM, so there probably won't be any differences to equivalent C code.

There aren't many big FB projects. Besides tools around FB itself, there are quite some games though:
Posts: 1595
Joined: Feb 26, 2007 5:32


Postby caseih » May 16, 2015 20:00

Wasn't Visual Basic after QB 4.5?
Posts: 2179
Joined: May 24, 2007 22:10
Location: The Netherlands


Postby badidea » May 21, 2015 21:18

I expect that the speed difference between 'compiler languages' is small. 'just-in-time' compilers and interpreters like java, python, php, perl, etc. can be a lot slower and much more memory use. But often the speed is determined mostly by your own implementation of functionality and memory organization. There are websites which compare the speed similar tasks (e.g. sorting algorithms) between different languages, but I don't have such a website at hand. Shouldn't be too hard to find.

Edit: Using Geany as well under Xubuntu.
Posts: 35
Joined: Aug 28, 2014 6:44
Location: Puerto Princesa, Palawan, Philippines


Postby jona » May 23, 2015 0:12

[quote="pattim"]Are there a listing of any largish projects which have used fbc?

Define largish. I wrote some engineering finite element programs that determine deformations and internal forces of structures made of "sticks": 3-dimensional trusses (held together at the joints by pins or ball joints), and 2-dimensional frames (held together at the joints by welding). Gauss-Jordan inverts potentially large matrices. Then a diagram of the deformed structure is drawn. In the case of frames, the originally straight elements take on the shape of a cubic equation. I am not a programmer, though I am an engineer. I haven't added up the hours spent on this project, all for the fun of it.
Posts: 3049
Joined: Jun 16, 2005 9:45
Location: Eindhoven, NL


Postby marcov » May 23, 2015 12:07

badidea wrote:I expect that the speed difference between 'compiler languages' is small.

For actually generated integer code: yes. But in languages that invoke a lot of subroutines as language helpers, that can become the bottleneck. Typical case is garbage collection, but also e.g. VB6 has some aspects (and was often demonized because of it) mainly because of the weak (or better: non mandatory) typing and the overuse of variants.

Such code looked more like a sequence of calls to helper routines than actual code that does something.

That doesn't mean that one shouldn't use helpers. E.g. I'm generally in favour of having at least an automated string type and an automated array type. One should simply consider what the main purpose of the language is I guess.
Boris the Old
Posts: 139
Joined: Feb 04, 2011 20:34
Location: Ontario, Canada


Postby Boris the Old » May 23, 2015 17:49

pattim wrote:I'm wondering how the speed of languages compare

In general, the language that you use will be irrelevant. Your programs will spend most of their time executing library and operating system code -- and you have absolutely no control over any of that stuff.

pattim wrote:Are there a listing of any largish projects which have used fbc?

Define largish :-)

We develop cross-platform business applications, some of which have 500K to 1M lines of code, and have had no problems using FB.


Return to “Beginners”

Who is online

Users browsing this forum: No registered users and 14 guests