QtCS2024: Compile once, Run everywhere

mmphosis | 176 points

Made possible using Cosmopolitan Libc.

Justine writes some pretty cool software.

https://justine.lol/cosmopolitan/index.html

TimSchumann | 4 months ago

I have a philosophical objection to this approach, while respecting the technical achievement. For me, the ideal distribution of software is always by source. The only reason I wouldn't want this is if compilation is prohibitively expensive. But I have found that usually this is only the case for truly massive projects like chrome or projects with heavy dependencies. Most c programs can be compiled in at most a few minutes but usually just a few seconds (luajit and sqlite come to mind as being in the seconds camp). The big problem is that culturally we have accepted too many dependencies in libraries and this has made building too slow and has made binary distribution feel necessary. It is actually much faster on my computer to build neovim from source than upgrading it from homebrew if the upgrade triggers a cascade of dependency updates (which basically seems to happen every time I update anything using homebrew).

I also can't envision a common scenario in which I would have a machine that doesn't have a c compiler but I would be able to run an APE executable. Even in that uncommon case, I still think I would be better off using software that I could compile with a standards compliant c compiler and ship the binary that _I_ built myself to the machine that lacked a c compiler.

norir | 4 months ago

Key point:

> running with the vnc QPA

The demo they have running has no native display or input support; it just serves the interface over a socket via VNC.

comex | 4 months ago

> The size of the Cosmopolitan Qt Creator binary is around 230 megabytes

While it's kind of expected it'd be big... that's really large. :(

justinclift | 4 months ago

The title: "Compile once" The transcript: "Cosmopolitan applications are compiled twice"

mseepgood | 4 months ago

Interesting approach, but the results seem as rough as they usually are regarding cross-platform UX.

For instance, check out the demo on slide 10: now you can have janky sliders that don't match the platform's version on every platform!

al2o3cr | 4 months ago

The codereview of the WIP patches are a nice read. They do a good job of showing how quirky Cosmopolitan Libc is. To be clear I think it is awesome, just don't expect porting to it to be pain-free.

https://codereview.qt-project.org/c/qt/qtbase/+/581112

zorgmonkey | 4 months ago

I respect this a lot as an impressive hack, but it's really sad that in 2024 we are headed toward a "statically link the entire universe" approach to software distribution because OSes have failed to provide good consistency, stability, or portability.

WASM could solve all this, but that would mean all OSes would need WASM runtimes that supported a consistent set of standards and APIs. Have fun getting that to happen.

api | 4 months ago

Should there be a link to some video or podcast somewhere there? I can only see a link to a pdf file.

SebaSeba | 4 months ago

This is a neat idea.

Generally, though, third party libraries are the biggest problem I've had building Qt apps on different platforms. Qt itself "just works," but getting arbitrary open source libraries building on OSX and Windows can be a pain.

jlarocco | 4 months ago

> Qt QPA VNC platform.

I've not heard of this before. Who is using it and for what? And how?

Also, who / what is .Adam?

metadat | 4 months ago

Why? To make it simpler to distribute binaries? What is the use case share for portable binaries across platforms? The platform check is to be run at every single run, not just once, if I am not mistaken. I thought we were aiming at efficiency.

It is an interesting and intriguing technology, but pretty useless if not even dangerous, IMHO.

notorandit | 4 months ago
[deleted]
| 4 months ago

The page 8 ("Building") of the slides has the badger picture to the right. His right hand has some weird "nails". Another example of AI-generated image.

CrendKing | 4 months ago

Why not wasm?

jenadine | 4 months ago

[flagged]

heavyset_go | 4 months ago