If you hadn't realized, JS is a scripting language, which does not have an official runtime.

What that means is... How is JS code executed?

You need some other program to interpret (and possibly JIT compile) the JavaScript and actually execute it.

Normally that "other program" is a web browser like Chrome, FireFox, Safari, Opera, etc.

But those programs run JavaScript in a restricted way. That is, they only execute JavaScript attached to a web page that they loaded and within the context of that page, and they limit what the JavaScript can do to the operating system. Like can it delete files on your disk? Can it listen to an open port? Etc.

Also, those programs don't let you run JavaScript conveniently outside the context of a webpage. You can't just do at the command line: `chrome myscript.js`

Thus if you wanted to use JavaScript to write command line applications or desktop applications, using a web browser wouldn't work.

So we need another program that lets you run JavaScript from the command line, or as an executable, and we need that program to provide more facilities to the JavaScript code which allows it to do more things to the OS, such as deleting files from the disk, listening to a port, connecting to arbitrary remote servers, etc.

The first such program to appear was NodeJS. And some people don't like it. They don't like the way it runs JavaScript and the way it has exposed to JavaScript those additional OS facilities. Thus they decided to create another one called Deno.

Most languages have one defacto run-time, for example for Python it's CPython, for Ruby it is MRI, for Java it is OpenJDK, etc.

And if they have alternative ones, like Ruby also has JRuby for example. They normally copy the same language APIs, so that code for one works on the other.

In the case of Deno this is not the case. Deno decided that the NodeJS exposed JavaScript APIs arn't great, so it has a different set of language APIs. That means JavaScript code written for NodeJS will not work for Deno and vice versa.

It's really rare to see such a split in mainstream established languages, because the cost of breaking compatibility with established "in-production" code is normally too high. For example, Microsoft has build .NET core, as a new run-time for C#, but it tried really hard to provide all of the old .NET framework APIs, yet not all of them, so it did break se backwards compatibility. I believe Deno will break much more.

I've only seen this happen in the past for less popular languages, like Smalltalk has a bunch of slightly incompatible runtimes: Squeak, VisualWorks, Pharo, Cuis, etc.

And when that happens, sometimes people even consider it a whole new language, like a dialect. So in some ways, you could almost consider NodeJS and Deno to be dialects of JavaScript, since their code isn't compatible and their APIs and some of their features will differ. Similarly, their code will not always run in a browser either without rewrite, because again, the capabilities and APIs differ.

Hope this helps, I know it's kind of complicated, but at the same time it's simple. You need a runtime to run JavaScript. Each runtime can expose different APIs to the JavaScript to use, and each runtime can choose to support custom extensions of JavaScript or choose to not support certain features of JavaScript, etc. Deno and NodeJS are two such runtimes for JavaScript that are both making different choices.