Javascript Is Everywhere. Even MSDOS

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).

35 thoughts on “Javascript Is Everywhere. Even MSDOS

    1. You and the author are both confused. JavaScript has zilch to do with java. If anything JavaScript is a dialect of lisp with C syntax.

      So maybe you can get started on porting apache tomcat to some other language. It is the basis for many of the web apps that we all use every day. Which language will you choose?

    2. Blu-ray? Menus 😉
      I actually like java
      Javascript on the other hand, object creation is just a pain in the butt, the language doesn’t like it, and it’s just hacks on hacks to make it work.

    1. Java is as much a relative of JavaScript as C is to COBOL. It contains the same letter is all. Ok there might be a bit more to it but not much and certainly not enough to call them related.

    1. JS sucks because it was “designed” in 10 days as an alternative to embedding Scheme into Netscape Navigator. And the name was a total marketing trick. It had to be new and have a cute name. Quality or consitency were not in the plan.

  1. What I miss is Controle de Scripts, a browser plugin that could finely control what types of Javascript actions would be allowed or blocked. For example it could allow user initiated popups but block any that were automatically done by the code. So goodbye to those annoying auto-forwards while still opening things like login popups.

    It could also block any blocking of right clicks, highlighting, copying, and pasting.

  2. After moving on from my Tandy Color 3 TRS 128k to a Packard Bell 486SX 33MHz 1MB RAM 210MB HDD 2400baud modem in the early 1990s I became almost in love with MS-DOS. Anyhow.

    I wouldn’t mind breaking out a virtual machine with MS-DOS and a 32 bit capable Pascal or C compiler and creating a web browser that can work with that DOjS / jsh project.

    Sounds like fun but I would turn completely gray before I got close to 1/2 way done with it.

  3. Worth mentioning what the requirements are: 386 with 4 MB. That’s a early-1990s machine, not early 1980s. Neither IBM PC nor AT can run this. And they really recommend a Pentium with 8MB. That’s the same requirements as early Linux. So yes it’s MS-DOS, but still requires a hefty machine for the time.

    It’s too bad that even cut-down versions of modern languages require hefty resources. Java Virtual Machine code can be emulated on a 6502 Apple IIe (if 128K), or even translated to 8-bit processors with the “Grinder”, but none can self-host a Java compiler. I’ve looked into compiling MicroPython into a 8-bit, but it requires 32-bit ints and is just too big. MicroPython might fit into a full-memory IBM PC if somebody can get the right C compiler to compile it.

    1. > It’s too bad that even cut-down versions of modern languages require hefty resources.

      Let’s dedust PCC! C, C++ and Fortran for multiple targets in the size of fly shit compared to GCC and LLVM.

      And no central internet repo for sources. Remember the hacked pip repo and the daily JS problems? That alone makes me want to not touch these open doors for infections. GO? No way!

      Ever tried to bootstrap ZIG on a 32bitter?
      Does it work again?
      Will it be even bigger than Symbiflow when it reaches 1.0?

      We’re heading the wrong way with IT.
      And we’re doing it full throttle.

      Does someone still count errors?

      Or do we just live with them because the next blingbling is more important than bug free code?

      And yes, I still love CP/M, the Z80 and the M68k!
      But a Unix is a sweet siren too…

  4. Either there is some sever built-in file.renaming magick in JavaScript, or that code is missing something. Such as how to convert from old/newExt to old/newName.
    Or a it’s a bit weird .the usage example contains one argument, but the program requires 3 to do any action.

  5. When applying for a programmer job it is vital to ask ‘How much server side Javascript do you use’?

    If the answer is anything but ‘none’, _run_ away. You don’t want to work for a company that makes that kind of decision. Everything else will be equally stupid.

  6. Come on, Java is actually cool. Install the JVM on any device and you can run 20 year old Java programs on your brand new computers.

    Javascript is a monstrosity that has been consistently slowing down web browsers for the last decade, with no sign of slowing down. It is a key component of contemporary planned obsolescence of computers, smartphones and tablets, as it renders web browsing almost unusable after a year or two with no added value from the user, since most of what JS does is data harvesting for FB, Google and the lot.

  7. JavaScript’s versatility extends beyond the web, proving its adaptability even in environments like MS-DOS. This underscores its powerful capabilities and widespread utility across various platforms, making it a truly ubiquitous programming language.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.