I assume that the EXE file in QB64 also includes support for images, sound, and 3D graphics, that is, OpenGL background for graphic and next 2rd party support for sound, even if the compiled program contains just the BEEP command. Because it is so a long time, I assume that it is very difficult to select the necessary pieces and then build an EXE. This is due to the interconnectedness of different subroutines.
Development priorities. Rob wanted to advance the capabilities of QB64 over telling the compile what libraries to install, based on the keywords in the code. The results are the worlds largest print Hello World app! I'm OK with that, because technology has advanced to such a great degree that size just doesn't matter the way it used to. In the old days, you could use switches to tell QuickBasic which libraries to include with a manual compilation. My favorites were O/S/E/X. Wow, I wonder why I still remember that? Anyway, no switches with QB64, either, but seriously, if anyone were so picky as to need the leanest meanest exe then ask yourself, what the hell are you doing programming in a hobby language in the first place?
Pete
Even though our binaries are indeed quite large, they do not pack *all* of the available libraries we ship. QB64
does indeed selectively choose what to add based on what code is compiled (Rob added that ability when switching from SDL - tens of .DLLs to add - to OpenGL - single binary).
You won't get the sound library included if no sound commands are used. Same for fonts. Even some of the graphic overhead can be minimised by creating $CONSOLE:ONLY applications.
You can check how it's done by looking into
internal\c\libqb\os\win (lnx, osx - depending on your OS). Depending on your usage, you will find several different files in that folder whose names begin with
libqb_1_...
Each of these is a combination of the available libraries packed according to what your programs use. Right now on my folder I have files with these endings:
000000000000.o,
000001000000.o,
100000010100.o - these have been used to compile (i) a program with no dependencies (ii) a program with only *one* dependency and (iii) a program with *three* dependencies. That's how it's done selectively.
If you happen to compile a program that uses all of the available libraries, you'd end up with QB64 generating a file called
libqb_1_111111111111.o.
That's how QB64 does it so only the required code is compiled.
Why then huge binaries for a single PRINT "Hello, World?"
What seems like a SCREEN 0 application is actually an OpenGL canvas that renders a DOS-like font and is capable of displaying colors. That's no easy feat, you can imagine the effort Rob put into it.
All of that justifies file size, I believe.