twinBASIC Runtime Requirements

The title's a little misleading. SPOILER ALERT! There are no runtime requirements for twinBASIC.

twinBASIC Runtime Requirements

Most modern languages require some sort of runtime.  For example, Java programs require a Java Runtime Environment (JRE), .NET programs require the .NET framework, Python programs require a Python interpreter, etc.  Without the runtime, these applications will not function.

Just for fun, let's compare the runtime sizes of a few popular programming languages.  Before the pedants and the fanboys come after me, I will stipulate up front that I hardly know what I'm talking about with most of these other languages and, yes, I'm sure that there's some other leaner runtime available for your favorite language, or, well, actually, for certain applications there's a lightweight alternative, blah blah blah.  I don't really care.  We're comparing orders of magnitude here, so I'm not about to quibble over a few meg here and there.

Without further ado, let's whip out our runtimes and start comparing sizes.

Microsoft Access - 2016 64-bit Runtime (315.6 MB)

Microsoft Access is still the best desktop rapid application database development tool available today.  But recent runtime installers have really started packing on the pounds.  I couldn't even find an offline installer for Microsoft Access 365 Runtime, so here's the size of the 64-bit Access 2016 Runtime installer:

That's no typo. The 64-bit Access 2016 Runtime weighs in at over 300 meg!

Java - JRE 8 (69.74 MB)

Whenever possible, I'll be showing the sizes for offline installers since that's the easiest way to do an apples to apples comparison.  Here's what I found for Java:

69. Hehe.

.NET Framework 4.7 (58.7MB)

Yes, I realize that the .NET framework is built into the Windows O/S.  But the actual runtime version included varies from one version of Windows to another.  Anyway, here's the size of the offline installer for the full 4.7 Framework:

.NET Core - 64-bit v5.0.5 Desktop Runtime (52.4 MB)

Want the latest version of .NET Core?  No, problem.  Just make sure you pick the right one.  There are twenty different links to installers on the download page.  That's twenty links just to Windows installers.  And just for the latest release.

I picked the 64-bit Desktop Runtime version because that seemed like the best apples-to-apples comparison to twinBASIC's expected functionality:

Python 3.9.4 - 64-bit embeddable package (8.03 MB)

Python offers both an installer and an embeddable package for Windows (in 32-bit and 64-bit flavors).  I'll be generous here and use the embeddable 64-bit package for comparison purposes.  Python's download website shows the download size in bytes, so we have to do some binary math to get to the MB size.  8419530 / 1024 / 1024 = 8.03 MB.

Visual Basic 6.0 - 32-bit Service Pack 6 (1.0 MB)

VB6 requires the msvbvm60.dll shared library.  This runtime is included on all supported versions of the Windows operating system, but it is only available as a 32-bit library.  Surprisingly, Microsoft does still offer the redistributable runtime package as an offline installer:

Note the Date Published is all the way back in 2004.  I do believe newer versions of Windows have updated the msvbvm60.dll with a variety of security fixes over the years, but it's safe to say there won't be any more feature releases for the venerable VB6.

Go - 0 MB  (Hello, world: 1.9 MB)

The Go programming language (googleable via Golang) has no runtime.  Plus it has obsessive adherence to backwards compatibility.  (Longtime readers will know how I feel about that.)  It was built from the ground up with concurrency as an integral part of the language (not an afterthought).  Plus, it has full cross-platform support.  All in all, it seems like a pretty sweet language (I've never actually written anything in it...someday I'll have time).

However, Go programs avoid an external runtime dependency by statically linking (i.e., including within the .exe file) a bunch of libraries that other languages would leave as external references.  Thus, the size of a simple Hello, World project in Go clocks in at just under 2 MB (or at least it did in 2015).  

AutoHotkey - 0 MB (Hello, world: 1.1 MB)

I'm a big fan of AutoHotkey.  You can install AutoHotkey on your computer to write and run scripts from .ahk text files.  But did you know you can easily compile these script files to portable .exe's?  This is a great way to throw some of your favorite scripts onto a thumb drive and use them on other computers without having to install AutoHotkey first.

Simply right-click on an .ahk file, choose "Compile Script," and you will end up with a teeny, tiny executable that you can run on any Windows computer.

I love you, AutoHotkey.

twinBASIC - 0 MB (Hello, world: 8 KB)

twinBASIC has no runtime dependency.  Zero, zilch, nada.

I emailed Wayne Phillips to get his confirmation on this.  His response speaks for itself:

"There are no runtime dependencies apart from the standard system DLLs (kernel32, ole32, oleaut32, user32).

"[twinBASIC] doesn’t use MSVBVM60.dll, nor any equivalent. The equivalent functions provided by MSVBVM60 are automatically statically linked-in to the built executable files so that there are no external dependencies."

-Wayne Phillips

That's right folks.  There are zero external dependencies for twinBASIC.  That puts it on equal footing with Golang.  Now, let's see how big the "Hello, world" is when compiled to .exe from twinBASIC:

That's a tiny executable!

Of course, any 3rd-party libraries you reference from your code will need to be included as part of your deployment package.  And the 8 KB "Hello, world" file size will likely grow a bit as twinBASIC moves out of preview and into its first stable release.  But that is one heck of a starting point.

Recap

Here's the final comparison among the selection of programming languages I reviewed in this article.  I included the column with "Hello, world" sizes because I wanted some way to distinguish among the no-runtime-required languages.  It is a bit silly, though, since no one in their right mind would choose a language based on saving a few 100K on the executable.

With all that said, you'll have a hard time finding another high-level programming language with a smaller footprint than twinBASIC.

Whoa! "Hello, world" in Go is hundreds of times bigger than in twinBASIC. This Go language thingy must be bloated trash...

Wings by Clker-Free-Vector-Images from Pixabay
Dandelion by Michael Schwarzenberger from Pixabay


UPDATE (2021-04-20): Updated to reflect that Go is even more bloated–relative to twinBASIC–than I originally realized (/sarcasm/).  Seriously, though, I corrected the size of the twinBASIC "Hello, world" executable from 29 KB to 8 KB.  The 29 KB size from the original article was not a simple "Hello, world" app; it was full of additional test code that I forgot I had added.

All original code samples by Mike Wolfe are licensed under CC BY 4.0