News for hackers. Stuff that matters.
Re:Zig's Incremental Compilation Internals by steveklabnik on Tuesday July 28, 2026 @01:32PM (#49087230)
I'll say the same thing I said to you as I said to Andrew, last time he and I talked about this: the way that everyone talks about memory safety (with maybe two exceptions, one okay (go) and one I dislike (fil-c)) is that "memory safe language" is about there being a clear delineation between what is memory safe and what is not, and that the unsafe aspect is a superset. Rust and Java both are memory safe, except where explicitly demarcated as not (unsafe in Rust, JNI or sun.misc.unsafe or whatever in Java). Zig and C have no such separation. When I (and others) talk about wanting memory safety, this is the important aspect of the design. This is what enables the "I know statically that a large part of the code is safe, and I also know where to check if something goes wrong" aspect of things.
Re:Zig's Incremental Compilation Internals by dnautics on Tuesday July 28, 2026 @04:09PM (#49089243)
zig creates an ir that you can use to do data dependency analysis and borrow checking.
Re:Zig's Incremental Compilation Internals by steveklabnik on Tuesday July 28, 2026 @04:13PM (#49089303)
Yes, it is absolutely possible to build a language that uses Zig's compilation model and do borrow checking. Zig is not going to add a borrow checker though, so as a user, it's sort of a moot point.
Re:Zig's Incremental Compilation Internals by dnautics on Tuesday July 28, 2026 @04:25PM (#49089474)
no. let me be clearer; it is possible to intercept zigs ir from the compiler NOW (well, 15.2 proven) and have a third party package do borrow checking from the data that flow through, without changing zig (think "how miri works without changing rust"). this is not currently directly possible without changing the compiler (~ 50 loc), however the core team has indicated that exporting ir, the only change needed, will be a supported feature once the language stabilizes.
Re:Zig's Incremental Compilation Internals by steveklabnik on Tuesday July 28, 2026 @04:29PM (#49089508)
How do you get the information to check properly without lifetimes in the signature?
Re:Zig's Incremental Compilation Internals by dnautics on Tuesday July 28, 2026 @04:33PM (#49089550)
lifetimes are not the only way to check safety. you just need to detect conflicts in the data dependency graph, lifetimes are in some way an overspecification (for safety, there are autoaliasing advantages). i suspect agnostic conflict detection is probably more expensive, too, but 1) borrow checking was not the slow step in rust compilation and 2) maybe you dont have to check for memory safety on every compile. on commit or on ci is probably fine
Re:Zig's Incremental Compilation Internals by steveklabnik on Tuesday July 28, 2026 @04:44PM (#49089681)
Gotcha! Well this sounds like a cool project, I look forward to seeing how it turns out.
Re:Zig's Incremental Compilation Internals by dnautics on Tuesday July 28, 2026 @04:46PM (#49089697)
Re:Zig's Incremental Compilation Internals by steveklabnik on Tuesday July 28, 2026 @04:55PM (#49089782)
Starred!
Re:Zig's Incremental Compilation Internals by n0blenote on Tuesday July 28, 2026 @06:15PM (#49090693)
I’m incredibly excited for this and have been looking forward to it for a while - I think new moves in IR will solve many issues with have with dynamic analysis of memory safety. The decompilation into other representations like Binary Ninjas IR have been a godsend to actually seeing what the hell Rust and Objective C do on the backend and understand actual cost the compiler makes to create memory fences.
Re:Zig's Incremental Compilation Internals by mi_lk on Tuesday July 28, 2026 @01:44PM (#49087403)
Would you mind sharing some thoughts about fil-c? AFAICT its claims mostly check out so besides implementation details (GC?) it seems directionally good.
Re:Zig's Incremental Compilation Internals by steveklabnik on Tuesday July 28, 2026 @01:47PM (#49087441)
I'll come back and say some more in a bit, but in short: I like the idea of fil-c, but I also have some issues. I think it's overall a good and interesting project, but with some caveats.
Re:Zig's Incremental Compilation Internals by norman784 on Tuesday July 28, 2026 @01:54PM (#49087541)
Not OP, but AFAIK one big issue with FIL-C it does the checks at runtime, adding overhead, don't quote me on this, but IIRC is around 20% slower.
Re:Zig's Incremental Compilation Internals by josephg on Tuesday July 28, 2026 @06:30PM (#49090860)
2x slower and 4x less memory efficient were the numbers I heard a year or so ago. Reaching within 20% of full native performance while using a garbage collector sounds too good to be true.

Do you have any actual benchmarks?

Re:Zig's Incremental Compilation Internals by pron on Thursday July 30, 2026 @08:14PM (#49117542)
> Reaching within 20% of full native performance while using a garbage collector sounds too good to be true.

What does a garbage collector (in principle) have to do with this? Modern moving collectors (of the kind Java uses, but not the kind Go or Python use) are faster, not slower, than malloc/free, but they do have a higher footprint. That's the point of that algorithm: to reduce the speed overhead of malloc/free and add footprint.

Re:Zig's Incremental Compilation Internals by steveklabnik on Tuesday July 28, 2026 @02:28PM (#49087952)
Okay so: in general, as a rule of thumb: anything that makes stuff have more memory safety is good. And experiments towards that end are also good.

What I do not like, primarily comes down to how the project is talked about and marketed. First, because it promotes an "us vs them" mindset, instead of a "we're all trying to improve memory safety" mindset, and second, because in doing so, it also overstates its case.

These things are sort of intertwined. Let's talk about the overstatement first. Fil-c has its own definition of memory safety that is slightly different than others. For example, I saw this recently:

    #include <stdlib.h>
    #include <stdio.h>
    #include <string.h>
    
    struct User {
        char name[8];
        int is_root;
    };
    
    int main(int argc, char*argv[]) {
        struct User* user = malloc(sizeof(struct User));
        strcpy(user->name, argv[1]);
        if (user->is_root) {
            printf("I am root!\n");
        } else {
            printf("I am not root :(\n");
        }
        return 0;
    }
This, when invoked with "012345678" passed in, will print "I am root!". In my understanding, this is deliberately allowed.

But beyond corners like this, fil-c's author will go on about "Rust has unsafe as a hatch, fil-c does not" while if you control-f for "zunsafe_" on https://fil-c.org/stdfil you get ... escape hatches.

The author regularly erases the difference between "traps at runtime" and "is prevented at compile time", which are legitimate tradeoffs where one or the other may be better depending on what you're doing. But they're presented as either equivalent, or one is superior, and I find this muddles the discourse. The performance issues also tie into this, "add a GC" is absolutely a valid way to handle these sorts of issues, but it is not the same thing as what Rust does. And that's okay! But presenting it as purely superior means that it's just hard to talk about.

Speaking of muddling the discourse, the author regularly trolls on X, providing tons of bad faith arguments and generally trying to rile up a "fil-c vs Rust" war that I think reduces our ability to talk about these differences in a calm, engineering focused context.

Finally, due to its design, fil-c is effectively Linux only. That's great for Linux, but many people also use other systems, and so it is not a meaningful option for them.

Anyway, after saying all that: I still think that it is a good project, and that it should exist and continue to be worked on. I just wish that the heat was turned down, and people could talk about the various approaches and their tradeoffs without turning it into a culture war.

Re:Zig's Incremental Compilation Internals by mirashii on Tuesday July 28, 2026 @04:17PM (#49089357)
I generally agree with all of this, but I'll add a few additional remarks. Because it's come up a bunch lately, I decided to do a bunch of code review/audit of the Fil-C codebase, and I'd say while it's got a lot of good bones, there's a long way to go to being a foundation I'd be ready to build on. I've reported a few UAF's upstream, and I've got a few PRs I'll add on, but if it only took me a day or two to find some of these big holes, I'm sure there's more lurking under the surface. I'd consider it to at this point be more of an engineering demo that this approach is feasible and tractable, but not a production ready language that I'd want to ship code in.

On the muddling the discourse, I'm not on twitter and don't engage there, so I don't have an opinion on that, but I did come across https://news.ycombinator.com/item?id=49044561 recently, and I just don't see how the author can make such bold claims while examples like the one Steve provided above are still in the language. Corrupting memory in Fil-C is still easy, type confusion is still easy, intra-object overflows are still easy. Fil-C prevents a range of classes of bugs from being exploitable, but it doesn't stop the bugs from happening.

Re:Zig's Incremental Compilation Internals by josephg on Tuesday July 28, 2026 @06:36PM (#49090914)
Yeah. In that thread the Fil-C author said of typescript, go and C#:

> Those languages rely on a much larger pile of YOLO C/C++ code for their runtimes and standard libraries than Fil-C does. So Fil-C is safer than those

Given the relative immaturity of Fil-C, this seems wildly wrong to me. I’m not sure how to take his claims about his runtime seriously.

[ https://news.ycombinator.com/item?id=49042736 ]

Re:Zig's Incremental Compilation Internals by pizlonator on Wednesday July 29, 2026 @09:30AM (#49097275)
This is a simple fact. The Fil-C runtime is tiny compared to TS and C#
Re:Zig's Incremental Compilation Internals by mirashii on Wednesday July 29, 2026 @12:59PM (#49100041)
> The Fil-C runtime is tiny compared to TS and C#

Sure, this is a simple fact.

> So Fil-C is safer than those

This is not a simple fact that follows, and a good example of why you seem to be catching so much criticism for overly bold claims. One could state that a smaller runtime is easier to audit, and so the investment needed to reach similar levels of safety is lower. One might even argue that after similar levels of investment, that the probability that it's safer is higher. But jumping all the way from lower number of lines => safer is a simple fact is a huge leap.

Re:Zig's Incremental Compilation Internals by pizlonator on Wednesday July 29, 2026 @01:28PM (#49100446)
I have worked on both a major JS runtime and a .NET runtime. I have fixed hundreds of security bugs in JSC. Based on that, I have no doubt that what Fil-C does is safer. Just the absence of a JIT makes it safer in a way that I don’t think is seriously debatable. Even with JIT disabled, a JS runtime has massive attack surface due to the language relying on a large native library to do anything useful, not to mention a mind boggling amount of language implementation corner cases.

By contrast Fil-C has a small number of rules and largely obviates the need for “native” code.

Re:Zig's Incremental Compilation Internals by pizlonator on Wednesday July 29, 2026 @09:29AM (#49097258)
First of all, it’s incredible that on a HN thread about a language that isn’t C, there are 46 mentions of Fil-C! You guys are obsessed!

I make bold claims because they hold water.

- You can at worst corrupt only the capability you’re pointing to.

- intra object overflows are almost never useful for memory corruption exploits unless they let you corrupt a pointer, and Fil-C prevents that from being useful because you cannot corrupt the capability.

- the zunsafe api is basically unused. One library uses it (OpenSSL) for good reasons. This is in contrast to widespread use of the unsafe keyword in Rust, beyond just one library for a narrow purpose.

Thanks for reporting bugs. Worth noting that they require doing things that extant C code never does. It’s good to fix those, but the true threat model of any memory safe language is not to sandbox a malicious programmer, but to protect the program of a normal programmer against a malicious user

Re:Zig's Incremental Compilation Internals by orf on Monday August 03, 2026 @04:58PM (#49161349)
> the zunsafe api is basically unused. One library uses it (OpenSSL) for good reasons

Wait, so there are escape hatches? But… you’ve repeatedly said, many times, that there are zero escape hatches?

And now here you’re saying not only that there only are escape hatches, but there’s a good reason to use them?

Damn. Misrepresenting `unsafe{}` whilst saying your language is better because there are no escape hatches and no need for escape hatches is like… 80% of your online personality.

When can we expect the website to be updated to remove the misleading claims?

Re:Zig's Incremental Compilation Internals by pizlonator on Monday August 03, 2026 @09:36PM (#49163457)
From the second paragraph of fil-c.org:

"Fil-C has no unsafe statement and only limited FFI to unsafe code."

`zunsafe_call` is a weird thing to get hung up on as an "escape hatch", considering it's just a super limited form of FFI, intentionally designed so that it's only usable for OpenSSL's use case.

> Misrepresenting `unsafe{}`

`unsafe` lets you write Rust code that violates any reasonable definition of memory safety (including Rust's definition or my definition), and it's widely used.

Re:Zig's Incremental Compilation Internals by orf on Tuesday August 04, 2026 @03:02AM (#49165178)
> Unlike other approaches to increasing the safety of C, Fil-C achieves complete memory safety with zero escape hatches.

Except there is an escape hatch, by your own admission above?

> `zunsafe_call` is a weird thing to get hung up on as an "escape hatch"

from the docs:

> unsigned long zunsafe_call(const char* symbol_name, ...);

> Performs an unsafe call to Yolo-land.

That’s just a `unsafe{ func(…) }` escape hatch

> intentionally designed so that it's only usable for OpenSSL's use case.

Cool motive, still an escape-hatch =)

Do you have the backbone to update the fil-c website to correct the record, and let the person you retweeted here[1] know that the escape hatch row is incorrect?

Or… is what everyone says about you here true?

1. https://x.com/filpizlo/status/2081765923757903940

Re:Zig's Incremental Compilation Internals by pron on Tuesday July 28, 2026 @02:33PM (#49088033)
> it promotes an "us vs them" mindset, instead of a "we're all trying to improve memory safety" mindset

But you did the same thing when, on the spectrum that ranges from C to ATS, with Zig, Rust, and Java somewhere in the middle (though all closer to C than to ATS), you declared the exact compromise that Rust makes "table stakes"! [1]

Zig improves on C's memory safety when it comes to spatial safety, possibly the more impactful kind, so it, too, could be part of the "we're all trying to improve memory safety", yet you exclude it.

You're trying to draw some hard line that passes exactly between Rust and Zig on the C to ATS spectrum, and I'm trying to say that that line isn't there (your attempt at a definition of delineating safe and unsafe code also applies to C). Obviously, C, Zig, Rust, Java, and ATS all make very different tradeoffs, all of which may be more or less attractive to different people and in different circumstances, but there is no sharp line, at least not one that is meaningful enough to be "table stakes". Your personal inclinations place a premium on the things Rust offers and Zig doesn't while mine are the opposite, but I make no claim to universality.

I'm happy to accept that not everyone shares my aesthetics and can understand why some people prefer Rust, but those claims to or hints at universality annoy me (as they did when they were made by Haskellers, and I actually find Haskell's aesthetics quite pleasing), as they are simply unsupported. I've spent a lot of time studying formal methods and software correctness in general (https://pron.github.io) and if there's one thing we know in that field is that things are never that simple (and, bringing this back to this posts topic, even something like incremental compilation can contribute to program correctness).

(Now, you may argue that you're only talking about "memory safety" and not correctness in general, but what gives memory safety value is that violations are causes of many dangerous vulnerabilities; but once, say, Java eliminates all of them, 100% of bugs/vulnerability - which are still numerous - will be caused by other problems, all potentially avoidable with ATS, so why isn't ATS table stakes? Of course, the answer is cost, but all the languages on the spectrum differ in their costs.)

[1]: I assume that you meant Rust's compromise, because you implied that Zig doesn't pass that bar but Rust does.

Re:Zig's Incremental Compilation Internals by steveklabnik on Tuesday July 28, 2026 @02:46PM (#49088193)
> But you did the same thing when,

I do not go around posting "omg Rust is SO MUCH BETTER than zig or fil-c, which are TRASH." I talk about engineering tradeoffs, and what matters to me personally. I do not say "if you use Zig, you are a bad person." I am not saying that any comparison is bad. I am saying that the way that the comparison is presented is bad. That is different.

> you declared the exact compromise that Rust makes "table stakes"

Table stakes for me.

> Zig improves on C's memory safety when it comes to spatial safety,

I agree that it's an improvement on C!

> yet you excluded it.

I said that it is not pursuing a design that I personally find compelling enough to use to write software. That doesn't mean that I think it's worthless. This whole thing started off with me talking about how much I respect the Zig project! Yet you're trying to turn this into something where I'm talking shit. I presented a specific technical tradeoff that is important to me. That is very different.

> You're trying to draw some hard line on a spectrum that passes exactly between Rust and Zig, and I'm trying to say that that line isn't there (your attempt at a definition of delineating safe and unsafe code also applies to C)

I don't believe you've shown that. And my "attempt" does apply to C: it fails the bar, because it does not delineate between a safe subset and an unsafe superset.

> you may argue that you're only talking about "memory safety" and not correctness in general,

I am in fact talking about "memory safety" and have been this whole time, yes.

> what gives memory safety value is that violations are causes of many dangerous vulnerabilities; but once, say, Java eliminates all of them, 100% of bugs/vulnerability - which are still numerous - will be caused by other problems, all potentially avoidable with ATS, so why isn't ATS table stakes?

This is just an entirely different question. Yes, there are other forms of safety that are important too. That's just not what we're talking about here.

Re:Zig's Incremental Compilation Internals by pron on Tuesday July 28, 2026 @03:04PM (#49088422)
> Table stakes for me.

Ok, so if you meant "table stakes" as an expression of a personal preference and suitability to the programs you write without making an unsupported universal claim such as "this leads to better correctness" or "the price is almost always worth it" then we're good :)

> Yes, there are other forms of safety that are important too.

The thing is that they can be at least equally important, and some affordances for memory safety could potentially _harm_ them. To me, Rust offers little safety in the programs I want to write in a low-level language, but the price it charges in language complexity and implicitness ends up in a negative balance (I can't prove it, of course; as I said, software correctness is very complicated, and some of the greatest researchers in the field were proven wrong on how to best achieve it).

Re:Zig's Incremental Compilation Internals by eaurouge on Wednesday July 29, 2026 @03:39AM (#49094486)
> I do not go around posting "omg Rust is SO MUCH BETTER than zig or fil-c, which are TRASH."

> While I still don't plan to write software in it, given that I believe memory safety is table stakes

What exactly am I missing? You know you don't have to hijack Zig threads (repeatedly) with your thoughts on memory safety, right?

Re:Zig's Incremental Compilation Internals by steveklabnik on Wednesday July 29, 2026 @11:59AM (#49099214)
> What exactly am I missing?

My point in bringing this up is to strengthen my compliment. Even though I disagree with aspects of Zig's design, the stuff talked about in this post is excellent.

Re:Zig's Incremental Compilation Internals by mbrock on Wednesday July 29, 2026 @07:00AM (#49095826)
> I do not go around posting "omg Rust is SO MUCH BETTER than zig or fil-c, which are TRASH." I talk about engineering tradeoffs, and what matters to me personally. I do not say "if you use Zig, you are a bad person." I am not saying that any comparison is bad. I am saying that the way that the comparison is presented is bad. That is different.

Oh, who is saying things like that? Do you mean to imply that this kind of vitriol is characteristic of the Fil-C project?

Re:Zig's Incremental Compilation Internals by steveklabnik on Wednesday July 29, 2026 @11:59AM (#49099206)
Yes, this kind of rhetoric comes out of the project itself and its supporters, regularly.
Re:Zig's Incremental Compilation Internals by mbrock on Wednesday July 29, 2026 @12:11PM (#49099382)
Not really. I mean if you want to make that claim, use actual quotes.
Re:Zig's Incremental Compilation Internals by hexane360 on Wednesday July 29, 2026 @05:10PM (#49103131)
https://codeberg.org/ziglang/zig/issues/36237

>introduce an actually memory safe (unlike borrow checking) compilation mode inspired by Fil-C

Re:Zig's Incremental Compilation Internals by pizlonator on Wednesday July 29, 2026 @09:32AM (#49097296)
Steve, be reasonable.

I never said Fil-C is “so much better” (let alone with all caps) than anything.

I never called Rust “trash”.

I think you’re taking this all too personally

Re:Zig's Incremental Compilation Internals by steveklabnik on Wednesday July 29, 2026 @11:58AM (#49099202)
I will let others be the judge by reading what you've written.
Re:Zig's Incremental Compilation Internals by iczero on Wednesday July 29, 2026 @05:18PM (#49103222)
https://news.ycombinator.com/item?id=49097320

You think this is reasonable? I have also seen strange people on twitter support Fil-C while claiming that Rust is a language for [slur]s. I suppose by your "reasoning" that these people directly represent you and your project?

Re:Zig's Incremental Compilation Internals by Maxatar on Tuesday July 28, 2026 @02:41PM (#49088151)
There's a distinction between claiming something is objectively better, which is what Fil-C claims with respect to its "idea" about memory safety compared to Rust... and claiming a personal preference for one approach versus another approach, which is what OP is saying about their own personal preference about how Zig reduces errors compared to how Rust reduces errors.

It is absolutely possible that one language might actually have an objectively better approach to memory safety than another, and in such cases it is usually possible to argue for this using sound technical or empirical arguments. But the way the author of Fil-C presents their arguments it often comes across in a kind of antagonistic manner, like he has a chip on his shoulder.

Re:Zig's Incremental Compilation Internals by pron on Tuesday July 28, 2026 @03:05PM (#49088448)
> But the way the author of Fil-C presents their arguments it often comes across in a kind of antagonistic manner, like he has a chip on his shoulder.

You may well be right. I've yet to learn about it, but I'm planning to.

Re:Zig's Incremental Compilation Internals by pizlonator on Wednesday July 29, 2026 @09:59AM (#49097642)
I never claimed that Fil-C is objectively better than Rust.

As a long time PL researcher, I can, should, and will point out interesting corner cases of languages. Including in Fil-C or Rust

Re:Zig's Incremental Compilation Internals by iczero on Wednesday July 29, 2026 @05:56PM (#49103605)
Here is someone providing real criticism of Rust: https://news.ycombinator.com/item?id=49101733

Here is you claiming "Facts" on a troll post claiming to "criticize" Rust: https://x.com/filpizlo/status/2081765923757903940

Re:Zig's Incremental Compilation Internals by jibal on Tuesday July 28, 2026 @07:53PM (#49091591)
> But you did the same thing

So your defense is a tu quoque fallacy? Note that "the same thing" is an admission.

Re:Zig's Incremental Compilation Internals by brabel on Tuesday July 28, 2026 @02:54PM (#49088294)
I’ve been watching this debate online and in my opinion both sides are guilty. Fil is intentionally trying to be funny or at least “interesting “ when he makes his points and I, for one, enjoy his humor, which includes having a go at Rust and other languages. It seems Rust people just can’t take a little criticism, even when it comes from a clearly trolling language! Yes it’s true Rust has an escape hatch, and we’ve seen serious memory safety bugs due to unsafe Rust in the wild. Fil-C does not have one, what you post seems to be internal or even temporary stuff given the author clearly has a goal of not providing one? I would say you and others need to just relax and not treat all and every Rust criticism as an offense to you.
Re:Zig's Incremental Compilation Internals by steveklabnik on Tuesday July 28, 2026 @03:45PM (#49088932)
Maybe I'm just old, but I want to focus on engineering outcomes, not "trolling." If that means "can't take a joke," that's fine, but also "haha I'm just joking" is often what people use to try and hide behind their actual intentions.

I don't even work on Rust anymore, and in fact started this thread with a criticism of Rust. There are lots of good criticisms of Rust. There is a difference between "this criticism isn't good" and "every criticism is an offense."

Re:Zig's Incremental Compilation Internals by pizlonator on Wednesday July 29, 2026 @10:04AM (#49097704)
I don’t troll.

I just post facts. It is interesting that Rust is marketed as memory safe and yet has some large holes and that use of `unsafe` is quite widespread. That’s worth having a grown up discussion about.

Maybe you don’t like that this was pointed out so you felt trolled. But then that’s on you.

Re:Zig's Incremental Compilation Internals by ModernMech on Wednesday July 29, 2026 @10:44AM (#49098206)
Re:Zig's Incremental Compilation Internals by pizlonator on Wednesday July 29, 2026 @10:53AM (#49098343)
Saying something that you don’t believe isn’t trolling.
Re:Zig's Incremental Compilation Internals by ModernMech on Wednesday July 29, 2026 @10:54AM (#49098358)
You said "I just post facts". It is not a fact that the Rust community is lobbying to make programming in C illegal. Do you understand why some people in that community might consider that trolling?
Re:Zig's Incremental Compilation Internals by chaz72 on Tuesday July 28, 2026 @03:19PM (#49088624)
Yes! I think Fil is great so far but I think as he gets a bigger audience he should, well, consider that and focus on clarity a little more than humor. You can see Andrew’s growth in that respect.

Rust folks, this whole thing is a thread about Zig’s new feature - not even a memory safety-related feature! - and we cannot spend the whole damn time talking about Rust.

Steve, even you - I don’t believe I have ever seen you say an unkind word. But have you considered that it may be unkind to have written more than half of the words on a thread about a Zig performance feature?

Re:Zig's Incremental Compilation Internals by steveklabnik on Tuesday July 28, 2026 @03:42PM (#49088899)
> But have you considered that it may be unkind to have written more than half of the words on a thread about a Zig performance feature?

Inherently? No! I commented specifically because I was really glad to see this post. This work that Zig is doing is very good, and I wanted to call that out, in part specifically because I am on "the other side" in whatever sense that is. Why would it be unkind for kind words to be coming from me?

Re:Zig's Incremental Compilation Internals by chaz72 on Tuesday July 28, 2026 @03:52PM (#49089020)
I do see that you often have kind words for Zig and some attempt to more precisely define the differences.

What I mean is a bit different though, it’s that these arguments you get drawn into end up drowning out any real discussion of Zig’s progress. I don’t think that’s your intent but it is frustrating. I should be clear, I don’t think it’s wrong for you to defend yourself from accusations etc., I just wish it didn’t look like this.

I wonder how much better HN would be if they took a page from other forum systems that said “you know what, this whole branch of stuff should be moved over here and renamed so the original topic can move on”.

Sorry, all this may be unhelpful, I don’t know where the line should be, I’m just thinking out loud about the problem.

Re:Zig's Incremental Compilation Internals by steveklabnik on Tuesday July 28, 2026 @03:57PM (#49089089)
Ah, I see what you're saying. Oh, trust me, it's very frustrating for me as well. It is especially frustrating in these specific circumstances because I know that Ron and I will not come to an agreement, so...
Re:Zig's Incremental Compilation Internals by NobodyNada on Tuesday July 28, 2026 @10:00PM (#49092590)
I think the derailment of this thread into "is Rust's memory safety good or not" is unfortunate and tedious (this debate must have happened hundreds of times by now on this site alone), but I also think it's unfair to lay the blame on Steve for this. Steve left a thoroughly glowing comment praising Zig's work on compiler performance, and comparing to his perspective on the early days of Rust. He mentioned in passing that he's not a Zig user due to preferring to work in memory-safe languages, which was polite, brief, clearly his personal position, and in my opinion an acceptable way to disclose his relationship with Zig without derailing the thread to be about memory safety.

This comment spawned two subthreads. One of them was focused on the differences between Rust and Zig's compilation model, which is directly relevant to the article and illuminating regarding the engineering tradeoffs.

In the other subthread, pron posted paragraphs and paragraphs arguing about what memory safety really means and whether or not Steve is right to have his opinion that Rust is "safe". This tangent had essentially nothing to do with the content of Steve's comment; it (and not Steve's initial comment) was the point where the thread was derailed from the topic of Zig's incremental compilation model. Steve responded politely in this thread to comments and questions directed at him, but did not fan the flames or take the thread further into off-topicness. If the moderators collapsed pron's comment or detached it and pinned it to the bottom of the page, this comment thread would be much better and much more respectful to the Zig project.

I think the RESF trope is just about dead now; it's given way to the Rust Detractor Strike Force showing up to turn unrelated threads into tangential arguments about why Rust is bad.

Re:Zig's Incremental Compilation Internals by imtringued on Wednesday July 29, 2026 @06:07AM (#49095415)
>Steve, even you - I don’t believe I have ever seen you say an unkind word. But have you considered that it may be unkind to have written more than half of the words on a thread about a Zig performance feature?

You're accusing steve of what pron is doing... I mean look at how much text pron wrote, it is much more than steve wrote, and how pron is constantly skirting the edges of the HN guidelines.

Re:Zig's Incremental Compilation Internals by chaz72 on Wednesday July 29, 2026 @04:35PM (#49102725)
My reasoning, which you may not agree with, is that I think that I have seen pron say unkind words before and I thought I had a better chance of persuading Steve to let it go. (Sorry pron, that’s how I was thinking of it. No, I have no specific examples.)

The fact is that every thread about Zig is filled with this kind of battle, and I’m tired of it, and it doesn’t represent any community, it’s so much worse on HN than anywhere else, and it’s all just defensiveness and crap.

Re:Zig's Incremental Compilation Internals by steveklabnik on Thursday July 30, 2026 @12:22AM (#49106101)
I should let things go more often, it's a personal problem :) Thanks for the nudge, I'll consider it in the future.
Re:Zig's Incremental Compilation Internals by tstack on Thursday July 30, 2026 @01:47AM (#49106459)
Let the healing begin!
Re:Zig's Incremental Compilation Internals by slopinthebag on Tuesday July 28, 2026 @03:34PM (#49088805)
> It seems Rust people just can’t take a little criticism, even when it comes from a clearly trolling language

I think this is a case of people who can dish it out but can't take it. As far as I'm concerned if you troll someone you should expect to get trolled back.

Re:Zig's Incremental Compilation Internals by ethin on Tuesday July 28, 2026 @05:16PM (#49090008)
Might get downvoted but was thinking this exact thing when reading this debate. Rustations have this very bad habit (IMO) of pushing the "my language is better than yours" to an extreme that I haven't seen elsewhere (but I don't frequent a huge number of language circles so...). Yet when it is done to them they get all upset about it.
Re:Zig's Incremental Compilation Internals by josephg on Tuesday July 28, 2026 @07:13PM (#49091265)
> Rustations have this very bad habit (IMO) of pushing the "my language is better than yours" to an extreme

It’s funny, I’ve heard people claim this about rust developers for years. But I’ve seen very little evidence of it. Where are all these toxic comments? Look at Klabnik’s comments in this thread. He’s lovely.

—-

A son comes home to his poverty stricken family with a spring in his step. “Mum! Dad! All that time at community college paid off! I got a job!”. Dad immediately snaps - “so what, now you have a job, you think you’re better than us?”

What happened? Dad is unconsciously projecting a belief onto his son. Something like “unemployed people are shameful”. Then dad feels judged by the projected belief and he attacks the son for it. But it wasn’t the son’s belief in the first place. He just wanted his parents to be proud.

How does the son respond? It’s a tricky one. If the son defends himself by talking up how great it is to have a job, he reinforces the projection and dad will get more angry. If he says “there’s nothing to be proud of for having a job” then he’s lying about his values. It’s a trap.

When I’m feeling uncharitable, I project this same dynamic onto rust and C/C++ devs. “Mom! Dad! I figured out a way to get memory safety without sacrificing native execution and performance!” C: “So you think your language is better than ours? Why are you so toxic about it?”

I’m not really sure how to respond to comments like yours. I think you’re mad at ghosts.

[dead]
Re:Zig's Incremental Compilation Internals by KingMob on Wednesday July 29, 2026 @02:19AM (#49093990)
Neither of those links involves Klabnik.

And the second one (about swatting a linux dev) says "Others think someone from the Rust (programming language, not video game) development community was responsible due to how critical René has been of that project, but those claims are entirely unsubstantiated."

--

Also wild to complain about botting when I've seen half a dozen accounts that didn't exist an hour ago all pop up to criticize Klabnik.

Re:Zig's Incremental Compilation Internals by peterfirefly on Wednesday July 29, 2026 @05:25AM (#49095133)
And the first one is about Christoph Hellwig who has a long history of being awful to communicate with. He should have been kicked out of the Linux community two decades ago for that reason alone. For some reason, he has decided that he doesn't like Rust and he does what he can to keep it far, far away from any code he has anything to do with. If that requires 10x more work for others, that is a price he is willing to pay.
Re:Zig's Incremental Compilation Internals by pizlonator on Wednesday July 29, 2026 @10:05AM (#49097734)
This thread is evidence of it.

The OP is about Zig and now there are 40+ mentions of Fil-C initiated mostly by Rust folks and those comments are largely criticizing me personally.

That’s toxic AF!

Re:Zig's Incremental Compilation Internals by mustache_kimono on Wednesday July 29, 2026 @01:06PM (#49100146)
Please.

Troll gets criticized. Cry me a river.

Re:Zig's Incremental Compilation Internals by iczero on Wednesday July 29, 2026 @05:34PM (#49103372)
Exactly what is your definition of "initiated mostly by" and why do you promote it as objective? It sure seems to me that Rust detractors see the word "Rust" and immediately spawn a flame war. You, of course, also seem awfully happy every time it happens.
Re:Zig's Incremental Compilation Internals by slopinthebag on Tuesday July 28, 2026 @06:21PM (#49090767)
It's funny because my comment was intended the other way, i.e. the Zig community & core team is antagonistic towards Rust so they shouldn't be surprised when they get pushback, like in this thread. But it really does go both ways when you look at how the Rust community has acted historically.

But hey, nerd holy wars have existed since the internet began. I use vim btw...oh you use emacs? You're an idiot. Etc etc.

Re:Zig's Incremental Compilation Internals by imtringued on Wednesday July 29, 2026 @05:37AM (#49095207)
I'm not sure this is even about Zig or Rust. I'm honestly getting the feeling that the actual problem is that pron is turning into a troll and it's because he has a history of working on the JVM and he sees everything from the lens of writing language runtimes that ignore the Rust memory model altogether and the troll part is that he is not saying out loud what his niche is.

When he brought up the universality claim, he came up with a niche counter example that he kept inside his head and he makes it out to be the general rule by being extremely vague about literally everything.

Re:Zig's Incremental Compilation Internals by eaurouge on Wednesday July 29, 2026 @03:34AM (#49094455)
> What I do not like, primarily comes down to how the project is talked about and marketed. First, because it promotes an "us vs them" mindset, instead of a "we're all trying to improve memory safety" mindset, and second, because in doing so, it also overstates its case.

Kinda rich of you to knock another language for its "marketing" when here you are once again on a Zig thread marketing Rust as a memory safe language. And speaking of "us vs them" mindsets, guess which language that reminds me of?

Re:Zig's Incremental Compilation Internals by mbrock on Wednesday July 29, 2026 @07:12AM (#49095916)
There is an unsafe call primitive in stdfil that was used to support constant time crypto functions when Fil-C didn't have support for inline assembly.

Fil-C now has support for inline assembly, so it's not needed anymore, and I believe indeed the intention is to remove it, since Fil-C is not supposed to have any unsafe hatches.

Fil-C is not Linux only by design, that's completely false.

By the way, if you don't want a culture war, you gotta stop warring.

Re:Zig's Incremental Compilation Internals by ModernMech on Wednesday July 29, 2026 @09:39AM (#49097388)
Can I install Fil-C on Windows without WSL or Cygwin?
Re:Zig's Incremental Compilation Internals by MatejKafka on Wednesday July 29, 2026 @11:34AM (#49098859)
> By the way, if you don't want a culture war, you gotta stop warring.

I find it hard to understand how could steveklabnik's comment be seen as warring.

Re:Zig's Incremental Compilation Internals by steveklabnik on Wednesday July 29, 2026 @11:58AM (#49099194)
> Fil-C now has support for inline assembly, so it's not needed anymore, and I believe indeed the intention is to remove it, since Fil-C is not supposed to have any unsafe hatches.

See, this is nuance! Nuance is good! But you can't go around saying "fil-c has no escape hatches" when it has one, even if that one is planned on being removed.

> Fil-C is not Linux only by design, that's completely false.

Can you explain to me how it would work on other platforms? It currently does not, and I don't see how it can. Or at least, not without more "escape hatches."

Re:Zig's Incremental Compilation Internals by mbrock on Wednesday July 29, 2026 @12:13PM (#49099399)
It would work basically the way it works on Linux? What makes you think it's somehow fundamentally Linux-specific?
Re:Zig's Incremental Compilation Internals by steveklabnik on Wednesday July 29, 2026 @12:24PM (#49099558)
On non-Linux platforms, you must go through a system provided shared library rather than make syscalls directly. fil-c has its own ABI, and so it has its own libc that uses it. You cannot recompile those other systems's libc (or equivalent) with fil-c, therefore, the strategy used on Linux cannot work.

This is one reason why Rust has unsafe: you have to interact with inherently unsafe APIs in order to do anything meaningful with the operating system. fil-c needs an equivalent of some kind, and so isn't better or worse here, it's just the reality of how these systems work.

Re:Zig's Incremental Compilation Internals by landr0id on Wednesday July 29, 2026 @02:30PM (#49101229)
>you must go through a system provided shared library rather than make syscalls directly

Just to add to this, on Windows for example you're really only supposed to invoke syscalls via ntdll as the syscall table is not stable so their numbering changes over time. You cannot guarantee forward or backward compat if you do not use the library.

If you look at some of the syscalls in https://github.com/j00ru/windows-syscalls, you can see they clearly do change over time too.

Re:Zig's Incremental Compilation Internals by mbrock on Wednesday July 29, 2026 @07:47AM (#49096222)
Fil-C's understanding of memory safety is not "its own" idiosyncratic made up definition. Memory safety in the whole tradition that includes CHERI etc is defined in terms of objects and allocations. In C structs and arrays are not object boundaries. So CHERI will have the same semantics as Fil-C in your struct example, unless you enable a compatibility-breaking mode, which Fil-C could very plausibly acquire too, at the same cost of breaking semantic compatibility with the C/C++ semantics.
Re:Zig's Incremental Compilation Internals by steveklabnik on Wednesday July 29, 2026 @11:56AM (#49099155)
C absolutely has struct, array, and subobject boundaries. The example is already undefined behavior in C.
Re:Zig's Incremental Compilation Internals by mbrock on Wednesday July 29, 2026 @12:15PM (#49099425)
In the ISO standard, yeah, but that's not how C actually works.
Re:Zig's Incremental Compilation Internals by rkangel on Wednesday July 29, 2026 @07:50AM (#49096251)
> First, because it promotes an "us vs them" mindset

I was always intrigued by the maturity about how the Rust team approached this sort of thing. IIRC years ago you and I had a back and forth on me thinking it would be helpful to have a "Why Rust is better than C++" type page.

Seeing an alternative approach from Andrew Kelley in recent weeks has really hammered home the value of the approach the Rust team took in terms of community building.

Re:Zig's Incremental Compilation Internals by pizlonator on Wednesday July 29, 2026 @09:34AM (#49097320)
Is this a joke?

The Rust community is lobbying to make programming in C illegal

Re:Zig's Incremental Compilation Internals by surajrmal on Wednesday July 29, 2026 @11:19AM (#49098675)
I don't think there is anything wrong with increasing liability for writing preventable bugs. The floor should be raised as our tools improve and the negative outcomes of these bugs increase. Making c illegal is not a goal of anyone I know of.
Re:Zig's Incremental Compilation Internals by rkangel on Wednesday July 29, 2026 @10:43AM (#49098190)
Can you provide a citation to this fairly major claim?
Re:Zig's Incremental Compilation Internals by ModernMech on Wednesday July 29, 2026 @09:41AM (#49097413)
No one is lobbying to make programming in C illegal, let alone the Rust community.
Re:Zig's Incremental Compilation Internals by landr0id on Wednesday July 29, 2026 @02:46PM (#49101412)
Comments like these are why, even if Fil-C has cool technical accomplishments, I find it hard to speak positively about it. You unfortunately seem to forgo all nuance and push disingenuous arguments which fuel the cycle with similarly disingenuous people.

I'll do you a favor though and cite a few things related to "lobbying"

The White House put out an RFI regarding open-source security: https://bidenwhitehouse.archives.gov/wp-content/uploads/2024...

Rust foundation's response: https://www.regulations.gov/comment/ONCD-2023-0002-0045

Neither have anything to do with making "programming in C illegal".

Re:Zig's Incremental Compilation Internals by josephg on Tuesday July 28, 2026 @08:55PM (#49092085)
My main problem with Fil-C is that it combines the worst parts of C with the worst parts of a GC language.

In a language like C (or Zig), you need to manually manage memory. This makes programming a lot more complex, and it's really easy to accidentally mess up. Especially in large projects which have a lot of separate modules.

The biggest advantage of using a garbage collector is that you don't have to think about freeing memory. The GC automatically frees objects when they're no longer referenced. This makes programming much much easier. The downside of using a garbage collector is that it hurts performance at runtime. GC languages are slower and use more RAM.

Fil-C is the worst of all worlds here. Like C, it forces you to manually manage your own memory. But you still pay the performance cost of having a runtime garbage collector. And that cost is (apparently) really high. The only performance numbers I've seen showed ~2x worse CPU performance and ~4x worse memory performance. There's no way Fil-C can compete with C, Zig and Rust for performance.

So with Fil-C, you have a language that's much slower than C, and much more difficult to program in than C#, Java, Go or Typescript.

Fil-C still has some wonderful uses. Fil-C could be a fabulous debugging tool for C programs. It could be a wonderful teaching tool if it had nice visualisations on top of the GC's view of the world. And it could be a great way to run legacy C code.

But it's not a "rust killer". Fil-C programs run too slowly to be able to compete head to head with rust. And Fil-C doesn't offer the language benefits of a GC that you get in C#, Go, and friends. It seems like a really bad deal.

Re:Zig's Incremental Compilation Internals by archargelod on Tuesday July 28, 2026 @09:30PM (#49092341)
> GC languages are slower

This is not necessarily true. It depends on a language, e.g. Go is slow, Nim[0] is extremely fast with conventional GC and slightly faster with ARC/ORC[1].

GC programs can be faster than manually managed ones in some cases. It's just manual memory management gives you more control of where and when free is called. And a good type system is a privelege that gives Nim more control with destructors.

Another scarecrow of safe languages is GC pauses, which is also not a thing in Nim, see table in [2].

[0] - https://nim-lang.org/

[1] - https://nim-lang.org/blog/2020/10/15/introduction-to-arc-orc...

[2] - https://nim-lang.github.io/Nim/mm.html

Re:Zig's Incremental Compilation Internals by seanmcdirmid on Tuesday July 28, 2026 @09:39PM (#49092417)
You can always use things like arenas in C and get similar speed ups without GC overhead. If you know your memory lifetimes in advanced, avoiding granular malloc/free calls is pretty straightforward. A GC language doesn’t usually offer such options.
Re:Zig's Incremental Compilation Internals by pjmlp on Wednesday July 29, 2026 @02:21AM (#49094001)
Sure it does, D just to give one example.
Re:Zig's Incremental Compilation Internals by foldr on Wednesday July 29, 2026 @05:16AM (#49095069)
You can easily use arena allocation in a GCed language. With modern GCs there's not usually much performance benefit, so it tends to be limited to hot paths.
Re:Zig's Incremental Compilation Internals by josephg on Tuesday July 28, 2026 @10:16PM (#49092683)
Good to know! Would there be any way languages like Go or C# could adopt Nim's new garbage collector? If it's better, what stops other languages from using it?

> GC programs can be faster than manually managed ones in some cases.

I've seen poorly written programs in C/C++/Rust which are slow because they allocate millions of tiny objects. Its true that generational GCs can be faster in this case. But you usually get much better performance again by using arenas and such. The reality is that I know more about the lifecycle of my data than my compiler. If you know what you're doing, you can take advantage of this information to write better programs.

If you don't want to think about memory management, then I agree - you're usually better off using a language with a GC. Personally I do a lot of my prototyping in typescript because I can iterate faster when I don't have to think about lifetimes.

Maybe some day Fil-C will run general purpose C code at native speeds, without a high memory overhead. But we're not there yet. I'm not holding my breath.

Re:Zig's Incremental Compilation Internals by galangalalgol on Wednesday July 29, 2026 @05:54AM (#49095326)
Even if you don't think about memory management, and do the naive thing in rust or rc in some other systems language, gc only comes out ahead in that many tiny objects case. Which is very domain specific. I don't ever run into that situation, or if I do, they are homogeneous in type so I handle them in bulk, not individually.
Re:Zig's Incremental Compilation Internals by pron on Wednesday July 29, 2026 @08:33PM (#49104825)
That depends on what you mean by GC. There are refcounting GCs, there are mark-and-sweep tracing GCs (like the one Go uses), and there are moving GCs (the last ones are the ones used in Java, V8, and .NET). Moving GCs win in many situations because they're just a really efficient algorithm both in theory and in practice (they win on speed, and the tradeoff is footprint). The downside is that they require 1. a lot of expertise and effort to implement (in fact, the first open-source, high-throughput, low-latency pauseless moving GC only appeared 3 years ago), which is why only specialised expert teams have implemented them, and 2. that virtually all pointers can move, which means that interop with low-level code requires some specialised API. That last restriction means that low-level languages generally cannot enjoy the optimisations that moving collectors bring.
[dead]
Re:Zig's Incremental Compilation Internals by KingMob on Wednesday July 29, 2026 @02:03AM (#49093896)
complains about vote manipulation

user created an hour ago

Re:Zig's Incremental Compilation Internals by wannabe44 on Wednesday July 29, 2026 @06:23AM (#49095551)
You provide no trustworthy benchmark for your claim that Go is slow, or that nim is faster than that. Many engineer hours have been put on the go GC and compiler
Re:Zig's Incremental Compilation Internals by archargelod on Wednesday July 29, 2026 @07:46AM (#49096207)
You can find a number of benchmarks with similar results, but I really like this one[0]. I didn't check all algorithms for differences, but just looking on mandelbrot bench - both are version 1 (without hacks or some manual loop unrolling thrown in) and both are implemented in semantically identical code. Nevertheless, Nim version runs 7x faster and, literally, on par with C.

[0] - https://programming-language-benchmarks.vercel.app/nim-vs-go

Re:Zig's Incremental Compilation Internals by MatejKafka on Wednesday July 29, 2026 @11:27AM (#49098783)
I haven't seen data that would confirm that the Nim ARC/ORC approach is faster than manual memory management (C/Rust/Zig/...) on programs with non-trivial lifetimes (for trivial lifetimes, Nim elides RC). I'd also be somewhat surprised if it was consistently faster than GC – most languages with automatic memory management use GC over RC because RC adds significant overhead, especially in multithreaded programs.
Re:Zig's Incremental Compilation Internals by underskay on Wednesday July 29, 2026 @03:10AM (#49094305)
But at least one does not have to deal with pinning.

Also, you, the pedophile josephg, should be tortured to death in public.

Re:Zig's Incremental Compilation Internals by mbrock on Wednesday July 29, 2026 @07:40AM (#49096150)
> Fil-C is the worst of all worlds here. Like C, it forces you to manually manage your own memory.

Can you expand on this?

Re:Zig's Incremental Compilation Internals by johnlorentzson on Wednesday July 29, 2026 @03:48PM (#49102124)
As far as I know calling free is optional with Fil-C. It can prevent situations where some memory is no longer needed but isn't freed due to some remaining pointer to it sitting around somewhere, but it's not required. The GC will act like a GC if given the opportunity.
Re:Zig's Incremental Compilation Internals by pron on Tuesday July 28, 2026 @01:50PM (#49087483)
So that could be a clear definition, but for it to be "table stakes" it needs to have some universal value and it doesn't (in fact, that very same definition could also classify even C as "memory safe"): https://news.ycombinator.com/item?id=49087458
Re:Zig's Incremental Compilation Internals by steveklabnik on Tuesday July 28, 2026 @02:30PM (#49087989)
I can say that something is "table stakes" for me without demanding that everyone else adhere to my values.
Re:Zig's Incremental Compilation Internals by awesome_dude on Tuesday July 28, 2026 @02:56PM (#49088330)
There's little point in me telling the world how I like my dinnercooked, unless the world both understands exactly what I mean, and cares
Re:Zig's Incremental Compilation Internals by literallyroy on Wednesday July 29, 2026 @10:06PM (#49105382)
This doesn’t seem useful. I understood the parent comment and cared since OP’s opinions/thoughts/reasoning help me sort my own thoughts.
Re:Zig's Incremental Compilation Internals by IshKebab on Tuesday July 28, 2026 @03:47PM (#49088956)
I'm not exactly sure what you mean by "universal value", but I would say to be "table stakes" (i.e. not optional), it has to have overwhelming value. I think outside some fairly niche areas (e.g. programs that don't process untrusted data at all), it very very clearly has overwhelming value.

Now you might argue that the other features of Zig, like `defer`, are so good that they reduce the chance of memory errors and therefore memory safety has less value for Zig. But that seems highly dubious to me, especially for use-after-free. I guess we'll find out when Zig has more widespread use.

Re:Zig's Incremental Compilation Internals by imtringued on Wednesday July 29, 2026 @05:49AM (#49095288)
His point is literally that writing a JVM (or any other language runtime) in Rust is unpleasant.

He can't write a JVM without using unsafe. So his disagreement on the "table stakes" is that his "table stakes" require using unsafe Rust everywhere and from that perspective Rust is not that different from any other language.

Hence the complaint about the lack of universality, which I personally consider weird. His point is that you cannot write the most interesting low level programs using just the safe subset of Rust.

If you have to write unsafe Rust (emphasis on have, your mileage may wary lot on that), then you have to litter unsafe everywhere in your code base so how does Rust help him? That's his point, but he doesn't want to say it out loud.

Re:Zig's Incremental Compilation Internals by pron on Wednesday July 29, 2026 @08:49AM (#49096824)
What makes a JVM a good fit for a low-level language is the need/utility for precise control over the hardware, but that's always the reason to want a low-level language (why would you use a low-level language if you don't want precise control over the hardware?). When Rust gives you safety it takes away much of that control, and when it gives you control it takes away the safety. Now, there could well be cases where this mix is fine - I've never worked on a browser, and Rust may well be the best language for writing browsers.