JSLinux
392 points
12 days ago
| 25 comments
| bellard.org
| HN
tombl
11 days ago
[-]
Fabrice does a great job at building these self-contained pieces of software which often grow to have lives of their own. As a lesser known example, JSLinux's terminal emulator was forked a few times and is now known as xterm.js, which has become the predominant web embeddable terminal emulator.

This all comes full circle, because now I'm building a true successor to JSLinux that's way faster because I've natively compiled the kernel/userspace to wasm, and of course I'm using xterm.js for the terminal emulation.

If you like buggy demos that probably shouldn't be shared yet, you should check out https://linux.tombl.dev, but note that it's currently just a busybox shell and nothing else, so I hope you're good with `echo *` instead of `ls`.

reply
apitman
11 days ago
[-]
I like to say Fabrice creates side projects that others spend their entire careers maintaining.

I knew about QEMU, ffmpeg, his LTE stuff, and QuickJS. I had no idea xterm.js started with him too.

reply
simonw
10 days ago
[-]
He's also been hacking on a (closed source) LLM inference server since the GPT-2 days: https://bellard.org/ts_server/
reply
pantalaimon
11 days ago
[-]
This produces

        attempted to munmap
        ------------[ cut here ]------------
        WARNING: CPU: 3 PID: 36 at kernel/exit.c:812 0x00000000
        CPU: 3 PID: 36 Comm: sh Not tainted 6.1.132 #
        Stack:
            at vmlinux.o.__warn (https://linux.tombl.dev/dist/vmlinux-NLTKI6YG.wasm:wasm-function[278]:0x17655)
            at vmlinux.o.warn_slowpath_fmt (https://linux.tombl.dev/dist/vmlinux-NLTKI6YG.wasm:wasm-function[279]:0x1772b)
            at vmlinux.o.do_exit (https://linux.tombl.dev/dist/vmlinux-NLTKI6YG.wasm:wasm-function[329]:0x1985e)
            at vmlinux.o.task_entry_inner (https://linux.tombl.dev/dist/vmlinux-NLTKI6YG.wasm:wasm-function[154]:0x12249)
            at vmlinux.o.task_entry (https://linux.tombl.dev/dist/vmlinux-NLTKI6YG.wasm:wasm-function[153]:0x12155)
            at self.onmessage (https://linux.tombl.dev/dist/worker-MHWHWELT.js:151:53)
        ---[ end trace 0000000000000000 ]---
on any command
reply
tombl
11 days ago
[-]
yep, that's to be expected, this is a very wip demo. I'm implementing exec() support now, so currently only shell builtins work.
reply
jerf
11 days ago
[-]
"I'm implementing exec() support now"

Bah. Details, details dismissive hand wave.

It's just minimalism, right? I hear it's all the rage.

reply
tombl
10 days ago
[-]
I'm effectively lying to the kernel about the environment it's executing in, and trying to convince it that it's running on the kind of hardware it expects, when in reality it's running inside a very different environment.

Since I map guest threads 1:1 to host threads in JS, and architecture-specific code manages the loading/unloading of programs, the exec syscall is exercising these lies in a way that they're not currently equipped to handle.

What I'm currently doing is improving those lies to the point where exec stops noticing they're lies and just starts functioning as expected.

reply
remram
11 days ago
[-]
Leave it as an exercise to the reader.
reply
all2
10 days ago
[-]
I had to implement exec() on Unix V6 for my OS course at uni.
reply
ebiester
11 days ago
[-]
I mean, "demos that shouldn't be shared" from the root comment implies that it isn't done, right?
reply
7bit
10 days ago
[-]
I got that with echo * which you suggested to use :)

I opened that on my Android Phone and half expected it not to boot at all. But it does. I have no idea about the state of WASM n stuff, but apparently, it's much more eadvanced than I anticipated. Mind blown.

reply
chjj
11 days ago
[-]
This brings back memories. I haven't looked at it in a while, but I'm glad to see the fork[1] of my fork[2] from 12 years ago is still thriving. Looks like it's been mostly rewritten. Probably for the better.

[1] https://github.com/xtermjs/xterm.js [2] https://github.com/chjj/term.js

reply
fsiefken
11 days ago
[-]
Awesome, I suppose it's more energy efficient then jslinux and can be run on iOS, it might be a good alternative for A-Shell or iSH. I tried it on my a MacBook, but the keyboard input doesn't register.
reply
tombl
11 days ago
[-]
Thanks for pointing this out, I've deployed a fix. One of my goals for the project is to create a useful computing environment on top of any arbitrary locked down platform, so I'd love to turn it into an iOS app at some point.
reply
LoganDark
10 days ago
[-]
Dreamcast web browser? :)
reply
agumonkey
11 days ago
[-]
is there any command working ? ps, cat, vi, ed .. they all crash (I don't know enough about embedding busybox to know what to do)
reply
ohc
10 days ago
[-]
You can hit Tab twice to get a list of commands that are available
reply
agumonkey
8 days ago
[-]
ah thanks
reply
tombert
11 days ago
[-]
Fabrice is amazing. The amount of stuff this guy has built is utterly incredible.

If I built any one of the things he's built (ffmpeg, qemu, tinyc) I would never stop bragging about it. Instead, he just keeps hacking on other cool stuff.

reply
wruza
11 days ago
[-]
Yeah why don't we learn what he wants and just give it to him, in return he'll properly rewrite all the broken shit we have. Phones, operating systems, desktop environments, countries, appstores, etc.
reply
yason
11 days ago
[-]
I can imagine he wouldn't be interested in any of that. The joy of hacking only emerges when there are no external demands. That's why work sucks and you need to pay people to work for your demands.
reply
IggleSniggle
11 days ago
[-]
Yup. I can't even enjoy hacking if the taskmaster is MYSELF
reply
phanimahesh
11 days ago
[-]
Yes! I'm looking for ways to trick myself or otherwise convince myself to make progress on any of the bazillion totally awesome ideas I keep accumulating. Or one of the many projects I start and abandon midway
reply
throwaway889900
10 days ago
[-]
Sounds like you need an Alex Horne.
reply
ForOldHack
11 days ago
[-]
This is literally a brilliant idea. This guy needs a Macarthur grant now. Even if he rewrites half of all the broken shit we have, (and takes all of 20 years to do it) the world will be a better place. Except for _ which will always be a ___ hole.
reply
keepamovin
11 days ago
[-]
There's enough money on HN (the demographics) that some wealthy benefactors in a WhatsApp group could just donate it to him. No excuses, get behind ICs.

Of course, back in Renaissance days it was the ICs/artists job to court benefactors -- though sometimes they did approach unsolicited.

Maybe he already has patronage but he doesn't want to flash it around...

reply
ForOldHack
11 days ago
[-]
Redmond.

This guy should have had a Macarthur grant a decade ago.

The list of brilliant stuff he has done is longer than my arm, and I have long arms.

reply
melvinroest
11 days ago
[-]
Just writing a comment here to support this idea as much as I can on HN.

I also upvoted all the comments mentioning that he should have a grant. In my opinion, he really should have.

reply
throwaway2037
11 days ago
[-]
As I understand, he was born in France, so probably a French national. According to Wiki (https://en.wikipedia.org/wiki/MacArthur_Fellows_Program), he needs to be a citizen or resident of the US to qualify. Bummer. Better idea: Get some crypto-bros to donate 5-10B USD in Bitcoin into a foundation so we can create the international version.
reply
benterix
11 days ago
[-]
> in return he'll properly rewrite all the broken shit we have

Probably that's exactly what he doesn't want.

reply
underdeserver
11 days ago
[-]
Wait, countries?
reply
6510
11 days ago
[-]
A lot of countries picked the low hanging fruit but the trees are very tall.

When making an application one should look from the user perspective.

Say you want to start a business. You edit the profile page, check the entrepreneur box, it goes into a kind of supper pursuit mode with menus folding out, you fill out the company name, >>click<< the button to generate a bank number, a tax number, a registration number, a phone number, a domain name, hosting, etc If you sell something it goes into the bank account and sales tax or vat is subtracted. You press the add employee button, pick a standard contract and fill out the hours per week. Salaries will come out of your government bank account with income tax subtracted automatically. The generated website lists your products and services and is aggregated into a complete country-wide db with everything in it and a glorious search interface. Investors can log in on the website automatically. Upload the business plan if you have one so that AI can give you free money.

Real estate listings pop up, the right machines to buy, office equipment, potential employees...

An agenda is generated with a list of people the AI thinks you should be talking to. Check the box to plan the appointments.

Add music, sound effects and animations to everything as if we are 5 years old.

reply
p0w3n3d
11 days ago
[-]
I love this guy. Half of the world's android development has been made easier due to his courtesy, and it's getting more (his qemu is ubiquitous)
reply
danielEM
11 days ago
[-]
100% agree, would like to meet that guy one day
reply
ForOldHack
11 days ago
[-]
Please - anyone - announce a talk he is going to give. I would listen to him. I just heard Vint Cerf speak on martian probe networking.
reply
NetOpWibby
11 days ago
[-]
I know what I’m listening to when I wake up
reply
dingdingdang
10 days ago
[-]
I know for a fact that ppl are serious on hn when they post in their sleep without any fanfare whatsoever
reply
xorcist
11 days ago
[-]
Also the same person who wrote LZEXE, which might be familiar to people who used DOS.
reply
jebarker
11 days ago
[-]
I'd love to know how he chooses what to work on. I wonder if he just follows his interest?
reply
jorvi
11 days ago
[-]
Don't forget VLC! Probably his most well-known project.
reply
amiga386
11 days ago
[-]
I think you mean FFmpeg
reply
tuananh
11 days ago
[-]
i thought it's Jean Baptiste Kempf ?
reply
jorvi
10 days ago
[-]
You are right, I have my Frenchies mixed up.
reply
smusamashah
11 days ago
[-]
reply
DrNosferatu
11 days ago
[-]
reply
smusamashah
11 days ago
[-]
Is the UI of OS an emulation? First link says it's a simulation not an emulator.
reply
DrNosferatu
10 days ago
[-]
But very useful nevertheless - and there’s full Amiga emulation in the other links.
reply
DrNosferatu
11 days ago
[-]
Is this list just 16bit?
reply
lxgr
11 days ago
[-]
At least v86 supports 32 bit x86 OSes too.
reply
pveierland
11 days ago
[-]
Considering the extremes of prolific developers gives interesting contrast to dogmas such as "functions/files should never be above x lines", where `quickjs.c` is 50k lines and has functions that are hundreds of lines long:

https://github.com/bellard/quickjs/blob/master/quickjs.c

(Obviously different approaches suits different circumstances.)

reply
lifthrasiir
11 days ago
[-]
The answer is simple: Bellard can recall all 50K lines of context, while most can't. I too happen to have a larger working memory and only later realized that my threshold for files and functions is way higher than most others. The dogma is only required when the file is to be read and written by multiple people.
reply
Timwi
11 days ago
[-]
I have written long methods and will do so again and I wouldn't say it's because I have larger working memory or some other supposedly superior attribute. Some methods are just a long series of steps that you can just write one after another. Reading it from top to bottom is exactly as difficult/confusing/whatever as reading them as separate methods would be (assuming you put short comments in the same places where you would otherwise break it up). I think people just don't want inexperienced programmers to do that because they'll end up with tons of mutable state spanning the whole thing, and it's easier to tell them to break it up into methods than to explain what you mean by mutable state and limited scope.
reply
lifthrasiir
11 days ago
[-]
Of course that's a legitimate case of longer files or functions, but I found that I was generally able to follow much larger functions, so comfortable with writing larger-than-average code in general.

Also I should note that longer code doesn't mean less abstraction; it rather means that abstraction is done without separate functions and files, and ordering and visual cues can (and probably should heavily) be used instead. Apparently this is not enough for most others though, as I have received multiple complaints in spite of such readability efforts.

reply
p0w3n3d
11 days ago
[-]
Tbh I've lived already through at least three different dogmas contradicting each other. Those are sometimes behaving like a fashion
reply
lifthrasiir
11 days ago
[-]
I would say that dogmas are normally born out of necessity before they become dogmatic, so it is beneficial to analyze and extract core values out of dogmas instead of entirely ignoring them. In this particular case we can conclude that the threshold should be determined per team, because some team may have a member whose working memory is exceptionally smaller than the average. (Ultimately this shouldn't surprise anyone because the coding convention has to be per team anyway.)
reply
p0w3n3d
11 days ago
[-]
I never ignored them and usually followed them. They always have reason but sometimes there appears another reason that longs for a solution contradicting the previous dogma.

E.g. monolith -> modular monolith -> microservices

reply
2b3a51
11 days ago
[-]
https://bellard.org/qemacs/

Has written his own editor, presumably to support preferred working style, using emacs idiom for UI.

reply
dmd
11 days ago
[-]
I feel like this is an underrated superpower. I don't have it - my digit span[0] is about 3, well below normal, so I've always felt that while I'm pretty smart (and managed to get a scientific PhD at an Ivy, so my brain's doing /something/ right), I've always felt like I'm driving a Ferrari but the windows are all blacked out and I'm looking through a tiny hole.

[0] https://en.wikipedia.org/wiki/Memory_span

reply
spookie
11 days ago
[-]
tbh working on one file is most often much more ergonomic for me. Depends entirely on the sw architecture of course.
reply
saghul
11 days ago
[-]
I work on that codebase (we forked it off to QuickJS-ng) and while daunting at first, it's somewhat easy to work with, with the right editor! Many of them choke on such a large file, alas.

While it being a very large file, it's sorted somewhat semantically, so it's easy to work on adding a new iterator method, for example, since they are all close to each other.

reply
wiseowise
11 days ago
[-]
Because people you’re working with are not Fabrice. It is easier to say “don’t do X at all” than explain when it is safe to break the rule.

Also, this would depend on language of choice. JVM, for example, might not inline function above certain threshold of bytecode instructions.

reply
worewood
11 days ago
[-]
Case in point: .NET's garbage collector which is a single 54k loc C++ file.
reply
larschdk
11 days ago
[-]
Rather one long function than does one thing well than multiple function that are strongly coupled and difficult to reason about. Programmers who apply dogmas can be harmful.
reply
txdv
11 days ago
[-]
I think this person creates these marvels entirely by himself. There is no need for collaboration rules.
reply
klarko
11 days ago
[-]
In the age of advanced IDEs/text editors with goto definition, find references/usage, fuzzy search, etc, what is even the point of multiple files?

I never navigate by files in my code bases, it's all based on search and "jump to" type navigation.

reply
rmac
11 days ago
[-]
Kohei Tokunaga has the next generation of this

https://ktock.github.io/container2wasm-demo/

with emscripten Browser networking via fetch, or a Posix compat websocket proxy

https://ktock.github.io/container2wasm-demo/amd64-debian-was...

reply
maxloh
11 days ago
[-]
reply
patwolf
11 days ago
[-]
I played around in Windows 2000 for the first time in 20 years. I know nostalgia can be blinding, but I would go back to that UI in a heartbeat. The uncluttered taskbar, the simple start menu that isn't full of useless recommendations and ads—such a joy!
reply
steeleduncan
11 days ago
[-]
I don't remotely want to use Windows 2000 again, but it is interesting to see a version of Windows where the UI was consistent. Currently it is a mishmash of four generations of GUI toolkits, some UI is in one style, some UI is another, etc, etc
reply
shepherdjerred
10 days ago
[-]
I've found Windows 11 to actually look quite consistent/good -- nearly as good as macOS.
reply
Tepix
11 days ago
[-]
Related:

"Windows 2000 Server named peak Microsoft. Readers say it's all been downhill since Clippy"

https://www.theregister.com/2025/04/11/windows_2000_best_mic...

https://news.ycombinator.com/item?id=43653421

reply
jsd1982
11 days ago
[-]
I tried to install Visual Basic 6 on it but couldn't get past SSL errors in the installed Firefox version to even download the ISO. Sad.
reply
edoceo
11 days ago
[-]
The reason I've been on Xfce since at least 2010, it still works the same.

I feel like open-source inherently has alignment with users and blockers to enshitification

reply
pengaru
10 days ago
[-]
reply
throwaway2037
11 days ago
[-]
Does anyone know how Fabrice Bellard gets paid? This guy's output of open source project is simply stunning. Is there anyone in his class? It is hard to compare. I assume that someone like VMWare would try to hire him, or Google to work on video codecs, V8, Chromium rendering, or ffmpeg.
reply
throwaway2037
11 days ago
[-]
Ok, it looks like he runs his own company: https://www.amarisoft.com/company/about-us
reply
keepamovin
11 days ago
[-]
I have to say there are some extremely talented, creative and productive "software artists" or ICs coming out of France. Not sure if that's a French thing (the Ecoles or whatever) or something else, but it's noticable.
reply
ptsneves
11 days ago
[-]
Bootlin is a French company and they are a major open source contributor. I worked with them and I recommend them.

French tech used to have a reputation for Renault old car quality, but I did not see it. Even in Renault and Citroen I came to admire them. On the other hand working with German SE is hard because they are incredibly set on not invented here. My generalisation for whatever it is worth.

In general the issue of Europe tech scene is simple: we suck at selling and optimise for resource efficiency(competitive salary means never pay above rate no matter what). Americans optimise for growth and will risk paying for higher so they can amortise costs with growth.

On a final note, where I come from there is lots of sneer that France is a dump due to immigration. While that is a point of view, it is definitely true they have also brain drained their colonies and have very capable productive individuals coming from there. Myself I had my master’s tutor from cot-de-Ivoir and in bootlin also worked with top of the shelf engineers that have non francophone names.

reply
justin66
11 days ago
[-]
Can you name some that invite comparison with FB?
reply
keepamovin
11 days ago
[-]
I'd do less comparison and more recognition. Some of these are kind of old or from the past and I'm no expert and the list is very incomplete but:

Jean Ichbiah - big contributor to Ada

Alain Colmerauer - creator of Prolog

Jean-Marie Hullot - iCal, iSync, NeXTSTEP GUI builder, CTO of Applications at Apple in early 2000s

Philippe Kahn - founder of Borland, inventor of first camera-phone

Olivier Fourdan - creator of Xfce, big contributor to Wayland

reply
wavemode
11 days ago
[-]
Laurent Gomila - creator of SFML

Jean-Baptiste Kempf - creator of VLC

reply
fuzztester
10 days ago
[-]
Some of the people at INRIA who created Caml and OCaml.

https://en.m.wikipedia.org/wiki/OCaml

Bertrand Meyer, creator of Eiffel.

https://en.m.wikipedia.org/wiki/Eiffel_(programming_language...

reply
justin66
9 days ago
[-]
> I'd do less comparison and more recognition.

Not to be overly snarky, but it's a good thing, since none of those people's output is comparable to FB's. The thought there might be another programmer like him was an interesting one to entertain...

reply
keepamovin
9 days ago
[-]
For sure! But then the output set might be smaller and we need to recognize the good.

Statically there’s probably others working in private, not publishing in open.

reply
_hyn3
11 days ago
[-]
Willy Tarreau - creator of HA Proxy
reply
a3f
11 days ago
[-]
We are using JSLinux over at https://barebox.org/webdemo to let potential users see the conveniences of the bootloader's shell without having to flash it to actual hardware.

I am glad to see all the forks mentioned here, need to see which one runs bareDOOM best and if any have working sound perhaps..

reply
a3f
11 days ago
[-]
https://barebox.org/demo being the correct link..
reply
ridruejo
11 days ago
[-]
JSLinux was our inspiration for creating Endor (https://endor.dev) and his qemu work is also powering a lot of other Wasm-related browser projects
reply
pveierland
11 days ago
[-]
Are there any open details on how the VM / container / WASM-native approaches are implemented?
reply
ridruejo
11 days ago
[-]
Not right now, we should write a blog post, but we are still behind on the docs. VM and containers use V86, while wasm-native are generated using Emscripten.
reply
pveierland
11 days ago
[-]
Cool, thanks for the answer - Would make for an interesting read!
reply
NetOpWibby
11 days ago
[-]
I just spent an hour playing Solitaire in Windows 2000
reply
skerit
12 days ago
[-]
I can't seem to get the Linux VMs running (I'm just getting a CORS error when it tries to fetch the little text file at `https://vfsync.org/u/os/buildroot-riscv64/head` for example), but the Windows 2000 one does work. Quite smoothly even.
reply
dvdkon
11 days ago
[-]
It only allows bellard.org, not www.bellard.org. Changing the domain loads the same webpage, but with CORS working as intended.
reply
slt2021
10 days ago
[-]
Fabrice Bellard is the Chuck Norris of software engineering
reply
dxroshan
11 days ago
[-]
Fabrice is an amazing programmer, and does cool things. He is an inspiration to us all.
reply
someoneontenet
11 days ago
[-]
My dream is have a in browser nixos vm on wasm. If I could have a bare vm, I can bootstrap it easily with a nixos config. From there I can start thinking about running web services in browser tabs instead of physical hardware.
reply
londons_explore
11 days ago
[-]
Pretty sure this is possible already... What's stopping you?
reply
someoneontenet
10 days ago
[-]
I’ve tried to set this up and get a little bogged down on some of the finer points of compiling nixos to wasm. It’s not very straightforward unfortunately :/
reply
sylware
11 days ago
[-]
Good.

Only wayland RISC-V 64bits binaries from now on, even for the web.

We don't need anything else anymore.

reply
slackfan
10 days ago
[-]
Ah, the destroy all software talk is coming true!
reply
cardiffspaceman
11 days ago
[-]
The TEMU column is not shopping links.
reply
gamebak
10 days ago
[-]
This is amazing! But beware admin, it seems that the RAM can be hijacked and increased...
reply
babuloseo
10 days ago
[-]
I use ffmpeg to create transcript with a popular video sharing site.
reply
roschdal
11 days ago
[-]
JSLinux is too slow to be used for anything.

Where is the complete source code for this?

reply
jgtrosh
11 days ago
[-]
I find it perfect for technical interviews over screen sharing, since we test for some basic degree of ease on remote linux systems.
reply
s-macke
11 days ago
[-]
This emulator does basically the same but is much more speed optimized. It uses the OpenRISC architecture and even has networking. For what do you want to use such an emulator?

[0] https://github.com/s-macke/jor1k

reply
Imustaskforhelp
11 days ago
[-]
Wow this is absolutely great!
reply
ofrzeta
11 days ago
[-]
On the TinyEMU page? https://bellard.org/tinyemu/
reply
roschdal
11 days ago
[-]
Where can I find the source code and instructions about how to make the Linux distro which runs here?
reply
jeroenhd
11 days ago
[-]
JSLinux runs any disk image reachable over the network. You can find the Alpine sources over at https://github.com/alpinelinux. The Fedora sources are over at https://src.fedoraproject.org/. I don't think the script to package the pre-built images is documented somewhere, but it's all standard Linux you can install yourself in a virtual machine if you want.

The Windows 2000 sources are probably leaked somewhere on Github, or you could apply for a job with Microsoft maybe. I managed to get ReactOS to boot in JSLinux once by installing it into a standard QEMU image and splitting the image into chunks as required by the emulator code. You need quite a fast CPU to run a full, modern OS at acceptable speeds, though.

reply
DrNosferatu
11 days ago
[-]
- What about a WASM flavor of this, Fabrice? ;)
reply
haunter
11 days ago
[-]
reply
loeg
11 days ago
[-]
Any particular reason we want to revisit this (2018) now?

https://hn.algolia.com/?q=jslinux

reply
skrebbel
11 days ago
[-]
Probably because it's super cool
reply
Maksadbek
11 days ago
[-]
Fabrice Bellard is a real coding monster!
reply
DyslexicAtheist
11 days ago
[-]
for now I get a kernel panic due to NoScript.

But does this support recursion? I'd like to run JSLinux in my browser and then point its Browser to https://www.bellard.org/jslinux/ which then starts another JSLinux which opens the browser on JSLinux which ...

JSLinux isn't another Linux but a landmark of postmodern philosophy, and OP most def forgot to credit Baudrillard.

crazy cool.

reply
jeroenhd
11 days ago
[-]
If you host your own OS image that auto-starts a browser that runs JSLinux and a config file like https://www.bellard.org/jslinux/alpine-x86.cfg, you can create such a link yourself. CORS may be your biggest enemy, there's no reason JSLinux can't do what you're proposing (albeit extremely slowly).
reply