Notes on the QB64 Programming Languageby 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) from IP address 67.205.21.208 |