<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Hacker News: ahgamut</title><link>https://news.ycombinator.com/user?id=ahgamut</link><description>Hacker News RSS</description><docs>https://hnrss.org/</docs><generator>hnrss v2.1.1</generator><lastBuildDate>Fri, 03 Jul 2026 13:43:11 +0000</lastBuildDate><atom:link href="https://hnrss.org/user?id=ahgamut" rel="self" type="application/rss+xml"></atom:link><item><title><![CDATA[New comment by ahgamut in "Gemini CLI"]]></title><description><![CDATA[
<p>My early contributions to <a href="https://github.com/jart/cosmopolitan">https://github.com/jart/cosmopolitan</a> were focused towards getting a single-file Python executable. I wanted my Python scripts to run on both Windows and Linux, and now they do. To try out Python, you can:<p><pre><code>    wget https://cosmo.zip/pub/cosmos/bin/python -qO python.com
    chmod +x python.com
    ./python.com
</code></pre>
Adding pure-Python libraries just means downloading the wheel and adding files to the binary using the zip command:<p><pre><code>    ./python.com -m pip download Click
    mkdir -p Lib && cd Lib
    unzip ../click*.whl
    cd ..
    zip -qr ./python.com Lib/
    ./python.com # can now import click
</code></pre>
Cosmopolitan Libc provides some nice APIs to load arguments at startup, like cosmo_args() [1], if you'd like to run the Python binary as a specific program. For example, you could set the startup arguments to `-m datasette`.<p>[1]: <a href="https://github.com/jart/cosmopolitan/commit/4e9566cd3328626d903de3d10c8abfd2daef12d9#diff-8069dfa7a386e941d414eaa8289e33f62c9c94e471a705bdf1ed047509fc9e88">https://github.com/jart/cosmopolitan/commit/4e9566cd3328626d...</a></p>
]]></description><pubDate>Wed, 25 Jun 2025 20:32:02 +0000</pubDate><link>https://news.ycombinator.com/item?id=44381552</link><dc:creator>ahgamut</dc:creator><comments>https://news.ycombinator.com/item?id=44381552</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=44381552</guid></item><item><title><![CDATA[New comment by ahgamut in "A proof-of-concept Python executable built on Cosmopolitan Libc (2021)"]]></title><description><![CDATA[
<p>most likely before v2 as well. The original post is from July 2021, which is a bit after Cosmopolitan Libc's v1 IIRC.</p>
]]></description><pubDate>Mon, 15 Apr 2024 14:56:30 +0000</pubDate><link>https://news.ycombinator.com/item?id=40041398</link><dc:creator>ahgamut</dc:creator><comments>https://news.ycombinator.com/item?id=40041398</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=40041398</guid></item><item><title><![CDATA[New comment by ahgamut in "A proof-of-concept Python executable built on Cosmopolitan Libc (2021)"]]></title><description><![CDATA[
<p>My 4-core computer's probably building Cosmopolitan Libc in the background + the Python binary is 2.7 unoptimized. This blog post is originally from 2021.</p>
]]></description><pubDate>Mon, 15 Apr 2024 14:51:14 +0000</pubDate><link>https://news.ycombinator.com/item?id=40041335</link><dc:creator>ahgamut</dc:creator><comments>https://news.ycombinator.com/item?id=40041335</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=40041335</guid></item><item><title><![CDATA[New comment by ahgamut in "A proof-of-concept Python executable built on Cosmopolitan Libc (2021)"]]></title><description><![CDATA[
<p>I've tried nuitka before, and a recent question that occurred to me was: does nuitka have an option to output just C files? Something like:<p><pre><code>  python -m nuitka example.py --no-compile
</code></pre>
Might be interesting to see if the above is possible. We could get things like a completely-statically-compiled Python stdlib within the APE.</p>
]]></description><pubDate>Mon, 15 Apr 2024 14:49:21 +0000</pubDate><link>https://news.ycombinator.com/item?id=40041302</link><dc:creator>ahgamut</dc:creator><comments>https://news.ycombinator.com/item?id=40041302</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=40041302</guid></item><item><title><![CDATA[New comment by ahgamut in "A proof-of-concept Python executable built on Cosmopolitan Libc (2021)"]]></title><description><![CDATA[
<p>Hey, this is my post from 2021, when I was testing Python2.7 and Python3.6 with Cosmopolitan Libc on an old 4-thread Haswell. It's now a lot easier to build Python (and gcc, gnu coreutils, curl etc.), and the binaries are faster, multi-threaded, and quite convenient to use. There are lots of interesting directions to explore when it comes to building software with Cosmopolitan Libc.</p>
]]></description><pubDate>Mon, 15 Apr 2024 14:43:39 +0000</pubDate><link>https://news.ycombinator.com/item?id=40041217</link><dc:creator>ahgamut</dc:creator><comments>https://news.ycombinator.com/item?id=40041217</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=40041217</guid></item><item><title><![CDATA[New comment by ahgamut in "Cake – C23 and Beyond (2023)"]]></title><description><![CDATA[
<p>> new methods of communication with the compiler have been established.<p>From what I understand, this appears to a be separate binary from GCC/Clang that does static analysis and outputs C99.<p>Can this be a GCC plugin? I know we can write plugins that are activated when a specific macro is provided, and the GCC plugin event list allows intercepting the AST at every function declaration/definition. Unless you're rewriting the AST substantially, I feel this could be a compiler plugin. I'd like to know a bit more about what kinds of AST transformations/checks are run as part of Cake.</p>
]]></description><pubDate>Tue, 20 Feb 2024 01:42:13 +0000</pubDate><link>https://news.ycombinator.com/item?id=39437066</link><dc:creator>ahgamut</dc:creator><comments>https://news.ycombinator.com/item?id=39437066</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=39437066</guid></item><item><title><![CDATA[New comment by ahgamut in "LLMs and Programming in the first days of 2024"]]></title><description><![CDATA[
<p>> Instead, many have deeply underestimated LLMs, saying that after all they were nothing more than somewhat advanced Markov chains, capable, at most, of regurgitating extremely limited variations of what they had seen in the training set. Then this notion of the parrot, in the face of evidence, was almost universally retracted.<p>I'd like to see this evidence, and by that I don't mean someone just writing a blog post or tweeting "hey I asked an LLM to do this, and wow". Is there a numerical measurement, like training loss or perplexity, that quantifies "outside the training set"? Otherwise, I find it difficult to take statements like the above seriously.<p>LLMs can do some interesting things with text, no doubt. But these models are trained on terabytes of data. Can you really guarantee "there is no part of my query that is in the training set, not even reworded"? Perhaps we can grep through the training set every time one of these claims are made.</p>
]]></description><pubDate>Tue, 02 Jan 2024 15:10:20 +0000</pubDate><link>https://news.ycombinator.com/item?id=38842428</link><dc:creator>ahgamut</dc:creator><comments>https://news.ycombinator.com/item?id=38842428</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=38842428</guid></item><item><title><![CDATA[New comment by ahgamut in "Cosmopolitan Third Edition"]]></title><description><![CDATA[
<p>What packages do you use in your app? If you're not using too many C extensions, it may be possible to build your app with Cosmopolitan.</p>
]]></description><pubDate>Thu, 02 Nov 2023 02:14:10 +0000</pubDate><link>https://news.ycombinator.com/item?id=38108140</link><dc:creator>ahgamut</dc:creator><comments>https://news.ycombinator.com/item?id=38108140</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=38108140</guid></item><item><title><![CDATA[New comment by ahgamut in "Cosmopolitan Third Edition"]]></title><description><![CDATA[
<p>Try it out! We got Lua/LuaJIT, Python, PHP, and Rust building (the latter two are not fully automatic yet), so Ruby might be possible even now.</p>
]]></description><pubDate>Wed, 01 Nov 2023 21:24:11 +0000</pubDate><link>https://news.ycombinator.com/item?id=38105526</link><dc:creator>ahgamut</dc:creator><comments>https://news.ycombinator.com/item?id=38105526</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=38105526</guid></item><item><title><![CDATA[New comment by ahgamut in "Cosmopolitan Third Edition"]]></title><description><![CDATA[
<p><a href="https://github.com/ahgamut/rust-ape-example">https://github.com/ahgamut/rust-ape-example</a><p>My above repo contains example with the Rust standard library that build as fat executables with Cosmopolitan Libc.<p>I also got ripgrep to build <a href="https://github.com/ahgamut/ripgrep/tree/cosmopolitan">https://github.com/ahgamut/ripgrep/tree/cosmopolitan</a>, but it wasn't part of the cosmocc binaries because some crates that are part of the build require `#!feature(rustc_private)]` to be added to their source code. Same goes for bat and fd.<p>To summarize, Rust CLI tools can be built with Cosmopolitan Libc, but to build them like we can build gcc/emacs/git right now, we will need some support and Rust expertise.</p>
]]></description><pubDate>Wed, 01 Nov 2023 21:03:41 +0000</pubDate><link>https://news.ycombinator.com/item?id=38105204</link><dc:creator>ahgamut</dc:creator><comments>https://news.ycombinator.com/item?id=38105204</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=38105204</guid></item><item><title><![CDATA[New comment by ahgamut in "Cosmopolitan Third Edition"]]></title><description><![CDATA[
<p>Yes, so pip works because the Python APE has OpenSSL built-in.<p>pip install requires modifying the APE, so I end up installing pure-Python libraries as follows:<p><pre><code>    mkdir Lib
    ./python -m pip download httpx
    unzip ./*.whl -d ./Lib
    mv python python.com # in case the next step doesn't work
    zip -r ./python.com Lib
    mv python.com python
</code></pre>
Installing CPython extensions like this is an unsolved problem, but I think there might be some interesting workarounds possible.</p>
]]></description><pubDate>Wed, 01 Nov 2023 19:44:11 +0000</pubDate><link>https://news.ycombinator.com/item?id=38103827</link><dc:creator>ahgamut</dc:creator><comments>https://news.ycombinator.com/item?id=38103827</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=38103827</guid></item><item><title><![CDATA[New comment by ahgamut in "Cosmopolitan Third Edition"]]></title><description><![CDATA[
<p>The "/zip/" folder refers to the ZIP store inside the actually portable executable -- you can run `unzip -vl ./python` to see what's inside.<p>Also, to add new pure-python packages, you just need to unzip them into a local folder "./Lib", and add that folder to the APE.</p>
]]></description><pubDate>Wed, 01 Nov 2023 19:18:35 +0000</pubDate><link>https://news.ycombinator.com/item?id=38103471</link><dc:creator>ahgamut</dc:creator><comments>https://news.ycombinator.com/item?id=38103471</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=38103471</guid></item><item><title><![CDATA[New comment by ahgamut in "My User Experience Porting Off Setup.py"]]></title><description><![CDATA[
<p>Thank you Gregory for writing this post. There have been a bunch of announcements about "setup.py has been deprecated", but few have clearly outlined how to move away from setup.py, and more importantly, fewer have outlined what a struggle it is to move away from setup.py.<p>I was sad to see setuptools officially deprecated, because it looks like another way in which Python packaging is being red-taped away for a non-expert. If someone like the OP (who has 10+ years programming Python) had to do so much for what appears to be a zstd CFFI/Rust wrapper, where does that leave the rest of us?<p>Here's a python package of mine that uses setup.py: <a href="https://github.com/ahgamut/cliquematch/blob/master/setup.py">https://github.com/ahgamut/cliquematch/blob/master/setup.py</a> which I have not upgraded to the new tool(s) yet. I think I will need to upgrade it soon. If anyone has suggestions for a tool that will _fully replace_ setup.py, I would like to see tutorials with the following examples:<p>1. How would I build a package that has pure-Python files and data files? With setuptools I would use maybe MANIFEST.in or package_dir.<p>2. How would I build a package that has a CPython extension accessed via cffi? (this post points to the answer)<p>3. How would I build a package that has a CPython extension _without_ cffi, that just wraps some small C code I wrote with CPython's API? What about an extension that uses PyBind11? What about an extension that uses Rust?<p>4. How would I build a package that requires a "system" package like libblas-dev? Can something like numpy be built optimally without ever writing setup.py? What would a config for that look like? Last I remember numpy used their own patch of distutils to build, I wonder what it is now.</p>
]]></description><pubDate>Tue, 31 Oct 2023 05:52:27 +0000</pubDate><link>https://news.ycombinator.com/item?id=38080789</link><dc:creator>ahgamut</dc:creator><comments>https://news.ycombinator.com/item?id=38080789</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=38080789</guid></item><item><title><![CDATA[New comment by ahgamut in "Why I Quit Bridge and Why I Came Back"]]></title><description><![CDATA[
<p>One of the comments in the OP:<p><pre><code>   I believe the problem is that bridge in the US (not true in some other countries) lacks a "critical mass" of 20 and 30 somethings.
</code></pre>
I like to play bridge, but all the people I have asked in my age group (the 20 and 30 somethings) say bridge is a game their (grand)parents (used to) play. I am not sure how bridge can be introduced as a fun hobby without the face-to-face aspect, because compared to other online games it does seem a bit monotone.</p>
]]></description><pubDate>Mon, 04 Sep 2023 02:55:15 +0000</pubDate><link>https://news.ycombinator.com/item?id=37376707</link><dc:creator>ahgamut</dc:creator><comments>https://news.ycombinator.com/item?id=37376707</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=37376707</guid></item><item><title><![CDATA[New comment by ahgamut in "Intent to approve PEP 703: making the GIL optional"]]></title><description><![CDATA[
<p>"Python 4, but not really", because we want to squeeze out more multithreading performance and be cool again. Some questions from reading the OP:<p>- How much does performance improve due to this No-GIL thing? Is it greater than 2x? For what workloads?
- Do I have to compile two versions of every extension (gil/nogil)? I would prefer building extensions does not get any more complicated.
- Can I automatically update my code to handle nogil? (a tool like lib2to3 or six)</p>
]]></description><pubDate>Sat, 29 Jul 2023 02:45:39 +0000</pubDate><link>https://news.ycombinator.com/item?id=36916301</link><dc:creator>ahgamut</dc:creator><comments>https://news.ycombinator.com/item?id=36916301</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=36916301</guid></item><item><title><![CDATA[New comment by ahgamut in "Patching GCC to build Actually Portable Executables"]]></title><description><![CDATA[
<p>I had tried to build a bunch of different codebases (git, bash, gcc, curl etc.) before trying busybox, and I'd never seen code like that before. Plus that error came alongside a compiler error in my patch that took a long time to debug, so it was a memorable surprise :)<p>Would you consider a code pattern like that to be common? What other codebases apart from busybox have it? If there are many examples, I might spend some time trying to update my patch to handle patterns of that kind.</p>
]]></description><pubDate>Fri, 14 Jul 2023 13:58:14 +0000</pubDate><link>https://news.ycombinator.com/item?id=36724127</link><dc:creator>ahgamut</dc:creator><comments>https://news.ycombinator.com/item?id=36724127</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=36724127</guid></item><item><title><![CDATA[New comment by ahgamut in "Patching GCC to build Actually Portable Executables"]]></title><description><![CDATA[
<p>New constants do make compilation a lot easier, but my personal opinion is that the overhead to convert to/from the old constants during runtime is too much.<p>Look at the list of constants here: <a href="https://github.com/jart/cosmopolitan/blob/master/libc/sysv/consts.sh">https://github.com/jart/cosmopolitan/blob/master/libc/sysv/c...</a><p>Every time I used any of these constants, I'd have to load a whole bunch of them into my binary as a large lookup table, and go through that table every time I needed a check in my program. It might not be that slow, but I believe it would definitely be noticeable.<p>My goal was to make porting easier without changing a lot of source code in either the libc or in the software I was trying to port, and still produce binaries that are close or better in performance. Under those constraints, this gcc patch seemed like the best way to simplify the process.<p>If I run into enough codebases where SIGHUP is used as an array index initializer, I will probably attempt your suggestion just to measure the tradeoffs. Or you could try it out and let me know if a separate set of constants is better.</p>
]]></description><pubDate>Fri, 14 Jul 2023 13:50:53 +0000</pubDate><link>https://news.ycombinator.com/item?id=36724025</link><dc:creator>ahgamut</dc:creator><comments>https://news.ycombinator.com/item?id=36724025</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=36724025</guid></item><item><title><![CDATA[New comment by ahgamut in "Patching GCC to build Actually Portable Executables"]]></title><description><![CDATA[
<p>> I highly doubt many would be willing to rewrite the world to make some "clever hack" work.<p>I specifically wanted to avoid rewriting the world in order to port established codebases like git/curl to Cosmopolitan Libc.<p>My goal with this gcc patch was to answer the question: "what is the minimum amount of source code I would have to manually change in order to port software to Cosmopolitan Libc?". As we find out, sometimes we don't have to change anything to compile code for an Actually Portable Executable -- just do the usual ./configure && make, and a small `objcopy` command at the end to create the APE.</p>
]]></description><pubDate>Fri, 14 Jul 2023 13:32:10 +0000</pubDate><link>https://news.ycombinator.com/item?id=36723775</link><dc:creator>ahgamut</dc:creator><comments>https://news.ycombinator.com/item?id=36723775</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=36723775</guid></item><item><title><![CDATA[New comment by ahgamut in "Patching GCC to build Actually Portable Executables"]]></title><description><![CDATA[
<p>Yeah I found out I got banned when attempting to comment about this blog post. I rarely comment on online forums anyway, because I find I don't know enough to comment about most topics.<p>IIRC over the last year, I've only commented once on lobste.rs, when it came to something about Python's import system, and only upvoted my own blog posts about Cosmopolitan Libc and related comments + maybe one or two other posts. I disagree with the ban, but I can see why my account would get banned as a spammer (one of the accounts banned alongside mine had a double account I think).<p>lobste.rs is a wonderful community, and I'm happy to see that someone there atleast mentioned this blog post. Hopefully I can get un-banned at some point.<p>Luckily I can still comment on HN though!</p>
]]></description><pubDate>Fri, 14 Jul 2023 13:11:48 +0000</pubDate><link>https://news.ycombinator.com/item?id=36723478</link><dc:creator>ahgamut</dc:creator><comments>https://news.ycombinator.com/item?id=36723478</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=36723478</guid></item><item><title><![CDATA[New comment by ahgamut in "Patching GCC to build Actually Portable Executables"]]></title><description><![CDATA[
<p>Right now I use the gcc, git, vim, and ninja APE binaries on my local system for daily work, and so far I have seen no visible regressions.<p>I agree with you though -- an extensive testing setup will reveal more things for improvement, be it in my patch or in the libc itself. At the moment I only have direct access to Debian 11/Fedora 35/FreeBSD 13, but I expect we will soon find a nice way to run tests across the different operating systems automatically. One of my ideas was to setup a separate drive or folder with all the executables, accessible from different operating systems/VMs, and then run the tests from each. What do you think?</p>
]]></description><pubDate>Fri, 14 Jul 2023 07:30:30 +0000</pubDate><link>https://news.ycombinator.com/item?id=36720571</link><dc:creator>ahgamut</dc:creator><comments>https://news.ycombinator.com/item?id=36720571</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=36720571</guid></item></channel></rss>