Johz's recent activity
-
Comment on The road to non-directed kidney donation in ~health
-
Comment on Electric ships are slowly starting to make sense in ~transport
Johz Link ParentI managed (by chance) to see the new Orient Express sail-powered cruise liner the other day. Then I looked at the prices online, and wow, that is not an experience I will have any time soon, but...I managed (by chance) to see the new Orient Express sail-powered cruise liner the other day. Then I looked at the prices online, and wow, that is not an experience I will have any time soon, but it's exciting to see that sort of thing happen.
That said, the impression I get is that most of these approaches are sail-assisted rather than fully sail-powered, in that the sails are used to reduce how much work the engines need to do rather than completely eliminate them. But I guess for a long journey that's still going to be a significant reduction in energy consumption.
-
Comment on Bun has been rewritten in Rust in ~comp
Johz Link ParentThe companies I've been working with have basically all used either GitHub Copilot or Claude. API pricing has mostly just been used for the occasional integration (i.e. when building a tool that...The companies I've been working with have basically all used either GitHub Copilot or Claude. API pricing has mostly just been used for the occasional integration (i.e. when building a tool that has AI integration, use API pricing for that integration, but for the actual programming of it use Copilot/Claude subscriptions).
In fairness, these have mostly been smaller companies (<100 developers) and I can imagine things are different for bigger corporations.
-
Comment on Bun has been rewritten in Rust in ~comp
Johz Link ParentI mean more in the sense that a lot of companies right now seem to be relying on subsidised inference - see Claude's subscriptions where loopholes are being slowly tightened, or GitHub Copilot's...I mean more in the sense that a lot of companies right now seem to be relying on subsidised inference - see Claude's subscriptions where loopholes are being slowly tightened, or GitHub Copilot's subscriptions which has recently become significantly more expensive. I think in the long term you're right, but I think in the short and medium terms, companies are typically going to end up paying more than they are currently, at least for developer tasks like this one.
-
Comment on Bun has been rewritten in Rust in ~comp
Johz Link ParentI'm not sure the economics are changing so much. Firstly, LLMs are getting more expensive as the major providers stop subsidising their usage (see Anthropic's recent terms of use changes, and...I'm not sure the economics are changing so much.
Firstly, LLMs are getting more expensive as the major providers stop subsidising their usage (see Anthropic's recent terms of use changes, and GitHub's big price increases). Bun could do this because they're owned by Anthropic and basically have access to unlimited Claude usage for free (and possibly even the new Mythic model?).
Secondly, most big projects in memory-unsafe languages don't suffer from bugs to the extreme extent that Bun has. Yes, there's good reason to push for more usage of memory safe languages in critical parts of core software like browsers or the kernel, but there are also a bunch of other tools that can at least partly mitigate issues. But Bun has always been buggy beyond just that. And maybe it's because Bun has unique challenges that make it harder to get memory safety right than in, say, Tigerbeetle or Ghostty or whatever else is using Zig, but I don't think most other projects are going to get as much value out of a rewrite.
And thirdly, the proof is going to be in the pudding. It's not enough to spend vast numbers of token generating a new version of Bun - they also need to prove that the new version is materially less buggy. They've not really done that yet. In fairness, this is just an initial port, and there's a lot that needs to be cleaned up from this point in, but like I said before, I don't think Bun is buggy because of memory safety, I think it's buggy because it's not very good. So I suspect we're just going to see memory safety issues and segfaults going down, but there's just going to be other bugs instead that make up the balance. That is, for an end-user of Bun, I don't think there's going to be much difference.
-
Comment on Bun has been rewritten in Rust in ~comp
Johz Link ParentIn theory, yes, but the small amount of a couple of files that I've seen, I think the new codebase would need a lot of care and attention to be useable by human contributors. There are lots of...In theory, yes, but the small amount of a couple of files that I've seen, I think the new codebase would need a lot of care and attention to be useable by human contributors. There are lots of weird things like the LLM inlining imported functions from other files, resulting in duplicated, subtly different functions lying all over the place; or the LLM writing functions that made sense in Zig but don't make sense in Rust. The result feels fairly chaotic, I don't think any developer is going to be familiar with the new codebase.
I also am unsure about the unsafe keyword issue. One of the dangers of improper use of
unsafeis that it can do spooky action at a distance - code that is marked as unsafe may run fine, but it may result in data that violates an invariant somewhere else. So now seemingly safe code is implicitly unsafe. If you're careful, you can build data structures that enforce the right invariants, meaning that the unsafe logic is confined to a certain spot. But it doesn't seem like the Bun uses of unsafe do that. I suspect untangling this amount of unsafe is going to be a very difficult challenge.There's also the issue that LLMs might but be as good at rewriting or porting as they appear at first glance. A while back, someone wrote a Python HTML5 parser, and other people vibe-ported it to other languages. Except the ports did weird things - they all had subtly different algorithms for some of the internal parts, even though they had all ostensibly come from the same code suggesting the LLM basically wrote its own version of some of the code, rather than doing a straight port. These sorts of subtle issues are difficult to notice at the sort of scale of this PR.
The final issue is that the code the came before was very buggy - that's supposedly why they made the change. And in theory that makes sense - before there were a bunch of memory safety issues, Rust solves (insert asterisk here) memory safety, so switching to Rust should help a lot. But other Zig projects have not been struggling as much as Bun has with memory safety, so I don't think it's so simple to say that Bun's previous issues were because Zig is too lax, and Rust will solve them. Rather, I suspect Bun's previous issues have not to do with issues with how Bun is being developed, and that switching to Rust won't resolve those underlying issues at all. Instead, you're just going to end up with different categories of bug that Rust doesn't do anything to prevent.
-
Comment on Happy Birthday David Attenborough, 'the voice for nature,' turns 100 in ~enviro
Johz Link ParentI wasn't sure if I had the right name, and I thought about looking it up to double-check, but then I decided "fuck it, it's grammar pedantry, someone will definitely correct me if this is wrong"!I wasn't sure if I had the right name, and I thought about looking it up to double-check, but then I decided "fuck it, it's grammar pedantry, someone will definitely correct me if this is wrong"!
-
Comment on Happy Birthday David Attenborough, 'the voice for nature,' turns 100 in ~enviro
Johz Link ParentTo be pedantic, if that was the intended meaning, the sentence would be grammatically incorrect: "Barack Obama and pop star Billie Eilish" would be a subordinate clause in that case, and would...To be pedantic, if that was the intended meaning, the sentence would be grammatically incorrect: "Barack Obama and pop star Billie Eilish" would be a subordinate clause in that case, and would require a comma (or similar punctuation mark) on either side, but there is only a comma at the beginning.
The sentence unambiguously forms a list with three elements, whether you were to use an Oxford comma or not.
Also this is a grammar pedantry comment, so I assume it is riddled with its own grammatical errors and I refuse to attempt to find and correct them.
-
Comment on Almost half of EU’s busiest flight routes are ‘hard or impossible’ to book on trains in ~transport
Johz Link ParentThe explanation I've found most convincing is chronic underfunding of projects to expand and maintain existing services, and a lack of will to build new infrastructure. Essentially, the numbers of...The explanation I've found most convincing is chronic underfunding of projects to expand and maintain existing services, and a lack of will to build new infrastructure. Essentially, the numbers of passengers have grown steadily over time, but they're all still being transported on the same tracks. These tracks then need to be maintained more often because there's more traffic going down them, but at the same time because there's more traffic, there's less time to stop and do that maintenance. Trains are being scheduled at essentially maximum capacity, which means if something goes wrong the entire network runs into issues because every train is dependent on every other train running on time, there's no redundancy at all. And the sorts of new services that could alleviate these issues are costly and struggle against environmental, political, and NIMBY-based opposition.
Essentially the same issues that are currently affecting most wealthy European nations, it's just in Germany they're particularly visible in the rail network right now.
-
Comment on Ilhan Omar says she isn’t a multimillionaire, blames accounting error in ~society
Johz Link ParentI don't think there's anyone surprised by that, though. Like, I didn't know this at all but if you'd asked me if he was profiteering from his presidency I'd have said "yes, obviously, I'm sure...I don't think there's anyone surprised by that, though. Like, I didn't know this at all but if you'd asked me if he was profiteering from his presidency I'd have said "yes, obviously, I'm sure he's raking it in". But if you'd asked me if there were Democrats doing the same thing, I might have been able to tell you that I vaguely remember something about Elizabeth Warren, and that's about it. This is news to me. (In fairness, I'm from the UK and I live in Germany, I don't spend a lot of time thinking about the US.)
The other side of this is that a generally left-wing forum like this is going to be more interested in news about generally left-wing politicians, because that's the news that affects them.
-
Comment on Vibe coding is just the return of Excel/Access, with more danger in ~comp
Johz Link ParentThe library you use shouldn't include its own daylight savings information, that should typically come from the operating system (or browser). There are some situations where that isn't possible,...The library you use shouldn't include its own daylight savings information, that should typically come from the operating system (or browser). There are some situations where that isn't possible, but in those cases you should be able to pull in the data from the latest tzdb directly.
But yeah, the state of datetime APIs have typically been pretty dire. Moment has a nice API and is certainly better than the built-in Date class, but there's no way of representing just a date or time there, and makes it difficult to distinguish between datetimes without timezone information and datetimes in the local timezone. Some other languages are slightly better - in Python, for example, at least there are multiple classes for dates, times, and datetimes - but it can be quite hit-and-miss.
-
Comment on Vibe coding is just the return of Excel/Access, with more danger in ~comp
Johz Link ParentIt's mostly fairly solved at this point, although not all languages and ecosystem have all of the correct components, and old data and systems need to be supported which makes things harder. But...- Exemplary
It's mostly fairly solved at this point, although not all languages and ecosystem have all of the correct components, and old data and systems need to be supported which makes things harder. But generally:
- Use dates if you just need dates, use times if you just need times. These things don't need timezones, do you're sorted here.
- If the thing you're working with is a fixed point in time, typically an event that has happened in the past that can't ever change, store it in UTC, and consistently use UTC throughout the app. Then at the last moment, render it in the user's timezone or whichever timezone is relevant.
- If the user is configuring an event that will happen in the future, save the configuration and a materialised UTC timestamp. The timestamp is for you internally, and should be re-creates if the configuration ever changes, plus every time the tzdb gets updated. The configuration is the source of truth. The configuration is all of the options the use could input: date, time, timezone, duration (start+duration is more likely to stay accurate than start+end). Default to the user's local timezone, allow them to configure it if needed.
- If you need to do arithmetic with datetimes, figure out whether the user expects an answer in absolute time or in wall-clock time. Typically, consider what should happen during a DST transition: if I have a span of one day during the transition, should that span last 24hrs exactly, or should it last 23hrs or 25hrs depending on the transition? Different applications will have different answers here, there's no single correct solution.
- If it's always 24hrs exactly, you want UTC everywhere again, this is the easy case.
- If it depends on the transition, then you want wall-clock times, i.e. "what time would a calendar+clock hanging on the wall show?". This is probably the hardest case to handle, but there's lots of good support for it. Now consider:
- Do I need to know what the actual timezone is? If not (typically the case if you're confident you'll never need to deal with times that happen during a transition, and there's only one timezone involved in each set of calculations), you might be able use the local/naive datetime, i.e. the one where no timezones are attached.
- Otherwise, store the timezone alongside each date. The ISO date standard conveniently has a format for this. Importantly, you should sure the timezone, not (just) the offset!
- Either way, make sure you're always using the correct units and never converting unnecessarily. E.g. if you're using days, never convert 1 day = 24 hours. Use a duration type that can distinguish these two units.
- If different users can have different timezones, try and get the timezone from an external source of truth, e.g. the operating system or the browser. If that isn't possible or the user should be able to configure their timezone, ask the user for their location not their offset (e.g. show "Europe/Berlin" as an option, not "+01"). Although for convenience, it's probably good to show what the offset currently is in each location, and allow them to search by an offset abbreviation (e.g. "CET" should show a list of timezones that use +01 in the winter).
For JavaScript, always use Temporal (via polyfill if necessary) to manage dates and times. Other languages will have their own library. The minimum necessary setup is that all of the above cases are represented by their own types - you should always have separate date, time, and datetime classes, the datetime class should be broken up into "UTC", "local", "named timezone" classes, etc.
With all of the above, datetimes are mostly manageable, but the challenge will always be other applications or data sources that don't play by the rules properly and how to handle those.
-
Comment on Vibe coding is just the return of Excel/Access, with more danger in ~comp
Johz Link ParentI used to take this approach, until I worked with a colleague who comments way too much and realised that actually "too much" was a way better failure more than "too little" when trying to figure...I used to take this approach, until I worked with a colleague who comments way too much and realised that actually "too much" was a way better failure more than "too little" when trying to figure out what was going on with code I hadn't touched in a year. Like, I'm still fairly conservative with my comments, but it's definitely not a "last resort" sort of thing.
I'm still trying to articulate when comments make sense to me, but I wrote about one part of this on my blog a while back, and the gist was that if I need to communicate something to you that isn't obvious from the code alone, I've typically got two options: naming (i.e. variables, functions, types) or comments. But names are really hard to get right. You don't want to have too long a name (it gets unwieldy fast), but if it's too simple or generic a name, the reader may not understand the full meaning or purpose of that variable or function. It's also harder to sum up complex ideas in a good name - sometimes there really is exactly the right name for something, but often there isn't, or you can't think of it at least, so you end up with a name that's not wrong, but it's also not quite clear by itself.
On the other hand, the benefit of a comment is that you can explain all your reasoning with no limit but your patience typing and your reader's patience reading. You can definitely have comments that are too long, but it's harder to achieve that than it is to find a bad name. You can also explain why an algorithm was chosen (usually hard to capture in a name) or summarise what an algorithm does in words rather than code (usually clearer as prose than as a name).
The disadvantage is that you don't necessarily have the comment at every call-site or reference site, although tooling can mitigate this somewhat. But the advantage is that you can be much more precise and communicate much more clearly in a comment than you ever could in a name. And while it's often even cheaper expressing your idea directly in code, sometimes that code isn't obvious or misses some nuance or something like that.
So I'd suggest the better approach is almost the opposite to yours: comment first, then figure out if there's a simpler way of expressing the comment (a concise but clear name, a better way of writing the code, etc).
-
Comment on The center has a bias in ~tech
Johz Link ParentCopyright as a concept is generally fairly well defined. Copyright for software is not. The GPL exploits this ambiguity, and basically makes a bunch of claims about what is and isn't copyright...Copyright as a concept is generally fairly well defined. Copyright for software is not. The GPL exploits this ambiguity, and basically makes a bunch of claims about what is and isn't copyright infringement, regardless of what the actual law says. For a while this worked out okay, but as copyright for software is slowly being cleaned up, many of those claims aren't actually true any more.
For example, the GPL claims that a derivative work includes any work that links the original work. (The GPL also makes this more complicated by exclusively using language that only makes sense in the context of C, but the FSF certainly intend this clause to cover any case of a library being used by another program.) This is the whole virality concept: if you use a GPL work, you now need to comply with GPL for all of your code as well as the original code. This is probably the most famous feature of the GPL specifically.
Except it turns out this is completely unenforceable in the EU, because that's not considered a derivative work in the EU. The GPL doesn't get to decide what a derivative work is, copyright law does. And Directive EC 2009/24 recitals 10 & 15 specifically state that you can freely call or reference other code without creating a derivative work.
Generally, cases where the GPL has been successfully contested in the EU have either happened before this directive came into force, or have been more general tests of the qualities of an open source license (i.e. the referenced library itself is still copyrighted and under GPL, even if no derived work is created in the rest of the code).
(Also note that the situation in the US is unclear, but it looks like courts are slowly leaning towards a similar approach to the EU (see e.g. Google vs Oracle) and I wouldn't be surprised to see similar legislation appear over there.)
You're also missing the point of EULAs. They exist because they are enforceable. They often contain unenforceable clauses, sure, but the basic concept of "to access this item, you need to agree to these terms of use" is very well enshrined in law. The problem with EULAs for end-user software is that they represent a significant power imbalance where consumers are pitted against corporations, but for open source licenses which are more typically used in a B2B setup, that isn't the case. And with something like a license agreement, you get to decide when the license applies because you define that as part of the license. So you could have had much more rigourous consumer protections via an EULA-style license agreement than you can ever have by abusing copyright protection, but the FSF for some reason decided it was more fun to be clever than to try and solve a real problem. And now we're stuck with a concept of open source that is slowly making itself less and less relevant over time.
Not that I'm bitter about this or anything.
-
Comment on The center has a bias in ~tech
Johz Link ParentHonestly, the more I've understood of how the GPL works, the dumber it has seemed. It essentially hinges on copyright law. This is stupid. Copyright law varies wildly between different countries...Honestly, the more I've understood of how the GPL works, the dumber it has seemed.
It essentially hinges on copyright law. This is stupid. Copyright law varies wildly between different countries and many of its ramifications aren't clear within a single jurisdiction. For example, is using a piece of third party software in your own software a copyright violation? The FSF (who write the GPL) say yes. The EU says no. There is no clear answer from the US, IIRC. The whole copyright thing is fraught with ambiguity and open source licenses are stuck in the middle of that.
But there is an easier option' EULAs. These do have a clearer legal backing, and you can be much more explicit about what you put in them. You can say, for example, that changes to source code must be released back to the original licensor if passed on to an end user. You can clarify much more precisely what you want to allow. The LLM situation would be much easier to resolve because you could explicitly forbid LLM ingestion in your license (as opposed to right now where it looks like training an LLM generally counts as fair use and therefore there's nothing a copyright-based license can do about it).
There's a different version of history where the FSF weren't quite so smug and didn't try to be so clever about their solution, and I'm not saying that version of history would have been better (I don't know what all the ramifications would be), but I do think free software would have had a much stronger legal basis in some of these discussions.
-
Comment on Dual national Londoner stranded in Spain by new border rule in ~travel
Johz Link ParentShe assumed that too, as I understand it, but the new rules state that this isn't allowed. Because she is a British citizen, she must present evidence of her British citizenship to enter the UK....She assumed that too, as I understand it, but the new rules state that this isn't allowed. Because she is a British citizen, she must present evidence of her British citizenship to enter the UK. If she has no evidence of that, she cannot enter. The only valid documents she can present are a passport (that it's not clear she's entitled to), or the £600 digital document mentioned in the article.
-
Comment on Dual national Londoner stranded in Spain by new border rule in ~travel
Johz Link ParentAs a counterpoint, as the father of a baby with British dual citizenship, this is genuinely the first I, or any of my British family have heard of this rule, so I don't think it's been...As a counterpoint, as the father of a baby with British dual citizenship, this is genuinely the first I, or any of my British family have heard of this rule, so I don't think it's been communicated so clearly. Indeed, we've apparently visited and left the UK since this rule came into force without using a British passport.
If you live outside of the UK, it's often easier to travel on your non-British passport (this is what we've found with my kid at least) because it's easier to get hold of and you don't need additional documentation when arriving back home. Whenever we visit the UK, we are essentially visiting as tourists, so it seems reasonable to me that as long as you fulfil at least one criteria (in this case EU national visiting the UK for a short stay) there shouldn't be much of a problem.
The other side is that nearly £600 is an insane amount of money for a digital document that is essentially a document stating a fact that is already true, especially given that a physical passport is significantly cheaper.
I guess I'm just really fed up of my government consistently making it harder for me to get to or stay in the UK, and consistently making it easier to stay here in Europe. Some of it is these sorts of travel regulations (my wife's ETA, for example), while some of it is the increasingly ridiculous visa requirements (we will probably never be able to move back to the UK now unless my wife changes careers or regulations change). And that's not including the lack of motivation to move in the first place - I've been over the last week telling people about my parental leave plans, and the responses and stories from my UK-based family and friends has been just depressing in terms of how little they've been able to take.
-
Comment on From $250 million megadeal to empty offices: the unraveling of Bad Robot in ~movies
Johz Link ParentYeah, Andor is definitely something that's with watching by itself, but because it's slower-paced, I found I needed to force myself to take the time to watch it properly.Yeah, Andor is definitely something that's with watching by itself, but because it's slower-paced, I found I needed to force myself to take the time to watch it properly.
-
Comment on From $250 million megadeal to empty offices: the unraveling of Bad Robot in ~movies
Johz Link ParentI don't even think you need to get to the third arc. Maybe it's worth pushing through the first three episodes, but I don't think it's the sort of show that starts off shaky but finds its feet....I don't even think you need to get to the third arc. Maybe it's worth pushing through the first three episodes, but I don't think it's the sort of show that starts off shaky but finds its feet. What you get in episode one is what you get all the way through.
-
Comment on From $250 million megadeal to empty offices: the unraveling of Bad Robot in ~movies
Johz Link ParentIf you've not enjoyed the first couple of episodes, season two probably won't be much better. It's all the same slow burn character drama, and I think it's slightly better in the first season...If you've not enjoyed the first couple of episodes, season two probably won't be much better. It's all the same slow burn character drama, and I think it's slightly better in the first season where the overarching narrative arc is tied to a single character, whereas in the second season it feels like there's more going on at once and some of the characters feel a bit underwritten.
I really like it, I will always recommend it, but I can understand why people would see it as a slog.
Bone marrow is also a lot easier these days than it used to be — you get a few days of injections that can make you ache a bit but that's about it, and then you sit in a hospital for a day while they filter the stem cells out of your blood. It's basically painless, and the worst thing that happens to you is boredom.
Depending on what country you live in, it's typically very easy to sign up as well — I was able to do all the swabbing by post, and that was that.
Also (and mainly a reminder to myself because I've just moved): remember to update your contact details if you're already a donor and you've moved around. It's the sort of thing that you can sign up for and then only become relevant years later, so keeping the contact details up-to-date is important. That also seems to be very easy, just a few seconds to update.