Hi.<p>I heard a lot about NIM, V-LANG, ZIG, GO, RUST and other "small, simple and portable - as C" languages, which seems perfect fit for port to some old and resource starved systems.<p>Most of those languages leverage some GCC or LLVM/Clang heavily - which is "cheating", as they can't provide small, portable, standalone compiler for 32-BIT DOS systems.<p>Which modern language have some native 16/32bit MS-DOS compiler that can under MS-DOS environment with 2MB of RAM?<p>Except FreePascal and DJGPP.
The two places I would look are:<p>1. Oberon. It certainly qualifies as a modern language, it was designed for doing systems work, there is an MS-DOS compiler from ETHZ, and the language is single pass and designed by one of the masters to be easily and quickly compiled.<p>2. Forth. Something like Pygmy Forth can be a great development environment for constrained systems.
Use Watcom C/C++, it's freely available and fully supports protected mode extenders on MSDOS. It might be a bit dated but it works and generates pretty tight code.
Have you tried D language? The D language author is the same author of Zortech C++, the first native C++ compiler for 16/32 bit MS-DOS. Perhaps if you have any problems in compilation, he probably can help.<p>[1]<a href="http://www.edm2.com/index.php/Zortech_C%2B%2B" rel="nofollow">http://www.edm2.com/index.php/Zortech_C%2B%2B</a>
Why should modern languages care about legacy targets? Some do care about modern small 8-32bit targets, sure.
But DOS is only needed for UEFI, and there we have an ecosystem, modern languages don't care about.<p>2MB RAM is a lot. Most of my devices are about 16K RAM, some much less. Lua, picoc, micropython and ulisp are common, but there are also much better modern, safer languages.
There is no point in actually running build tools on a target MS-DOS system. Modern compilers are perfectly capable of running on a practical development system while compiling to code for a different, target platform.<p>Then, you can use any fully modern language you can find a cross compiler toolchain for. C++ is the most widely supported, so offers the most choices.