6 ms·
QtCS2024: Compile once, Run everywhere
- comex 2y agoKey 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.
- modeless 2y agoAh, I was wondering how they did the window system integration.
- CrendKing 2y agoThe 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.
- axitanull 2y agoAnd the file served is of pdf file. The font used is Titillium Web. The color of my bike shed is that of brown wood color. Did I also contribute to the discussion of the tool?
- deleted 2y ago[deleted]
- cristianadam 2y agoAll the honey badger (mascot of cosmopolitan libc) images were generated using FLUX.1-schnell on my MacBook Pro M1 Max. I've blogged about all the AI usage at https://www.qt.io/blog/examples-of-local-llm-usage https://www.qt.io/blog/examples-of-local-llm-usage
- TimSchumann 2y agoMade possible using Cosmopolitan Libc. Justine writes some pretty cool software. https://justine.lol/cosmopolitan/index.html https://justine.lol/cosmopolitan/index.html
- deleted 2y ago[deleted]
- wvenable 2y agoHow does one get a job like this? Just writing absolutely wild and weird projects? I do weird/fun stuff on my own time but I get paid to do mostly boring stuff.
- axitanull 2y ago> Funding for this project is crowdsourced using GitHub Sponsors and Patreon. Based on the project github page, it seems that this is their version of weird/fun stuff, that is not done as a part of their job.
- diggan 2y ago> How does one get a job like this? Just writing absolutely wild and weird projects? Work for any huge corporation that has to pay huge salaries for people to work on soul-less projects for a couple of years, then retire and hack away. In the case of Justine, it seems the corporation was Google.
- Vampiero 2y agoJust have enough money that you don't have to sell your soul to the devil for a job in webshit consultancy, where they're STILL busy reinventing the CRUD wheel for some reason. Probably because hell means an eternity of torture, and consultancy is hell. So either be born rich, or slave away until you no longer have to worry about not eating. Then you can work on all your pet projects and feel fulfilled about your job and life. If you're not dead yet from all the accumulated stress, that is.
- sweeter 2y agoblinkenlights is amazing! The entire time I was learning programming I thought to myself "hmm I wish I could see what the memory and registers actually look like at any given step" and bam, blinkenlights. Its an amazing piece of work.
- amelius 2y ago
- heavyset_go 2y ago[flagged]
- bawolff 2y agoWhen i googled, it was very difficult to find anything in its original context, just some quotes, that certainly sound nutty on their face but also are very short to the point it is unclear if she was quoted fairly.
- smallerize 2y agoI don't think this is a good article, but it does have the quotes in it. https://web.archive.org/web/20231102081020/https://valleywag.gawker.com/why-does-google-employ-a-pro-slavery-lunatic-1612868507 https://web.archive.org/web/20231102081020/https://valleywag...
- bscphil 2y agore "pro-slavery" specifically that seems very clearly intended as a hypothetical argument in response to someone else; e.g. you can imagine an argument about whether you ought to raise the minimum wage where one person points out that someone on minimum wage can't even afford to pay rent and purchase food, or something. The rest of it sounds extremely sarcastic and tongue-in-cheek. It's also (all of it) more than ten years ago. I think it's a bad idea to judge someone on the basis of a handful of out of context tweets like this. Stuff like > Justine Tunney is petitioning the White House to make Eric Schmidt the "CEO of America." seems clearly like a pointed act of satire by someone who thinks corporations have too much power.
- userbinator 2y agoA lot of people sit on the blurry line between genius and insanity, and that's not necessarily a bad thing.
- mplewis 2y ago[flagged]
- deleted 2y ago[deleted]
- mseepgood 2y agoThe title: "Compile once" The transcript: "Cosmopolitan applications are compiled twice"
- SebaSeba 2y agoShould there be a link to some video or podcast somewhere there? I can only see a link to a pdf file.
- notorandit 2y agoWhy? 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.
- autoexec 2y agoSeems pretty damn useful to me. You can throw a bunch of programs on a flash drive and use them on any computer you happen to be in front of.
- JonChesterfield 2y agoThe programs mutate themselves at first use, or at least they did originally, meaning the drive needs to keep copies of the original on it and copy them before running to later work usefully at a second machine.
- notorandit 2y agoThis is when the dangers come in. Removable media with binaries roaming among different systems. The perfect vector for viruses and Trojans.
- wakawaka28 2y agoIt literally says in the first sentence that deployment on many platforms can be challenging. Checking the platform is trivial, presumably, and a necessary part of what is being done here. I agree that this might be a dangerous thing to use, but it's not unprecedented. This has a lot in common with using cross-compiling process. If performance is good, it could potentially replace something like AppImage I guess. However, making all your dependencies compile with this thing and then debugging the result may end up being harder than maintaining however many separate builds. It sounds amazing to me that they got Qt to work with this tool. I don't see myself using this but I might take a closer look one day for the hell of it.
- exe34 2y ago
- justinclift 2y 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. :(
- Y_Y 2y agoAt some point it's going to be easier to ship a fat binary of a compiler or bytecode interpreter along with a single representation of your application. And then the cycle begins anew.
- odux 2y ago[flagged]
- kevincox 2y agoWhat is the reference size? It is hard to compare. For many applications the size of "assets" like images, localization data and other stuff will vastly outweight the code.
- flohofwoe 2y agoI expect that's a statically linked executable which includes all dependencies for ARM and x86. If you add up the size of dynamic link libraries of a regular Qt Creator installation on macOS you get about 400 MBytes (those are universal binaries which contain both ARM and x86 code).
- deleted 2y ago[deleted]
- simjnd 2y agoAPE binaries usually come with an option to "assimilate": once downloaded, you can choose to only keep the stuff relevant to the platform you're currently using. Best of both worlds.
- jenadine 2y agoWhy not wasm?
- paldepind2 2y agoThe description on cosmopolitans webpage states: > Cosmopolitan Libc makes C a build-anywhere run-anywhere language, like Java, except it doesn't need an interpreter or virtual machine. WebAssembly would not achieve the same thing as it's in the same category as Java bytecode where you need some interpreter/VM/JIT/compiler to actually run it.
- api 2y agoI 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.
- diath 2y ago> 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. I mean if that's your solution to the problem, then Java already solved it.
- mdaniel 2y agoI agree in principle with your assertion, with a small asterisk that what you said would be true if the JVM was baked into the OS As it stands now, because the JVM is merely an application, it needs tomfoolery to JNI out to anything interesting. One can see this in effect with Eclipse's SWT which to the best of my knowledge uses JNI for all its UI trickery (e.g. https://github.com/eclipse-platform/eclipse.platform.swt/tree/R4_33/binaries/org.eclipse.swt.cocoa.macosx.x86_64 https://github.com/eclipse-platform/eclipse.platform.swt/tre... ) Pour one out, I guess: https://en.wikipedia.org/wiki/JavaOS https://en.wikipedia.org/wiki/JavaOS although it's a fascinating thought experiment to invert that problem where JavaOS actually uses JNI to run Proton/Wine :-D
- mwcampbell 2y agoThe web platform is the best set of standards and APIs we have.
- al2o3cr 2y agoInteresting 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!
- zorgmonkey 2y agoThe 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 https://codereview.qt-project.org/c/qt/qtbase/+/581112
- slekker 2y agoHarsh reviewer IMO
- jlarocco 2y agoThis 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.
- EasyMark 2y agoThat’s why I use everything that I possibly can from qt libraries even if there are open source libraries that might be easier to use or more performant than qt versions.
- norir 2y agoI 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.
- jcelerier 2y ago> 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 99.99% of people who want to run executables on mac or windows don't have a C or C++ compiler installed and wouldn't have the knowledge to operate it if they did. And if you want to install the default one for these platforms (MSVC or XCode) it's at least 30 minutes of download + 30 minutes of installation. For me this really solves an actual problem I've had customers & team members ask me hundreds of time - "how can I compile a Qt app for Mac when I'm on Windows" (and the inverse)
- loglog 2y agoFor me, cargo is among the most reliable package managers these days. It is about as convenient as any other Linux package manager (and therefore much better than the feeble Windows or Mac alternatives), yet also compiles from source. I evidently don't fall into the 99.99% of Windows users without a C compiler, but I also never write Rust. Anyway, the point that I am making is that it is entirely possible to have a distribution chain that involves a compiler and a user that does not know how to operate that compiler. And how is that fundamentally different from JIT compilation in a JVM or JS runtime anyway?
- metadat 2y 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?