Although pundits have joked that Java’s “write once, run everywhere” slogan might be better expressed as “write once, debug everywhere,” a relative of Java — JavaScript — has delivered on both promises better than its namesake. Thanks to its proliferation in browsers, JavaScript is a veritable lingua franca of computer languages which has led to entire applications being written in it using tools like Node.js and Electron, and not just browsers. But what if you are still using MSDOS or Windows 98? We know some of you do, at least on retro machines. Don’t feel left out, the DOjS project has jSH, a JavaScript engine for DOS and related operating systems.
Why? We don’t know, but we applaud the effort. The example from the project’s homepage shows how to rename all the file extensions in a directory:
if (args.length < 3) { Println("Usage:"); Println(" jSH.exe renall.js "); Exit(1); } var dir = args[0]; var oldExt = args[1].toUpperCase(); var newExt = args[2].toUpperCase(); var files = List(dir); for (var i = 0; i " + dir + "\\" + newName); Rename(dir + "\\" + oldName, dir + "\\" + newName); } } Println("All done...");
Of course, there are a million other ways to do this. On the other hand, there's a package manager -- assuming you have a working network connection, and we can imagine a few cases where this could be a little useful.
If you are trying to avoid JavaScript, you might have to consider retreating to CP/M. Or embrace it, and do your next logic simulation on MSDOS (maybe).
Javascript is Everywhere. Even MSDOS
Source: Manila Flash Report
0 Comments