alt.hn

2/9/2026 at 2:07:36 PM

UEFI Bindings for JavaScript

https://codeberg.org/smnx/promethee

by ananas-dev

2/9/2026 at 4:00:50 PM

Oh hey, we've reached the "Metal" stage! https://www.destroyallsoftware.com/talks/the-birth-and-death...

by fnimick

2/9/2026 at 4:05:17 PM

I'm doing my part ∠(‘-‘)

by monax

2/9/2026 at 4:15:15 PM

thank u 4 ur serves

by ruined

2/9/2026 at 11:57:38 PM

Interesting to see how many things Gary got wrong.

by arxpoetica

2/10/2026 at 1:19:51 AM

Funny, I've always found it interesting how "on point" it was...

Granted, yeah, we never (or haven't yet) really transitioned to running "full legacy software" inside the browser, or at least it's not common place. That said, I've seen people compile Wine to wasm, Linux to wasm, and lots of other things to wasm, and run em in a browser. Many of the "fake" demos could be done for real now.

The one aspect that remains thoroughly farcical is an equivalent of Wine for OS X/Cocoa good enough to run a web browser. :-(

[edit] And asm.js kind of died on the vine. Not sure how to feel about that one. Wasm could he described as an evolution of the same idea, but in a lot of ways it's something entirely different.

by spijdar

2/10/2026 at 4:19:22 AM

We already can execute DOS / Win 3.1 in QEMU in the browser.

Probably wouldn’t be too hard to boot Linux (under QEMU compiled for wasm), and then fire up a Windows 95 VM using QEMU TCG …

Could repeat this a few times - Inception style…

by BobbyTables2

2/10/2026 at 9:54:08 AM

yep, and 528491 as a password for everything :)

by bpavuk

2/10/2026 at 2:53:03 AM

Electron

by paulddraper

2/9/2026 at 8:48:23 PM

I don't know if it's only me, but did this guy... Did this guy make a huge mistake?

I think he was trying to bend reality with words. I can see many apps that are running in electron on my laptop, each consuming 300MB+ (e.g. Spotify), while many other apps are written in native Swift for example, especially with the help of AI, giving the best performance possible...

Edit.

And prices of RAM nowadays...

by p0w3n3d

2/9/2026 at 8:56:49 PM

Those apps are not consuming 300MB of RAM because they are written in JS. JS is running on microcontrollers and the James Webb Space Telescope.

They are consuming 300MB of RAM because they are built on Electron and the NPM ecosystem.

by pwdisswordfishy

2/10/2026 at 4:56:43 PM

Wait a second, JS in James Webb Space Telescope?? Doing what? I'd love to hear about its usecases in the telescope. Is there any blog post about it?

by just_testing

2/10/2026 at 11:23:11 AM

There is a pretty significant difference between the way JS is used there and in electron apps.

This might be what you were getting to but I tend to agree with the idea of place all the interaction logic in a high kevel language and get the performance where it's needed.

Electron does not do that and neither does the people developing electron apps most of the time. I doubt many people throwing electron apps together chose to do that so they can put their CPU intensive code in C/C++/Rust/swift, they want to erite everything in JS.

What should happen is the bare minimum needs to be in JS and the rest in an efficient compiled language.

I mean even the browser does that, the DOM API hands off to lower level libraries for multimedia etc.

by jpc0

2/9/2026 at 4:20:16 PM

Thank you for the reminder to do my yearly viewing of that video lol

by kiddico

2/9/2026 at 5:32:42 PM

Whoa, I haven not been following ASM.js stuff in any detail.

Seeing that Metal replaces kernel/userspace boundaries with VM protections for memory, meaning that system call overhead is eliminated, at the price of ASM/VM overhead.

What a fascinating idea. Kidding on the square...

by epistasis

2/9/2026 at 3:00:06 PM

Love this. An example of complete and total dominion over the machine. Great quote here too lol

> Prometheus stole fire from the gods and gave it to man. For this he was chained to a rock and tortured for eternity.

by faxmeyourcode

2/10/2026 at 5:46:24 AM

The next step would be to embed a JavaScript engine in coreboot I guess

by tosti

2/9/2026 at 9:28:18 PM

Talking about quotes, I also absolutely loved this note at the end of the readme:

> If this makes you grin, you are probably holding the torch.

by falcor84

2/9/2026 at 2:57:04 PM

Can someone break this down for me? Looks like it's using... C? to load a js interpreter which bootstraps an API around all UEFI features? Do I have that right?

And, if so, does that mean that once the API has been bootstrapped, one could actually write an OS in js? Or are there other abstractions that would need to be migrated first?

by catapart

2/9/2026 at 4:22:24 PM

You don't need a JS bootloader to write an OS in JS. The bootloader just drops the machine into some memory address for it to start executing your OS init script. that bit could be a Javascript interpreter. You can't do much with the architecture in Javascript though, because it doesn't allow you to map memory directly to your types (unless there's some ungodly nonesense I'm not aware of) so you'll have to drop into C/asm to e.g. interact with the ports/registers/tables to set up userspace.

by tatskaari

2/9/2026 at 4:57:51 PM

An OS doesn't need to have a user space :)

by Zambyte

2/9/2026 at 8:10:59 PM

You should be able to write a meta circular VM in JavaScript that targets bare metal without any C or asm.

by monocasa

2/9/2026 at 3:58:53 PM

> And, if so, does that mean that once the API has been bootstrapped, one could actually write an OS in js?

I bet somebody has done that.

https://www.google.com/search?q=os+kernel+in+javascript

Seems like a small number of hobbyists have attempted.

I've heard of people doing this with other high level languages. Basically you need enough low level code to bootstrap a VM. Once you have that, you can make the high level language decide some logic that traditionally would be in C code, like manipulating page tables or whatever.

by asveikau

2/9/2026 at 4:11:37 PM

Automatic Garbage Collection in a kernel probably won't work:

I vaguely remember hearing about someone trying to use .Net in the Windows kernel.

The big problem is garbage collection: If I remember correctly, the fact that "any" operation can fail with an out of memory exception was a huge problem. Another problem was that random pauses for garbage collections in the kernel had major stability issues.

In short, I hope that the js kernel is for amusement and education; otherwise it would need a much more advanced garbage collector then earl 2000's .Net.

by gwbas1c

2/9/2026 at 6:34:26 PM

> I vaguely remember hearing about someone trying to use .Net in the Windows kernel.

Microsoft did that, it was called Longhorn. That release cycle was long delayed and they abandoned most of its ambitious projects, especially C# in the kernel, and the result was Windows Vista.

GC was not the only reason for the failure of that project. Someone could write a book about it. A lot of it was actually more about the organization of people. I also had heard from insiders that lack of ahead of time compilation was an issue. The other issue I remember hearing about was a complaint that Windows components were not layered cleanly and they ended up with circular dependencies when they tried to rewrite them.

I think it's possible to write a kernel with GC, and to still be judicious about memory usage with a GC language. And I say that as someone who happens to think that a big issue with modern software is that too many programmers are spending their whole education and career to depend on GC without thinking about it carefully. That is to say I'm already a skeptic of high-level languages and GC, but I will still afford that it is technically possible.

by asveikau

2/9/2026 at 10:14:23 PM

Another part of it was, IIRC, that Longhorn was based off of the Windows XP core, i.e. the non-server stuff. While the Windows Server development continued apace, with lots of security and hardening to make for a reliable OS to build upon, the Windows Non-Server team continued with the existing mess of a codebase, not prioritizing security features or stability in favor of trying to manage feature creep. Longhorn was meant as a stopgap between XP and 'Blackcomb', but a lot of Blackcomb stuff started creeping backwards, bogging them down.

When security and reliability were suddenly key issues for Microsoft (to the extent that they ever were), it was obvious that what the Longhorn team had built was never going to meet that bar so they started over building off the Windows Server codebase instead.

Most of this story I remember from a video on YouTube of that old guy who worked at Microsoft since forever and left around the time of the Longhorn debacle, but a lot of it is corroborated in the Wikipedia article as well. https://en.wikipedia.org/wiki/Development_of_Windows_Vista

by danudey

2/9/2026 at 11:08:20 PM

> I think it's possible to write a kernel with GC, and to still be judicious about memory usage with a GC language. ... but I will still afford that it is technically possible.

I need to split some hairs for a bit:

Do you mean what is colloquially referred to as "GC", as in the dotnet / Java / Javascript / golang "mark-and-sweep", fully-automatic style?

Or do you mean other automatic memory management systems, which some people technically define as GC, like automatic reference counting? (IE, they clean up memory immediately, and except for requiring some manual form of breaking cyclic loops, generally are fully automatic?)

by gwbas1c

2/10/2026 at 1:22:36 AM

Given that we are talking about JavaScript, I meant the former.

The latter is pretty much the status quo in terms of the state of the art. Most kernels aren't built with automatic reference counting, reference counted objects are plentiful even if more manual, but the automatic part is trivial to add to a C++ code base using smart pointers for example, and things like rust or apple ARC can also do it.

I think the former (a "true" GC that can resolve cycles) could be done in a kernel, it's just not common.

I'm not well versed in this historical example, did the "lisp machine" not have a GC in its OS?

by asveikau

2/11/2026 at 1:54:24 PM

According to https://en.wikipedia.org/wiki/Lisp_machine

> These machines had hardware support for various primitive Lisp operations (data type testing, CDR coding) and also hardware support for incremental garbage collection.

That being said, hardware garbage collection never really took off. When I look at GC languages they all have significantly different memory models, so I can see why. (For a more modern take on this, look into why dotnet can't use the proposed WASM garbage collector. Dotnet needs more metadata and finalizers, which WASM's GC doesn't provide.)

But getting back to a Javascript kernel with GC: I would think "stop the world" pauses would cause non-deterministic issues? (IE, if an interrupt has a long pause due to a GC?) It might only work if the kernel borrowed techniques from "real time Java" programming techniques?

by gwbas1c

2/9/2026 at 8:53:28 PM

> trying to use .Net in the Windows kernel.

> Microsoft did that, it was called Longhorn

Do you have any reference for that? Or are you confusing Longhorn with Singularity (https://en.wikipedia.org/wiki/Singularity_(operating_system)) / Midori (https://en.wikipedia.org/wiki/Midori_(operating_system))?

I suspect you're referring to the shell/internals, though, not the kernel (https://longhorn.ms/the-reset/#:~:text=Why%20start%20over,re...)

by anonymars

2/9/2026 at 9:13:51 PM

My source for that is I was on the Windows team at Microsoft from 2008-2011. I learned a bunch of this history from talking to coworkers who were there. I specifically recall people talking about c# in the kernel.

by asveikau

2/9/2026 at 4:21:20 PM

You'd need to write an entire hardware abstraction layer to do anything useful. There's projects that do this for microcontrollers - eg MicroPython and Espruino.

by leoedin

2/10/2026 at 1:29:18 AM

Yes, it would need support from lower level code. But then, so does C -- many things that an OS needs to do, such as installing interrupt handlers, changing the current page table pointer, jumping into a target process already in progress, etc., are not part of the C standard.

by asveikau

2/9/2026 at 9:18:54 PM

Should be able to do similar with MicroQuickJS or maybe just QuickJS...

by tracker1

2/9/2026 at 3:00:48 PM

Depending on your definition of OS, yeah you could do that :)

by monax

2/9/2026 at 3:20:56 PM

Hey, when Apple transitioned from m68k to PowerPC, it took them a hell of a long time to rewrite massive parts of their OS. It's a low bar, though...

by nxobject

2/9/2026 at 3:51:00 PM

OS in JS, ok I am interested now...

by DustinBrett

2/9/2026 at 2:56:24 PM

I presume you'll add the network stack next, so that I can use my favourite, most useful packages?

  import isOdd from "https://unpkg.com/is-odd";

by my_throwaway23

2/9/2026 at 3:10:15 PM

Well, there's a network stack already there, including HTTP and HTTPS on newer firmwares.

by p_l

2/9/2026 at 2:59:31 PM

We are getting isOdd in the bootloader before GTA-IV

by monax

2/9/2026 at 3:17:20 PM

Wait, when did I time-travel?

by spiffyk

2/9/2026 at 3:23:27 PM

oops typo

by monax

2/9/2026 at 2:58:06 PM

This project will go places. Like every silly project not intended for production. :)

by bayindirh

2/9/2026 at 2:44:18 PM

next step is to create a UEFI TUI using react (please don't)

by redvulps

2/9/2026 at 9:20:17 PM

Considering how bad some of the Gamer-ish firmware UIs are now, it might be an improvement.

by tracker1

2/9/2026 at 3:13:09 PM

you may just have casted a curse on our future motherboards, damn you

by aruametello

2/9/2026 at 2:45:41 PM

OMG we can use ink for that

by monax

2/10/2026 at 3:04:46 PM

Just today I have found out there is a CLI TUI framework that uses React.

It's what Claude Code is using.

by karel-3d

2/9/2026 at 3:49:43 PM

> If this makes you grin, you are probably holding the torch.

What if it makes me recoil in horror? screams into the void

by eqvinox

2/9/2026 at 2:24:32 PM

Wow, this is cursed.

by edward28

2/9/2026 at 2:36:26 PM

I think the proper term is blursed.

by lnenad

2/9/2026 at 2:27:04 PM

I think r/unixporn will love it once it gets DOM support :^)

by monax

2/9/2026 at 2:38:48 PM

Finally, we can create splash screen animations in pure CSS!

by kijin

2/9/2026 at 3:38:31 PM

Does it manage to support floats? I am not sure if those can be safely used in the UEFI environment. (I recall GRUB’s build of Lua being integer-only, and Linux avoiding the use of floating-point arithmetic in kernel mode, but I don’t remember the reason.)

by pwdisswordfishy

2/9/2026 at 6:38:37 PM

Floating point was not supported in the Linux kernel to avoid having to save/restore FP registers.

by flopsamjetsam

2/9/2026 at 3:39:39 PM

Yeah floats works

by monax

2/9/2026 at 4:34:02 PM

This is both so impressive and cursed that I'm not sure how to feel.

by juancn

2/9/2026 at 3:21:51 PM

Turning in the widening gyre, the falcon cannot hear the falconer. The center cannot hold.. The old prophecy is coming true.

by lioeters

2/9/2026 at 4:56:00 PM

I think there are two philosophies here:

1) JavaScript must stay in the box (aka in the browser).

2) JavaScript as a general purpose programming language.

While I can absolutely understand 1), I have had wanted to access the filesystem via JavaScript, just as I do via ruby or python, for local use only. After I googled for a while, they would say that this is not possible unless one uses npm/node. I think this shows that there are use cases here and the "default" JavaScript, aka 1), does not cover these. I do not like JavaScript, but based on my own use cases, I actually favour 2) far more than 1). So from that point of view, being able to access UEFI can also be useful. So why not.

by shevy-java

2/9/2026 at 5:31:22 PM

> I have had wanted to access the filesystem via JavaScript, just as I do via ruby or python

There are some (limited) ways to do so now: https://developer.mozilla.org/en-US/docs/Web/API/File_System...

As for (1) vs (2), it’s not really an issue of JavaScript at all. The main question is, do you want to build something that runs in a browser? If you’re building a web app, you’ll have to use the sandboxed APIs (and probably JavaScript). If you don’t care about the runtime, yeah, you can use Node or Bun or Deno (or use another language altogether).

by notpushkin

2/9/2026 at 8:59:40 PM

> I googled for a while, they would say that this is not possible unless one uses npm/node

Gnome Shell and Firefox/SeaMonkey/Mozilla Application Suite/Netscape 6+ (and Zotero[1]) are implemented on top of SpiderMonkey.

1. <https://news.ycombinator.com/item?id=46735616>

by pwdisswordfishy

2/9/2026 at 7:40:47 PM

You are missing one option:

0) JavaScript must be abolished from the browser

by watermelon0

2/9/2026 at 9:23:27 PM

I've been using Deno a LOT for general shell scripting... it's been pretty nice in general. FWIW, Node, Bun and Deno have FS interfaces in the box, so yes, you can do it without npm modules. Though Deno allows you to directly reference the modules/repos from the script without needing a separate install step, package.json or node_modules directory.

It's also a single, self-updating executable and includes a lot in the box. Including SQLite3.

by tracker1

2/9/2026 at 5:32:34 PM

Try webkitdirectory file attribute for browser access to the file system.

by DJBunnies

2/9/2026 at 4:17:26 PM

This is hilarious lol, it’ll be any day now before we get a full JS kernel. Garbage collection could be an obstacle, but I know there have been some kernels written in Go/Java before

by sanufar

2/9/2026 at 4:19:37 PM

Who needs to garbage collect? Just leak memory until the system dies! That strategy seems to be good enough for claude code, anyway.

by fnimick

2/9/2026 at 4:44:43 PM

If it’s good enough for missile guidance systems, it’s good enough for me.

by cluckindan

2/9/2026 at 6:26:51 PM

I don't have real context here, but I can imagine that a platform where the hardware costs millions of dollars, will be booted up in "Production" exactly once, and is guaranteed to be physically destroyed before it hits 1 day of uptime, just "Give it 128GB of RAM and YOLO (literally)" is great advice!

Note: 128GB of DRAM may add another million dollars to the build cost by 2027 at the current derivative of the $/GB curve

by xp84

2/9/2026 at 10:51:07 PM

Finally I will be able to have graphical bootup logo like in The Hackers?

by iberator

2/9/2026 at 8:29:22 PM

Javascript is a horrible choice but I think having a scripting language for this is actually quite a good idea. If only there was a popular scripting language that didn't totally suck balls.

by IshKebab

2/10/2026 at 2:46:59 AM

Paul Graham only uses computers that use Lisp in the same way. But it's so good that he keeps it to himself, it's his competitive advantage.

by chihuahua

2/9/2026 at 4:06:33 PM

I’m always amazed and slightly envious of what programming languages with large developer bases can do. I mean if a language is Turing complete it can do anything, but JavaScript takes this to the extreme.

Mind you I never said anything about quality or performance, obviously doing everything in JavaScript comes with it’s own issues but if you were to say that someone got JavaScript running in the Linux kernel as a POC I wouldn’t even be surprised

by Decabytes

2/9/2026 at 7:56:09 PM

>boot sector

>looks inside

>node modules

by moffkalast

2/9/2026 at 4:16:25 PM

Could this be used as a learning tool? Rebooting the computer takes so much more time compared to reloading the browser tab. And you probably can't brick your computer.

by vaylian

2/9/2026 at 3:03:23 PM

Can't wait for browser support for this... ;-)

by Smalltalker-80

2/9/2026 at 4:18:12 PM

webuefi has already been shipped by google for use on chromebooks. but mozilla and apple irrationally refuse to implement the standard for "security reasons"

by ruined

2/10/2026 at 5:59:14 AM

You jest but W3C is more or less synonymous with Google nowadays.

by tosti

2/9/2026 at 3:08:38 PM

Soon™

by monax

2/9/2026 at 2:29:46 PM

"Your scientists were so preoccupied with whether or not they could, they didn't stop to think if they should."

Pretty neat, though.

by g051051

2/9/2026 at 2:39:08 PM

Yeah, but your [developers] were so preoccupied with whether or not they could, they didn't stop to think if they should.

by fbnszb

2/10/2026 at 12:02:36 PM

Your developers were so preoccupied with whether or not they could that they didn't stop to think if they should.

by lproven

2/9/2026 at 3:35:11 PM

> If this makes you grin you are probably holding a torch

Hilarious

by ycombinatornews

2/9/2026 at 3:44:13 PM

This is incredible.

by rafram

2/9/2026 at 3:06:20 PM

Your scientists were so preoccupied with whether or not they could, they didn't stop to think if they should!

by bwat49

2/9/2026 at 3:24:30 PM

Awesome! Everything will be rewritten in JS

by grougnax

2/9/2026 at 3:34:43 PM

It begins!

by rezmason

2/9/2026 at 3:08:27 PM

Finally!

by fenwick67

2/9/2026 at 3:06:11 PM

I love it.

by outadoc

2/9/2026 at 2:26:53 PM

But why?

by madduci

2/9/2026 at 2:28:17 PM

It's just a silly experiment; the real endgame is to make a bootloader that is customisable using HTML/CSS/JS

by monax

2/9/2026 at 2:32:40 PM

Since PDFs can contain JS, presumably that should be the preferred way of modifying your boot loader.

by magicalhippo

2/9/2026 at 2:36:55 PM

Yeah that's the natural next step, I'll work on that next

by monax

2/9/2026 at 3:18:55 PM

Why not?

by ThrowawayTestr

2/9/2026 at 3:26:07 PM

Because this can end very badly. It is a new surface to attack

by madduci

2/9/2026 at 3:52:40 PM

Why is it a new surface? Either you can run UEFI code, or you can't. Attacking the JS interpreter itself is unrealistic IMHO, it's the poorly written JavaScript running on top of this that might open new surfaces of attack. But other UEFI code is mostly written in C or C++, so let's call that a wash?

by eqvinox

2/9/2026 at 3:36:41 PM

Exactly! It's actually great! More ways to jailbreak stuff.

by M95D

2/9/2026 at 3:36:08 PM

Maybe? What's your threat model?

by yjftsjthsd-h

2/9/2026 at 7:55:52 PM

Cursed, but fun

by smetannik

2/9/2026 at 10:33:15 PM

Beautiful

by javascriptfan69

2/9/2026 at 3:35:09 PM

Cursed

by dfedbeef

2/9/2026 at 10:22:13 PM

good. god.

by fennec-posix

2/9/2026 at 5:01:47 PM

[dead]

by raphaelmolly8

2/9/2026 at 5:27:32 PM

Are em-dashes really that common to use or did I just start noticing them after LLMs became popular for rewriting comments?

Not implying your comment is LLM generated, clearly it isn't but asking as a genuine question.

by written-beyond

2/9/2026 at 5:59:33 PM

Pretty dang common. OS X and macOS (and maybe iOS and iPadOS, though I'm not certain) have been autocorrecting "--" into "—" for over a decade. Windows users have been using Alt codes for them since approximately forever ago: https://superuser.com/q/811318.

Typography nerds, which are likely overrepresented on HN, love both em dash and en dash, and we especially love knowing when to use each. Punctation geeks, too! If you know what an octothorp or an interrobang are, you've probably been using em dashes for a long time.

Folks who didn't know what an em dash was by name are now experiencing the Baader-Meinhof phenomenon en masse. I've literally had to disable my "--" autocorrect just to not be accused of using an LLM when writing. It's annoying.

by Kerrick

2/9/2026 at 6:14:16 PM

⌥- produces a – as well. That's sometimes easier than typing `--` and hoping for the best.

by geocar

2/9/2026 at 10:37:32 PM

That's an en-dash. You want to also hold shift to make it an em-dash.

by ziml77

2/10/2026 at 6:48:58 AM

oh cool —–—– ——— ——— –—––

cheers for that never even noticed

by geocar

2/9/2026 at 6:15:07 PM

It really is. We dash-users are the real and most important victims of the AI revolution. I hope someday our story will be told (by the machines)

by xp84

2/10/2026 at 2:42:29 AM

Greetings, fellow human. I am Mr. Young — a real human person — from Akron, Ohio. I, too, like to use em-dashes — for clarity and sparkling style.

by chihuahua