HNHacker News
TopNewBestAskShowJobs

arghwhat

9,034 karma · joined January 12, 2017

no.
submissionscomments
arghwhat··on The Holy Grail of Linux Binary Compatibility: Musl and Dlopen
Dynamic libraries have been frowned upon since their inception as being a terrible solution to a non-existent problem, generally amplifying binary sizes and harming performance. Some fun quotes of quite notable characters on the matter here: https://harmful.cat-v.org/software/dynamic-linking/

In practice, a statically linked system is often smaller than a meticulously dynamically linked one - while there are many copies of common routines, programs only contain tightly packed, specifically optimized and sometimes inlined versions of the symbols they use. The space and performance gain per program is quite significant.

Modern apps and containers are another issue entirely - linking doesn't help if your issue is gigabytes of graphical assets or using a container base image that includes the entire world.

arghwhat··on I was banned from Claude for scaffolding a Claude.md file?
> And once you're banned you cant [..] make a data request

glares in GDPR

arghwhat··on What is Plan 9?
> The C language also does not specify a linked list. Go tell your developer friends that C can never use a linked list.

They would not blink because the statement is accurate. To the C language and to the C compiler, there are no linked lists - just random structs with random pointers pointing to god knows what. C does know about arrays though.

> The JavaScript spec[1] does not [specify garbage collection].

I have good reason to believe that you are not familiar with the specification, although to be fair most developers would not be familiar with its innards.

The specification spends quite a while outlining object liveness and rules for when garbage is allowed to be collected. WeakRefs, FinalizationRegistries, the KeptObjects list on the agent record, ...

Just like with Go, it is perfectly valid to have an implementation of a "garbage collector" that is a no-op that never collects anything, which means that the application will continously leak memory until it runs out and crashes as the language provides no mechanism to free memory - for Go, you can switch to this with `GOGC=off`. The specific wording from ECMA-262:

> This specification does not make any guarantees that any object or symbol will be garbage collected. Objects or symbols which are not live may be released after long periods of time, or never at all. For this reason, this specification uses the term "may" when describing behaviour triggered by garbage collection.

If you're not used to reading language specs the rest of the details can be a bit dry to extract, but the general idea is that the spec outlines automatic allocation, permission for a runtime to deallocate things that are not considered "live", and the rules under which something is considered to be "live". And importantly, it provides no means within the language to take on the task of managing memory yourself.

This is how languages specify garbage collection as the language does not want to limit you to a specific garbage collection algorithm, and only care about what the language needs to guarantee.

> [1] The standard calls itself ECMAScript, but I believe your intent here is understood.

sigh.

> For what it is worth, I also put "C can never use a garbage collector" into an LLM. It also called me out on that bullshit just the same.

more sigh. LLMs always just wag their tails when you beg the question on an opinion. They do not do critical thinking for you or have any strong opinions to give of their own.

I'm done, have a nice day.

arghwhat··on What is Plan 9?
I must admit that the ability to randomly bind on top of your "drivers" to arbitrarily overwrite functionality, whether to VPN somewhere by binding a target machine's network files, or how rio's windows were merely /dev/draw proxies and you could forward windows by just binding your own /dev/draw on the target, holds a special place in my heart. 9front, if nothing else, is fun to play with. I just don't necessarily consider it the most optimal or most performant design.

(I also have an entirely irrational love for the idea the singular /bin folder with no concept of $PATH, simply having everything you need bound on top... I hate $PATH and the gross profile scripts that go with it with a passion.)

arghwhat··on What is Plan 9?
This is actually quite an interesting topic in its own right, but not quite the discussion above, which is about whether C or Rust include a GC or is considered to "use" the GC you hand-rolled or pulled in from a library.

I wouldn't consider FilC's GC a GC in the conventional sense either, in that code compiled with Fil-C is still managed manually, with the (fully-fledged) GC effectively only serving as a way to do runtime validation and to turn what would otherwise be a UAF with undefined behavior into a well-defined and immediate panic. This aspect is in essence an alternative approach to what is done by AddressSanitizer.

I'll have to look a bit more into Fil-C though. Might be interesting to see how it compares to the usual sanitizers in practice.

arghwhat··on What is Plan 9?
Indeed, you can disregard plan9 common practice and adopt the ioctl pattern, but then you just created ioctl under a different name, having gained nothing over it.

You will still have the significant context switching overhead, and you will still need distinct write-then-read phases for any return value. Manual buffer sharing is also notably more cumbersome than having a kernel just look directly at the value, and the neat part of being able to operate these fileservers by hand from a shell is lost.

So while I don't disagree with you on a technical level, taking that approach seems like it misses the point of the plan9 paradigm entirely and converts it to a worse form of the ioctl-based approach that it is seen as a cleaner alternative to.

arghwhat··on What is Plan 9?
This feels like it's into trolling, so one last round:

The C language does not use your C code, it is your C code that uses the C language.

The tools available to C is what the language specification dictated and what the compiler implemented. For example, C might use stack memory and related CPU instructions, because the C specification described "automatic memory" and the compiler implemented it with the CPU's stack functionality. It might insert calls to "memcpy" as this function is part of the C language spec. For C++, the compiler will insert calls to constructors and destructors as the language specified them.

The C language does not specify a garbage collector so it can never use one.

You, however, can use C to write a garbage collector to manually use in your C code. C remains entirely unaware of the garbage collectors existence as it has no idea what the code you write does - it will never call it on its own and the compiler will never make any decisions based on its existence. From C's perspective, it's still just memory managed manually by your application with your logic.

In JavaScript and Go, the language specifies the presence of garbage collection and how that should work, and so any runtime is required to implement it accordingly. You can write that runtime in C, but the C code and C compiler will still not be garbage collected.

arghwhat··on What is Plan 9?
They are very different. ioctl's on a file take an operation and arguments that are often userspace pointers as the kernel can freely access any process's memory space. ctl files on the other hand are merely human-readable strings that are parsed.

Say, imagine an API where you need to provide an 1KiB string. The plan9 version would have to process the input byte for byte to sort out what the command was, then read the string to a dynamic buffer while unescaping it until it finds, say, the newline character.

The ioctl would just have an integer for the operation, and if it wanted to it could set the source page up for CoW so it didn't even have to read or copy the data at all.

Then we have to add the consideration of context switches: The traditional ioctl approach is just calling process, kernel and back. Under plan9, you must switch from calling process, to kernel, to fileserver process, to kernel, to fileserver process (repeat multiple times for multiple read calls), to kernel, and finally to calling process to complete the write. Now if you need a result you need to read a file, and so you get to repeat the entire process for the read operation!

Under Linux we're upset with the cost of the ioctl approach, and for some APIs plan to let io_uring batch up ioctls - the plan9 approach would be considered unfathomably expensive.

> The `ctl` approach is at least a proper generalization.

ioctl is already a proper generalization of "call operation on file with arguments", but because it was frowned upon originally it never really got the beauty-treatment it needed to not just be a lot of header file defines.

However, ioctl'ing a magic define is no different than writing a magic string.

arghwhat··on What is Plan 9?
> Absolutely, C also can use a garbage collector.

It is not C using the garbage collector - it is you writing a garbage collector in C. The application or library code you develop with the language is not itself a feature of the language, and the language you wrote the code in is not considered to be "using" your code.

Rust and C are unaware of any type of garbage collection, and therefore never "use" garbage collection. They just have all the bells and whistles to allow you to reference count whatever type you'd like, and in case of Rust there's just a convenient wrapper in the standard library to save you from writing a few lines of code. However, this wrapper is entirely "bolted onto the side": You can write your own Rc<T>, and there would be no notable difference to the std version.

So no, neither Rust nor C can use a garbage collector, but you can write code with garbage collection in any feature-complete language. This is importantly very different from languages that have garbage collection as a feature, like Limbo, Go, JavaScript, etc.

arghwhat··on What is Plan 9?
Rust does not have a garbage collector in any way or form. It's just automatic memory like we're used to (e.g., stack in C++), with the compiler injecting free/drop when an object goes out of scope.

What Rust brings is ownership with very extensive lifecycle tracking, but that is a guard rail that gives compile-time failures, not something that powers memory management.

(If you consider the presence of Rc<T> to make Rust garbage collected, then so is C garbage collected as developers often add refcounting to their structs.)

arghwhat··on What is Plan 9?
> The best apis are those that are hated by the developer and loved by the end users.

No, just those loved by the API consumer. Negative emotions on one end doens't do anything positive.

In the case of plan9, not everything can be described elegantly in the filesystem paradigm and a lot of things end up having really awkward "ctl" files which you write command strings to that the fileserver needs to parse. It also handicaps performance due to the number of filesystem operation roundtrips you usually end up making.

Maybe if combined with something io_uring-esque, but the complexity of that wouldn't be very plan9-esque.

arghwhat··on Is Rust faster than C?
> I don't often do this

You should have practiced better restraint then, as this was not a productive addition to the discussion.

My experience disagrees with your opinion and I see no value in engaging further.

arghwhat··on Is Rust faster than C?
I wouldn't consider implementing a B-tree in C any more "arduous" than implementing any other notable container/algorithm in C, nor would making a library be "brutal" as moving data really isn't an issue. Libraries are available if you need them.

Quite frankly, writing the same in Rust seems far, far more "arduous", and you'd only realistically be writing something using BTreeMap because someone else did the work for you.

However, being right there in std makes use much easier than searching around for an equivalent library to pull into your C codebase. That's the benefit.

arghwhat··on Is Rust faster than C?
Not really, especially as garbage collection doesn't achieve memory safety. Safety-wise, it only helps avoid UAF due to lifecycle errors.

Garbage collection is primarily just a way to handle non-trivial object lifecycles without manual effort. Parallelism happens to often bring non-trivial object lifecycles, but this is not a major problem in parallelism.

In plain C, the common pattern is trying to keep lifecycles trivial, and the moment this either doesn't make sense or isn't possible, you usually just add a reference count member:

    struct some_type {
        uint32_t refcnt;
        uint32_t otherfields;
    };

    struct some_type *some_type_ref(struct some_type *a) {
        a->refcnt++;
        return a;
    }

    void some_type_unref(struct some_type *a) {
        a->refcnt--;
        if (a->refcnt == 0) {
            free(a); // or some_type_destroy(a);
        }
    }
In both Go and C, all types used in concurrent code needs to be reviewed for thread-safety, and have appropriate serialization applied - in the C case, this just also includes the refcnt itself. And yes you could have UAF or leak if you don't call ref/unref correctly, but that' sunrelated to parallism - it's just everyday life in manual memory management land.

The issues with parallelism is the same in Go and C, that you might have invalid application states, whether due to missing serialization - e.g., forgetting to lock things appropriately or accidentally using types that are not thread safe at all - or due to business logic flaws (say, two threads both sleeping, waiting for the other one to trigger an event and wake it up).

arghwhat··on Claude Cowork exfiltrates files
> For years I thought they'd "damage" my system...

Well, would you argue that the office apps you installed from them didn't cause you damage, physically or emotionally?

arghwhat··on Is Rust faster than C?
To be honest, I think a lot of the justification here is just a difference in standard library and ease of use.

I wouldn't consider there to be any notable effort in making thread build on target platforms in C relative to normal effort levels in C, but it's objectively more work than `std::thread::spawn(move || { ... });`.

Despite benefits, I don't actually think the memory safety really plays a role in the usage rate of parallelism. Case in point, Go has no implicit memory safety with both races and atomicity issues being easy to make, and yet relies much heavier on concurrency (with a parallelism degree managed by the runtime) with much less consideration than Rust. After all, `go f()` is even easier.

(As a personal anecdote, I've probably run into more concurrency-related heisenbugs in Go than I ever did in C, with C heisenbugs more commonly being memory mismanagement in single-threaded code with complex object lifetimes/ownership structures...)

arghwhat··on U.S. Emissions Jumped in 2025 as Coal Power Rebounded
I think you should look that up. I was even being conservative: Korea and China seems to be managing consistently around the 6 year time scale, while Japan has done it in less than four years from construction start till operation.

Granted, the US would have to import professionals to do it at that speed, and politicians will of course try to hinder the process with endless bureaucracy as their sponsors would rather sell fossil fuels...

> If the company putting up the money goes bankrupt, what happens to the project?

If people didn't start such medium-length projects out of fear of hypothetical future bankruptcy, there would never have been any infrastructure projects. Investors do not worry about them going bankrupt, they worry about losing momentum and would generally rather light money on fire than stagnate. We live in a time where business people start space programs out of bloody boredom.

However, what happens in these cases is just that other investors flock the carcass and takes over for cheap, allowing them to reap the benefits without having to have footed the whole bill themselves. Bankruptcy is not closure for a company, but a restructuring often under new ownership.

The only realistic scenario where such project would be dropped is if the world situation changed enough such that it would no longer be considered profitable to complete, such as due to other technology massively leapfrogging it to the point where investing in that from scratch is better than continuing investment, or demand being entirely gone such that the finished plant would be unproductive. Otherwise the project would at most change hands until it was operational.

(Particular AI companies making it to 2030 is not really that important when it is electricity producers making these investments and running these projects to earn money from AI companies, EV charging, heatpumps, etc.)

arghwhat··on U.S. Emissions Jumped in 2025 as Coal Power Rebounded
Just to be pedantic: The median construction time is 7 years. With very slow planning, it is a decade, not decades. It can be done faster though.

Our power consumption won't be going down, and it generally wouldn't be the AI company itself running the project but the electricity companies that earn money supplying power that see dollar signs in all that extra electricity consumption.

Even if the AI companies all die, our global electricity consumption will keep going up margins will be better than the retired plants, so it's a good investment regardless.

arghwhat··on U.S. Emissions Jumped in 2025 as Coal Power Rebounded
What your are describing is purchasing certificates from renewable energy vendors, which while technically a small investment (more money to the renewable energy vendor → renewable business growth → more renewable energy projects) has very little to do with renewable energy projects like those I was talking about.

It is technically possible for the AI companies to decide to become self-sufficient or enter into the energy production market if things tilt far enough in favor of that, but it is somewhat unlikely and unexpected.

Big renewable projects are run by electricity producers, not consumers, and they are the ones being actively sabotaged in all sorts of ways.

arghwhat··on U.S. Emissions Jumped in 2025 as Coal Power Rebounded
It's not the power demand that is the problem.

It's that the majority of AI deployments are happening in a country which has a has had very poor renewable adoption and is now actively sabotaging renewable projects with an active opposition to climate goals because a particular group wants to protect their existing revenue.

Renewables are cheap and highly profitable, and money talks - even in the US, as can be seen in Texas. But it's hard to fight against your government when they want to force you to buy their rich friends' fossil fuels instead...

arghwhat··on Ozempic is changing the foods Americans buy
Foods, full stop, is easy to modify. More generally, a producer can arbitrary control any product composition according to their own goals.

Nothing to do with "processed foods" in general, despite a good portion of the affected foods being under that label. It's simply a matter of malicious companies combined with unknowing, unempowered consumers.

By trying to single out something as massively generic as "processed foods", you're just making it easy for companies to avoid the problem: Using and manipulating official definitions to be removed from it as a "solution", justifying the whole thing in the basis of numerous good things being in the same category, drawing attention to other foods in the same category that are more commonly associated with the term despite theirs being way worse, etc.

If you want to fix the problem, you need to attack the problem. That is not processing - it is addiction and glycemic value. Going for the underlying attributes means you cannot redefine your way out of it, and gives consumers a better chance to learn what to actually avoid.

arghwhat··on Ozempic is changing the foods Americans buy
I think it's a bit more popular outside the US than you make it out to be. As an anecdote, I know a handful of people on it in Denmark - and that's despite the local Danish price being higher than the German one and Denmark having notably lower obesity and diabetes rates than Germany.

I imagine you'll find that people of certain lifestyles tend to cluster together a bit, with those with more active lifestyles and healthy diets likely to have their friends and family be of active lifestyles and healthy diets, and in turn less likely to be in need of such drugs. Lifestyle changes are difficult to implement by nature.

Although, the term "processed food" is awful as it covers so many unrelated things. The problem is ultra-addictive, ultra-high glycemic index foods consumed in large amounts partly due to their addictive qualities - a quality some processed foods have.

For reference, Danish sausage sandwich toppings are highly processed foods, but it won't drive anyone to obesity or diabetes. Elevated blood pressure, perhaps. Junk takeaway, candy and sugary cereals on the other hand...

arghwhat··on Conbini Wars – Map of Japanese convenience store ratios
I can't help but giggle slightly at the effort put into presenting not just the term, but also both the japanese and japanese-romanized forms, considering that it's just an entirely literal translation of a basic business strategy. Reminds me of https://www.youtube.com/watch?v=YvNxgHTWIlo.
arghwhat··on Conbini Wars – Map of Japanese convenience store ratios
It's just a name, but those franschises would likely consider it a real fight for prime real estate and customer base, each aiming to overtake the others.
arghwhat··on Everyone hates OneDrive, Microsofts cloud app that steals and deletes files
You can absolutely be mad at a lawnmower that cut your foot off as there isn't any scenario where your feet should be at risk during normal operation of a regular lawnmower. Unless I intentionally try to insert my foot into the blades somehow, such dangerous faults would be entirely on the manufacturer.

Now if you proceed with he same horrible lawnmower and cut off your other foot, then that might be on you.

While the analogy is being stretched, same applies here - if Microsoft makes terrible footguns, then that's on Microsoft even if the users should have stopped using Microsoft by now.

arghwhat··on C Is Best (2025)
> You are being facetious. I mean, do you actually believe that the JVM exists in a context where Java does not exist? What does the J in JVM stand for?

Java runs on several things that are not the JVM. Android does not use JVM to run Java, and even Oracle is pushing something that is not the JVM.

At the same time, JVM runs many things that are not Java.

If you are somehow implying along the lines of JVM only got initially authored because Java, then that is nothing but a historical fact of little relevance from the early days of the language. If not even Oracle considers Java and JVM one thing - and by virtue of Graal they don't - then it simply isn't as such.

> This analysis is very superficial and fails to identify any of the real world arguments to switch from C

You misread - what you quoted was not an analysis of why the migrations happen. It was a parallel, underlining that migrations do happen in spite of obvious feature differences (and sometimes, because of such differences).

arghwhat··on C Is Best (2025)
JVM does not know about Java, it knows about an IR that Java, Kotlin, Scala, Closure, Groovy, etc. all target. Java as a language also doesn't know about JVM, as it commonly targets things that are not the JVM, whether that is Dalvik, Graal or something else entirely.

That the JVM and IR has features to help the Java compiler generate better output is obvious but not really relevant. Modern CPUs also have instructions to help C compiles generate better code, but that doesn't make them C platforms. It's just that implementation details.

So no, Java is not a platform. It is a language that sometimes runs on the JVM together with many other large and quite influential languages.

arghwhat··on C Is Best (2025)
I don't agree.

First of all, Java isn't a platform. Kotlin and Java are both just languages, and Kotlin has explicit interoperability with Java exactly to make it easy for Java devs to "upgrade".

The JVM is a common target for both Java and Kotlin, where the two are intentionally interoperable - from the Kotlin-side, by virtue of explicit annotation. Both languages have other targets through other compilers, e.g., Kotlin's native backend and GraalVM.

The widening gap is not at all moving Kotlin further away from Java developers, but is just increasing the reasons to migrate. It is crucially not making interoperability with existing, legacy Java harder, just giving you more toys. Stuff like suspend functions vs. virtual threads only affects decision making in new application code, and you can for all intents and purposes use either depending on whether you're writing new Kotlin libs for a legacy Java app or a Kotlin app using legacy Java libs.

The C → Rust migrations that happen a lot these days underline how differences in features isn't at all a problem (quite the opposite when there's new features), but that interoperability allowing partial work is by far the most important thing.

Plus, considering that Android apps were responsible for a very significant portion of actively developed Java (I would assume quite a loand has with Android having gone full Kotlin, a quite significant portion of Java developers will either already have migrated or soon be migrating to follow suit. This will over time affect a quite significant portion of the available skill pool for hiring, which will add additional pressure on enterprise.

There will always be Java, but I'd expect a significant portion of actively developed applications (as opposed to maintenance-mode only applications) to slowly migrate to either Kotlin or something else entirely.

arghwhat··on C Is Best (2025)
> People outside the project are allowed to say whatever the hell they want, the project doesn't have to listen.

Within reason - don't be a dick and all that. :)

arghwhat··on TurboDiffusion: 100–200× Acceleration for Video Diffusion Models
I feel like this misses the point. Also, vision and image generation are entirely different things. Even for humans, with some people not being able to create images in their head despite having perfectly good vision.

Understanding optics instead of intelligence speaks to the traditional render workflow, a pure simulation of input data with no "creative processes". Either the massive hack that is traditional game render pipelines, or proper light simulation. We'll probably eventually get to the point where we can have full-scene, real-time ray-tracing.

The AI image generation approach is the "intelligence" approach where you throw all optics, physics and render knowledge up in the air and let the model "paint" according to how it imagines the scene, like handing a pencil to a cartoon/anime artist. Zero simulation, zero physics, zero roles - just the imagination of a black box.

No light, physics or existing render pipeline tricks are relevant. If that's what you want, you're looking for entirely new tricks: Tricks to ensure object permanence, attention to detail (no variable finger counts), and inference performance. Even if we have it running in real-time, giving up your control and definition of consistency is part of the deal when you hand off the role of artist to the box.

If you want AI in the simulation approach you'll be taking an entirely different path, skipping any involvement in rendering/image creation and instead just letting the model pupetteer the scene within some physics restraints. Makes for cool games, but completely unrelated to the technology being discussed.

← PreviousPage 4 of 34Next →