Saw this on the JS runtime. Is this of interest to anyone

Sorry, it does seem interesting on how the runtime has been completely rebuilt.

I think I've posted about trying Node-RED with Bun and Deno previously. If I remember correctly, last time I tried, I think I did manage to run Node-RED with Bun.

The main trouble is, like using pnpm instead of npm, the alternatives are not direct replacements for all situations and they are relatively minor in use. So there doesn't seem to be a way to be certain that things will work. It doesn't seem worth the effort you need to put in vs the potential reward you might get.

Bun and Deno are certainly useful for forcing the NodeJS project to move forward and they can be really good for specific projects. But Node-RED is a general compute platform with thousands of extension packages and running under an alternative runtime is somewhat risky.

You might remember that there was a split previously when some folk got fed up with the limited development of NodeJS. Eventually, the split was forced to re-consolidate again. Not sure that will happen this time but that is another risk.

Definitely interesting. I tried it a long time ago when it seemed to be promoted as a great and viable alternative to nodejs. Unfortunately, it was lacking many features that I had come to depend on with nodejs and it was simply unusable.

Just recently, about a week ago, I gave bun another try and found out that it could easily run my precompiled c++ addon that utilizes ffmpeg's libav shared libraries. I am not sure if that was made possible after anthropic acquired them and it was rebuilt in rust or if that was already supported, but it was pretty cool that it could do that. The restriction for keeping the addon cross compatible is to make sure that no v8 specific apis were used.

As a side note, deno also ran my precompiled addon.

So naturally, I had to stress test and benchmark the latest versions of the 3 runtimes against each other decoding 10 h264/h265 streams simultaneously and all 3 cpu loads and rss memory were very comparable. A slightly older version of bun had something wrong and showed double the memory usage compared to deno or nodejs, but a recent update fixed that issue.

Bun is getting better and better and faster. They added fast built-in image decoding (exif, resizing, reencoding, api similar to sharp), markdown/xml parser and no need for express. A unified api for sql, all very useful stuff.

If you use AI for coding projects, most will automatically choose bun, it is more efficient and faster to implement and it has all core features you may need. It is not 100% compatible with node, but it is getting there, and you can cross compile to a binary without the need of the actual OS.

I am not sure if that was made possible after anthropic acquired them

I am also not sure if this is a good or bad thing that antrophic aquired them, it remains MIT. Also claude code is actually using bun to compile their binaries, safe to say it is production ready.

Ok, I'll be showing my ignorance here/now.
When I was young and started playing with computers there were two ways to make a program.

Interpreted and Compiled.

Each with its own quirks.

And now there is the program stack.

So, my take is that NR is Compiled, because to get things to work you have to DEPLOY after making changes.

Though @TotallyInformation mentioned pnpm - which I take it is like npm. (Ok, he did kinda say that), isn't that just a different thing/part of the program stack?

Yeah, I am probably saying things I don't mean directly. My language processor is on holiday just now.

It isn't a big deal, but if compile time can be smashed with Bun.....
to me it begs the question. :wink:

Anyway, I just mentioned it in passing.

Thanks to all who replied.

So, my take is that NR is Compiled, because to get things to work you have to DEPLOY after making changes.

No, "Deploy" is sending the version of the flow in the editor (the browser) to the backend and telling it to run it. It is never compiled, the canvas is just a rendering of the flow.json that is held in memory in the browser before it is sent o the backend.

(I am deliberately not going near JIT compilers or TypeScript being complied to JavaScript as that will just complicate things, just assume that all of Node-RED and NodeJS apps in general are interpreted).

As hardlib says, node-red does not need compiling since it is a node.js (JavaScript) app. However, it does need a build step. This puts together a great many scripts and style sheets and libraries into a more manageable and efficient set of files that make up the package.

As for npm, pnpn, and yarn, these are package managers. They download and sort out packages from various locations as needed and make sure that the packages are usable. They sort out dependencies and even kick off compiles if needed for binary libraries.