I need to write an extremely lightweight program (trying to get below 8Kb) that performs some simple math. The language also needs to be platform independent. Which language do you think would work the best? (Oh, and no frameworks allowed.)
C. Of course you need to compile separately for each platform, but other than that, it's quite light, and platform-independent (or multiplatform, whichever expression you prefer).
Which platforms are the program targeting?
So far, we have the following requirements:
Here are some questions:
The questions that I've presented are going to affect the desirable options. If the program must be 8 kilobytes with the runtime environment, then there really isn't much of a choice other than compiling against the target environment.
If the target is an embedded device, or non-x86, then its likely that the choices will be further restricted. Small embeddable langugages such as Lua can still be used (written in C), but that would require a fairly large "runtime" for the script to execute.
If cross-compiling to the targets are an option, then writing a program in C and compiling to each target platform will probably yield fairly small native programs.
With the current requirements, there are a few questions that need to be addressed in providing a good comprehensive answer. Other than that, the best that can be done is a brainstorming of options that may or may not lead to a desirable solution.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With