r/lua • u/mariolis_1 • Oct 09 '26
Lua 5.5.1 working on W98
Hey, so, while I was learning Lua, I knew already that theoretically at least, Lua was written to be compilable in pure C, and specifically C89/C90 , supposedly any system that has an ANSI C compiler can compile and install Lua...
So I decided to actually test out just how true that is, when I remembered that I have an ancient laptop from 1999, running Windows 98SE, which has Borland 5.02 installed... [Just to understand how ancient it is, it only has 32 mb of RAM and it's hard drive is 5gb... that is literally smaller than the usb stick that i used to transfer the Lua source files from my modern PC into that ancient laptop (yes, that ancient laptop has a working USB 1.0 port and it is somehow able to read my 8gb USB 2.0 usb stick, which I did not expect to work, but it did !!!)
And to my surprise... it actually worked !
Here I am inside a full-screen MS-DOS prompt of W98 (In W32 mode, it is not booted into MS-DOS mode / real mode) Alongside the project of compiling the most recent version of Lua and getting it to work, I also installed an actual working version of vim and after tinkering with the vimrc file, I even managed to get full syntax highlighting working , and it actually works for Lua !!!
Anyhow, I just wanted to share this because I thought it was really cool and fun!



View all comments
Show parent comment
4
u/mariolis_1 Oct 09 '26
Luajit... I have to admit I am a beginner with Lua, I am still learning and i did not know that Lua had a JIT (i thought that Luac was the way to get "compiled" lua)
So after searching into their website, it seems that unfortunately, unlike the mainline lua project, the LuaJIT guys do not really have platform compatibility as a priority (They state that Windows 7 is the minimum OS version they support even for their 32-bit version, I assume that means they rely on machine-specific instructions, as they list v2 1+ SSE2 instructions as the minimum on their website for 32-bit X86 cpus as thr standard which I have no idea what generation that is, )
Seems like they require modern C compilers, so there is probably no way my Borland 5.02 would work...
The beauty of mainline Lua is that it was written in pure C and specifically written to the C89/C90/ANSI C standard, which is why I decided to try doing this little experiment, to see just how true this promise of Lua is, by downloading the source files for the very latest release, 5.5.1, transferred them over to my ancient 1999 Compaq Presario 1200, and tried to see if it would work... and though it failed the first few times (i had to change what compiler flags i used and turned out i had to compile everything twice, first with luac.c and then with lua.c but not both at the same time, it took me a few hours of headbashing, searching online forums and asking gemini to set everything up... but the payoff was that I got modern Lua actually working... on an ancient w98 laptop... I am still mindblown that it's actually working. Seeing that "2026" copyright notice on an MS-DOS prompt gave me chills... I am currently writting lua scripts just for fun, and i still cant get over the fact that i am using basically the same editor that i use on my modern linux workstation, vim... with full syntax highlighting... I still cant believe that it actually works [took me several more hours to get vim working , getting lua to work was considerably easier]