HNHacker News
TopNewBestAskShowJobs

dagenix

2,657 karma · joined July 15, 2017

submissionscomments
dagenix··on Stop making swap partitions—use swap files instead
How did they fix it?
dagenix··on AI financial advice is surprisingly good, especially if you ask right questions
Bank account interest is pretty much always less than inflation. So, money sitting in a bank account for 18 years is just losing value.
dagenix··on Every new car sold in the European Union must include a driver monitoring camera
I have no idea how well such a system works, but, I found these lines pretty jarring:

> They found it fires on ordinary driving, not just distracted driving.

> Glance away from an empty highway to take in the scenery, or look at the infotainment screen to change a song, and the warning goes off anyway.

Like, isn't that the point, that if you aren't looking at the road it should go off?

dagenix··on CERT is releasing six CVEs for serious security vulnerabilities in dnsmasq
If you don't like the debian model, didn't use debian. There are people that like the debian model, it seems like you aren't one of them, though. That doesn't make them wrong.
dagenix··on eBay Rejects GameStop's $56B Takeover as Not Credible
My understanding is that existing Ebay shareholders would get half cash and half stock. In order to actually profit, those shareholders would need to believe that the combined company's stock could be sold off without taking a significant loss.
dagenix··on x86 prefixes and escape opcodes flowchart
https://archive.ph/ZMsnQ
dagenix··on I see a future in jj
I strongly suspect that its not feasible to colocate pijul and git. git and jj are based on snapshots, while pijul is based on patches. They have very different models.
dagenix··on I see a future in jj
One thing JJ has that git doesn't is the concept of first class conflicts. In JJ, rebasing or merging never fails, but it might record a conflict to resolve later. Git, on the otherhand, forces you to drop we everything to resolve conflicts immediately. It sounds like a small thing - but in my experience, being able to resolve conflicts later when I feel like it is absolutely amazing and really helps reduce context switching.
dagenix··on Waymo has received our pilot permit allowing for commercial operations at SFO
You are supposed to supervise Tesla FSD. Waymo doesn't require someone in the driver's seat at all. They aren't the same thing.
dagenix··on Python has had async for 10 years – why isn't it more popular?
The problem, IMO, with asyncio is that its way, way too complicated. In my experience, anyio (https://github.com/agronholm/anyio) provides a much better interface on top of asyncio. And since it can use asyncio as a backend, it maintains compatibility with the asyncio ecosystem. FastAPI, for example, uses anyio.

One thing that I don't see being mentioned in any of the threads here talking about green threads is cancellation. A huge benefit, IMO, of anyio is that it makes cancellation really easy to handle. With asyncio, cancellation is pretty hard. And with green threads, cancellation is often impossible.

dagenix··on Asyncio: A library with too many sharp corners
In my experience, the key to using asyncio is to use anyio. Anyio is an interface that you can use ontop of asyncio and fixes most of its shortcomings.

https://anyio.readthedocs.io

dagenix··on Using uv and PEP 723 for Self-Contained Python Scripts
I'm not dismissing uv, I'm critiquing the article.
dagenix··on Using uv and PEP 723 for Self-Contained Python Scripts
> This approach eliminates the need for complex setup tools like requirements.txt or package managers...

And yet, the rest of the article is about uv. According to uv itself:

> An extremely fast Python package and project manager, written in Rust.

It's a package manager!

dagenix··on Happy 10k Day
It doesn't seem like https://comma.ai/ has sources either.
dagenix··on Happy 10k Day
I especially like how there is next to no mention about safety on the main page. But at least its only $999 and it has AI and 50k GitHub stars, so, thats nice.
dagenix··on Happy 10k Day
So, a hackier version of Tesla's autopilot? Sounds, uh, terrifying.
dagenix··on NixOS 24.11 "Vicuña" Released
The pretty significant updates to MacOS support are really cool to see!
dagenix··on Engineers do not get to make startup mistakes when they build ledgers
https://en.wikipedia.org/wiki/G._K._Chesterton#Chesterton's_...
dagenix··on Why CSV is still king
I don't believe its in the standard library for Rust, even if it is very popular in the Rust ecosystem.
dagenix··on Node.js adds experimental support for TypeScript
Java does jit
dagenix··on Free-threaded CPython is ready to experiment with
> Yes, but the absence of the GIL would make race conditions more likely to happen.

Does it though? I'm not saying it doesn't, I'm quite curious. Switching between threads with the GIL is already fairly unpredictable from the perspective of pure-Python code. Does it get significantly more troublesome without the GIL?

> Yes. They could run it in multiple threads with the GIL today, but as above, race conditions might not show up as often, so it might not be realized that the code is broken. But also, with the GIL there is the common perception that Python doesn't do multithreading well anyway, so it's less likely to be used for that. With the GIL removed, I suspect many people will want to use multithreading a lot more in Python to parallelize code, without fully realizing the implications.

Fair

dagenix··on Free-threaded CPython is ready to experiment with
> But there is a lot of pure Python code out there that is not written that way. Removal of the GIL would allow such code to be naively run in multiple threads using, for example, Python's support for thread pools.

I guess this is what I don't understand. This code could already be run in multiple threads today, with a GIL. And it would be broken - in all the same ways it would be broken without a GIL, correct?

> Anyone under the impression that removing the GIL was intended to allow this sort of thing without any further checking of the code is mistaken. That is the kind of thing my comment was intended to exclude.

Ah, so, is your point that removing the GIL will cause people to take non-multithread code and run it in multiple threads without realizing that it is broken in that context? That its not so much a technical change, but a change of perception that will lead to issues?

dagenix··on Free-threaded CPython is ready to experiment with
Yup, I think its described here: https://docs.python.org/3/c-api/init.html#releasing-the-gil-....

My understanding, is that many extensions will release the GIL when doing anything expensive. So, if you are doing CPU or IO bound operations in an extension _and_ you are calling that operation in multiple threads, even with the GIL you can potentially fully utilize all of the CPUs in your machine.

dagenix··on Free-threaded CPython is ready to experiment with
> If your Python code assumes it's just going to run in a single thread now, and it is run in a single thread without the GIL, yes, removing the GIL will make no difference.

I'm not sure I understand your point.

Yes, singled thread code will run the same with or without the GIL.

My understanding, was that multi-threaded pure-Python code would also run more or less the same without the GIL. In that, removing the GIL won't introduce races into pure-Python code that is already race free with the GIL. (and that relatedly, pure-Python code that suffers from races without the GIL also already suffers from them with the GIL)

Are you saying that you expect that pure-Python code will be significantly impacted by the removal of the GIL? If so, I'd love to learn more.

dagenix··on Free-threaded CPython is ready to experiment with
The GIL prevents the corruption of Pythons internal structures. It's hard to remove because:

1. Lots of extensions, which can control when they release the GIL unlike regular Python code, depend on it 2. Removing the GIL requires some sort of other mechanism to protect internal Python stuff 3. But for a long time, such a mechanism was resisted by th Python team because all attempts to remove the GIL either made single threaded code slower or were considered too complicated.

But, as far as I understand, the GIL does somewhere between nothing and very little to prevent races in pure Python code. And, my rough understanding, is that removing the GIL isn't expected to really impact pure Python code.

dagenix··on Free-threaded CPython is ready to experiment with
Are you writing an extension or Python code?

If you are writing Python code, the GIL can already be dropped at pretty much any point and there isn't much way of controlling when. Iirc, this includes in the middle of things like +=. There are some operations that Python defines as atomic, but, as I recall, there aren't all that many.

In what way is the GIL preventing races for your use case?

dagenix··on Free-threaded CPython is ready to experiment with
As I understand it, if your code would have race conditions with free threaded python, than it probably already has them.
dagenix··on Nvidia Warp: A Python framework for high performance GPU simulation and graphics
That may be your definition, but that's not everyone's definition. Wikipedia, for example, says:

> Open-source software (OSS) is computer software that is released under a license in which the copyright holder grants users the rights to use, study, change, and distribute the software and its source code to anyone and for any purpose.

https://en.m.wikipedia.org/wiki/Open-source_software

dagenix··on Reclaiming IPv4 Class E's 240.0.0.0/4
ULAs aren't the same as a NAT setup. You can assign all of your local devices stable ULAs _and_ also reputable addresses that randomly change. If you do that, there is no need for NAT.
dagenix··on Is Super Mario Maker Beaten Yet?
Apparently there is only 1 level that no one (except the creator) has beaten. Its only 10-20 seconds long, but is so hard that its not clear if anyone will complete it before the servers shut down: https://www.youtube.com/watch?v=KmikpEVCuZE
Page 1 of 18Next →