Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Fabrice Bellard is widely considered one of the most productive and versatile programmers alive:

- FFmpeg: https://bellard.org

- QEMU: https://bellard.org/qemu/

- JSLinux: https://bellard.org/jslinux/

- TCC: https://bellard.org/tcc/

- QuickJS: https://bellard.org/quickjs/

Legendary.





For all the praise he gets here, few seem interested in his methods: writing complete programs, based on robust computer science, with minimal dependencies and tooling.

When I first read the source for his original QuickJS implementation I was amazed to discover he created the entirety of JavaScript in a single xxx thousand line C file (more or less).

That was a sort of defining moment in my personal coding; a lot of my websites and apps are now single file source wherever possible/practical.


SQLite 3.51.1

  $ wc -l ...
  265908 sqlite-amalgamation-3510100/sqlite3.c
Is there any as large as possible single source (or normal with amalgamation version) more or less meaningful project that could be compiled directly with rustc -o executable src.rs? Just to compare build time / memory consumption.

The sqlite3.c file is generated from more finely-grained real sources, see https://www.sqlite.org/src/doc/trunk/README.md

SQLite is only deployed as a single file but the original sources are multiple files. They call it "The Amalgamation".

https://sqlite.org/src/doc/trunk/README.md


Yes, that's why I've asked about possible rust support of creating such version of normal project. The main issue, I'm unaware of comparably large rust projects without 3rdparty dependencies.

From my daily-use utilities, ripgrep and bat seem to have zero dependencies.

I believe ripgrep has only or mostly dependencies that the main author also controls. It's structured so that ripgrep depends on regex crates by the same author, for example.

Looking at Cargo.toml, ripgrep seems to have some dependencies and bat has a lot.

I honestly think the single file thing is best reserved for C, given how bad the language support for modularity is.

I've had the inverse experience dealing with a many thousand line "core.php" file way back in the day helping debug an expressionengine site (back in the php 5.2ish days) and it was awful.

Unless you have an editor which can create short links in a hierarchical tree from semantic comments to let you organize your thoughts, digging through thousands of lines of code all in the same scope can be exceptionally painful.


C has no problems splitting programs in N files, to be honest.

The reason FB (and myself, for what it is worth) often write single file large programs (Redis was split after N years of being a single file) is because with enough programming experience you know one very simple thing: complexity is not about how many files you have, but about the internal structure and conceptually separated modules boundaries.

At some point you mainly split for compilation time and to better orient yourself into the file, instead of having to seek a very large mega-file. Pointing the finger to some program that is well written because it's a single file, strlongly correlates to being not a very expert programmer.


The file granularity you chose was at the perfect level for somebody to approach the source code and understand how Redis worked. It was my favorite codebases to peruse and hack. It’s been a decade and my memory palace there is still strong.

It reminded me how important organization is to a project and certainly influenced me, especially applied in areas like Golang package design. Deeply appreciate it all, thank you.


I split to enforce encapsulation by defining interfaces in headers based on incomplete structure types. So it helps me with he conceptually separated module boundaries. Super fast compilation is another benefit.

> complexity is not about how many files you have, but about the internal structure and conceptually separated modules boundaries.

You probably don't need this, but ...

https://www.lelanthran.com/chap13/content.html


C's support for modularity is actually rather strong. This PDF gives a good overview of the basic techniques available: http://www.metamodulaire.org/Computing/modular-c.pdf

It may not be immediately obvious how to approach modularity since it isn't directly accomplished by explicit language features. But, once you know what you're doing, it's possible to write very large programs with good encapsulation, that span many files, and which nevertheless compile quite rapidly (more or less instantaneously for an incremental build).

I'm not saying other languages don't have better modularity, but to say that C's is bad misses the mark.


Unironically JavaScript is quite good for single file projects (albeit a package.json usually needed)

You can do a huge website entirely in a single file with NodeJS; you can stick re-usable templates in vars and absue multi-line strings (template literals) for all your various content and markup. If you get crafty you can embed clientside code in your 'server.js' too or take it to the next level and use C++ multi-line string literals to wrap all your JS ie- client.js, server.js and package.json in a single .cpp file


> I honestly think the single file thing is best reserved for C, given how bad the language support for modularity is.

You don't program much in C, do you?


This is like Feynman's method for solving hard scientific problems: write down the question, think very hard, write down the answer.

It doesn't necessarily translate to people who are less brilliant.


Yeah, "Step 1: draw 2 circles. Step 2: draw the rest of the fucking owl"

I agree: he loves to "roll your own" a lot. Re: minimal dependencies - the codebase has a software FP implementation including printing and parsing, and some home-rolled math routines for trigonometric and other transcendental functions.

Honestly, it's a reminder that, for the time it takes, it's incredibly fun to build from scratch and understand through-and-through your own system.

Although you have to take detours from, say, writing a bytecode VM, to writing FP printing and parsing routines...


Because he choose the hardest path. Difficult problems, no shortcuts, ambitious, taking time to complete. Our environment in general is the opposite of that.

We spend a lot of time doing busy work that's part of the process but doesn't actually move the needle. We write a lot of code that manages abstractions, but doesn't do a lot. All of this busy work feels like progress, but it's avoiding the hard work of actually writing working code.

We underestimate how inefficient working in teams is compared with individuals. We don't value skill and experience and how someone who understands a problem well can be orders of magnitude more productive.


He's one of my programming heroes but that's based purely on the sheer volume of high quality output he has.

Can you elaborate a little about the methods you mention and how you analysed them?


> few seem interested in his methods:

You are absolutely wrong here. Most of us wish that somebody would get him to sit for an in-depth interview and/or get him to write a book on his thinking, problem-solving approach, advice etc. i.e. "we want to pick his brain".

But he is not interested and seems to live on a different plane :-(


He's also built a closed-source LLM inference engine, which he's been maintaining since the GPT-2 days: https://bellard.org/ts_server/ and https://textsynth.com/

I used to play around with Textsynth, but not being OSS killed the appeal for me once llama.cpp came around.

I thought Bellard might be behind even llama.cpp (that would be completely expected for Bellard) but it's actually another great who's done that: Georgi Gerganov: https://github.com/ggerganov

He's also won the International Obfuscated C Code Contest 3 times.

https://www.ioccc.org/authors.html#Fabrice_Bellard


Don't forget his LZEXE from the good old DOS days which was an excellent piece of work at the time.

I remember LZEXE from those olden days. When I discovered the author of FFmpeg and QEMU also created LZEXE, I was so impressed. I've been using his software for my entire computing career.

It's similar to the respect I have for the work of Anders Hejlsberg, who created Turbo Pascal, with which I learned to program; and also C# and TypeScript.


Self-decompressing executables felt like magic to me at the time. Fantastic work, overall.

Always interesting when people as talented as Bellard manage to (apparently) never write a "full-on" GUI-fronted application, or more specifically, a program that sits between a user with constantly shifting goals and workflows and a "core" that can get the job done.

I would not want to dismiss or diminish by any amount the incredible work he has done. It's just interesting to me that the problems he appears to pick generally take the form of "user sets up the parameters, the program runs to completion".


Reading some of these comments, it's clear very few in here have ever written a productive customer facing full stack app "javascript is really good for a single file app!!!" ok, maybe if you're rendering static HTML... -> these are not serious people

Whenever someone says there's no such thing as a 10x programmer, I point them to Fabrice and they usually change their mind.

Perhaps closer to 100x actually.

You can call 1000 averaged programmers and see if they can write MicroQuickJS using the same amount of time, or call one averaged programmer and see if he/she can write MicroQuickJS to the same quality in his/her life time. 10X, 100X or 1000X measures the productivity of us mortals, not someone like Fabrice Bellard.

If you're in a room with 100 physicists and Feynman, the accumulated wisdom of Feynman is your best bet.

Don't forget his LLM based text compression software that won awards.

Guy is a genius. I hope he tries Rust someday


Fabrice, if you're reading this, please consider replacing Rust instead with your own memory safe language.

The design intent of Rust is a powerful idea, and Rust is the best of its class, but the language itself is under-specified[1] which prevents basic, provably-correct optimizations[0]. At a technical level, Rust could be amended to address these problems, but at a social level, there are now too many people who can block the change, and there's a growing body of backwards compatibility to preserve. This leads reasonable people to give up on Rust and use something else[0], which compounds situations like [2] where projects that need it drop it because it's hard to find people to work on it.

Having written low-level high-performance programs, Fabrice Bellard has the experience to write a memory safe language that allows hardware control. And he has the faculties to assess design changes without tying them up in committee. I covet his attentions in this space.

[0]: https://databento.com/blog/why-we-didnt-rewrite-our-feed-han...

[1]: https://blog.polybdenum.com/2024/06/07/the-inconceivable-typ...

[2]: https://daniel.haxx.se/blog/2024/12/21/dropping-hyper/


I think of Rust might trigger a new generation of languages that are developed with the hindsight of rust.

The principle of zero cost abstractions avoids a slow slide of compromising abstraction cost, but I think there could be small cost abstractions that would make for a more pragmatic language. Having Rust to point at to show what performance you could be achieving would aid in avoiding bloating abstractions.


Bellard likely doesn't care one bit about memory safety or whatever other trendy things are popular these days.

> At a technical level, Rust could be amended to address these problems

I don’t think it can, no.


peak hacker news comment lol

I've only been here for a month. I guess I'm learning well

At this point I'm convinced that they're not a 'real person' and the 'Fabrice' is an operational code name for a very mature hacker collective.

Real people have to sleep at some point!


Wikipedia doesn't list any honours awarded by the French Government. Nor do I see anything from ACM. Definitely overdue some official recognition.

Funny how people know Fabrice for all the software stuff but none of the hardware antics:

played with implementing analog modem DSP in software in 1999 (linmodem is ~50-80% there, sadly never finished)

probably leading to

played with implementing SDR (again DSP) using VGA output to transmit DVB-T/NTSC/PAL in 2005

probably leading to

Amarisoft SDR 5G base station, commercial product started in 2012 - his current job https://www.amarisoft.com/company/about-us


I was going to mention the last one, and his ASN.1 compiler which is likely related to his telco work:

https://bellard.org/ffasn1/


For real. The GOAT is at it again!

The first two links are broken.

The ffmpeg link was changed apparently, but the QEmu link still works he just redirects to the QEmu homepage.

For all the praise he's receiving, I think his web design skills have gone overlooked. bellard.org is fast, responsive and presents information clearly. Actually I think the fancier the website, the shittier the software. Examples: Tarsnap - minimal website, brilliant software. Discord - Whitespacey, animation-heavy abomination of a website. Software: hundreds of MB of JS slop, government wiretap+botnet for degenerates.

The math checks out.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: