Notes on the QB64 Programming Language

by Publius (no login)

QB64 is a programming language which is a dialect of BASIC. This dialect of BASIC has several problems with it:

(1) QB64 is Bloated

A small test program compiles to a 745Kb executable, requiring an aditional sdl dll of 312 KB. The hello world program generates the following C code:

S_0:;
S_1:;
tqbs=qbs_new(0,0);
qbs_set(tqbs,qbs_new_txt_len("Hello, World!",13));
if (new_error) goto skip1;
if (qbg_cursor_x!=1){
if ((tqbs->len+qbg_cursor_x-1)>qbg_width_in_characters){
qbs_print(nothingstring,1);
}}
qbs_print(tqbs,0);
qbs_free(tqbs);
qbs_print(nothingstring,1);
skip1:
qbs_cleanup(qbs_tmp_base,0);
if(qbevent){qbevent=0;
while(suspend_program||stop_program){Sleep(10);if(stop_program) end();}
if(new_error){fix_error();if (error_retry){error_retry=0;goto S_1;}}
}
print_holding_cursor=0; qbg_cursor_x=1; qbg_cursor_y=qbg_height_in_characters;
if (qbg_width_in_characters==80){
qbs_print(qbs_new_txt("Press any key to continue "),0);
}else{
qbs_print(qbs_new_txt("Press any key to continue "),0);
}
do{
SDL_Delay(0);
if (stop_program) end();
}while(qbs_cleanup(qbs_tmp_base,qbs_equal(qbs_inkey(),qbs_new_txt(""))));
close_program=1;
end();
return NULL;
}


clearly, QB64 is extremely bloated.

(2) It stops at the first error rather then continuing to attempt to compile the file as GCC does.

(3) It uses an ugly underscore hack rather than using namespaces or a command line option.

(4) It will never be fully compatible with QBASIC. C++ is fundamentally different from QBASIC in many ways. Example: The C++ standard does not specify things like the order of evaluation of function arguments while QBASIC specifies left-to-right evaluation. Technically it could be completely QBASIC compatible, but that would require writing a DOSBOX style emulator, resulting in a severe performance hit.

(5) Despite translating to C++, it does not offer object orientation features available in C++. QB64 could have been written just as easily in ordinary C.

(6) It uses the SDL library for text IO rather than then normal console, disallowing piping and redirection.

(7) It is dependant on the Windows Operating System and is unlikely to be ported to Linux in the near future

(8) It will be disgarded as FreeBASIC was because won't be completely compatible. (see #4)


Posted on Jun 20, 2008, 6:45 PM
from IP address 67.205.21.208

Respond to this message   

Return to Index


Response TitleAuthor and Date
Some concerns are valid, some are wrong... let's investigate! on Jun 20
Real notes on QB64 on Jun 20
 * LOL @ daily moronics on Jun 20
 It's unsurprising that PhyloGenesis gave the same answers as me! on Jun 20
 i liked galleon's version better, let me explain why thoughmennonite on Jun 21
  *or rather, "am not"mennonite on Jun 21
Re: Notes on the QB64 Programming Languagecounting_pine on Jun 22
 you're correctmennonite on Jun 22
  I can't quite tell whether these posts are agreeing or arguing...counting_pine on Jun 22
   You are forgetting that we can still use the QB IDE to write code on Jun 22
    How am I forgetting that?counting_pine on Jun 23
   i guess there's some of bothmennonite on Jun 22
    did the quota of capital letters run out again on Jun 23
     * Please tell me this is a joke. It would be ridiculous of N54 to limit the number of CAPSrpgfan3233 on Jun 23
      (*url)mennonite on Jun 23
     OH COME ON... IF THERE WAS A CAPS QUOTA, HOW COULD I EVER POST CODE? on Jun 23
      by using the ascii values of the charactersqbguy on Jun 23
       you could just use ucase$mennonite on Jun 23
     um, no ideamennonite on Jun 23
      * %6C%63%61%73%65 %71%75%6F%74%61 %68%61%73 %72%75%6E %6F%75%74 %6E%6F%77.rpgfan3233 on Jun 24
       *Don't do that RPG.......you ruin the Community format on Jun 24
    Re: i guess there's some of bothcounting_pine on Jun 23
 Qbasic Bugs on Jun 22
Notes on taking notesa teacher on Jun 22