HACKER Q&A
📣 schemescape

Smallest cross-platform language runtime?


For mostly command line tools, but ideally with some GUI support, what’s the smallest (and easiest to deploy) language runtime?

Rationale: I often write little tools, and often I need to run them in the future (frequently on different computers). I’d like to use C#, but getting a tool chain and development environment is a painful multi-gigabyte commitment. Today, I like Deno for its trivial deployment and smallish (80 MB) footprint (and VS Code+TypeScript is a great development environment, although not very small), but I’m not sure it will be around for the long term. Node is similar, but much more painful to setup.

Zig’s compiler (another smallish download) is intriguing, but it’s probably too low level when I only run the programs a few times a year (meaning I don’t want to write low level, fast code—-I’ll trade speed for ease of writing code or small footprint).

Tcl/Tk seems promising (I’ve heard it can be as small as a few megabytes). Any reason I shouldn’t use Tcl?

I’m sure there’s a Lisp option, but I haven’t found one with as small of a footprint as I thought should exist.


  👤 planetis Accepted Answer ✓
I think the smallest binaries you're going to vet with nim. 73kB according to [1]. [2] also mentions that "This implementation was designed for embedded, hard real-time systems.".

[1]: https://nim-lang.org/blog/2022/12/21/version-20-rc.html [2]: https://nim-lang.org/blog/2022/11/11/a-cost-model-for-nim.ht...


👤 verdverm
Go can easily cross compile and has lots of OS level abstractions. I would use web tech for any frontend, run a server and embed the necessary files in that binary.

Go can be just a few MB onto the low 10s


👤 ahazred8ta
Is the 100KB TCC an option? posix+windows

https://en.wikipedia.org/wiki/Tiny_C_Compiler

https://www.lua.org/download.html is only a few hundred KB


👤 schwartzworld
How about Forth?