The thing to remember with QB64’s EXE size is that when you compile a BAS file, you basically compile it with EVERY command available— even the one’s you’re not using.
PRINT “HELLO WORLD”
That’s your whole one-line program. In c++, you’d probably write it as something simple like:
#include<iostream>
int main() {
std::cout << "Hello World\n";
}
Not much difference, except in c++ you specify which library your code needs to run. You ONLY need iostream, so you only include iostream, and thus you create a fairly small EXE.
But, BASIC was designed to take that hassle out of the way for beginner programmers. (You know, the B in BASIC...) Instead of making you keep track of a list of 3214 libraries and learn how to juggle them back and forth, learning when to add what and when to use what, BASIC basically makes them all available, all the time.
You don’t need to include a string library for RIGHT$, LEFT$, _TRIM$, MID$... You don’t need a math library for _ATAN2... No special graphics, sound, font libraries have to be manually juggled. You just type your code, compile it, and compile your one line of code with 300,000 lines of unused — but available — subs and functions floating in the background of the EXE.
About as small as a QB64 EXE is going to get is around 1.5MB. In today’s world, that’s a rather trivial size. When Galleon switched from SDL to GL as the backbone of QB64, he implemented a parts system where only required libraries would be compiled when needed — but those generally only apply to external libraries which we link to. Don’t use sound? Then we don’t add in the external sound library. Don’t use fonts? Then we don’t add in the external font library...
...But, at the end of the day, we still add in, more or less, the entirety of the BASIC library.
And that’s why your program EXE comes out to be the size which it is.