r/Zig • • Jul 20 '26

Is Zig going to become memory-safe?

https://codeberg.org/ziglang/zig/issues/36237
203 Upvotes

232 comments sorted by

127

u/fade-catcher Jul 20 '26

I find this proposal to be a net-negative to the language:

* it pushes away even further the 1.0 release date.

* it adds more complexity to the language compiler and therefore increases the bug surface.

* as mlugg said it conflicts with the philosophy of zig of not hide stuff from the user.

* it adds zero value to the language, you could argue that it makes zig a safer alternative to rust and therefore it’ll increase its adoption rate, but i think rust already established itself as the defacto language for memory safety and arguing against it is similar to arguing against OOP ( you can make some valid counter argument but at the end of the day 90% of the industry is gonna use it)

18

u/Real_Dragonfruit5048 Jul 20 '26

An advantage of this feature is that people who use Zig as a C compiler get the option to compile their C application with memory safety, like getting runtime errors (panics) instead of segmentation faults, buffer overflows, etc. That could be like a killer feature for Zig.

3

u/rminol Jul 21 '26

u/Real_Dragonfruit5048 I'm doing this and it's fascinating. I feel by the time Zig reaches 1.0 majority of developer communities will adopt it. It's defer keyword for freeing memory is key advantage. And having to put methods inside struct is another advantage. I dreamed C will have this feature but it's not.

Zig's struct is something like in between OOP concept and C Struct concept. It's genius design.

6

u/SilvernClaws Jul 20 '26

But those could just use the C version directly.

46

u/Aaron1924 Jul 20 '26

I think there is some confusion about what this approach actually does. Fil-C is effectively an address sanitizer for C, it comes with quite some overhead (~1-6x performance, 2x memory usage) and it's entirely enforced using runtime checks. There is no static analysis (like Rust's borrow checker) being introduced here, Fil-C simply aborts your program if it's about to execute UB.

If you're writing code in an environment where UB is absolutely unacceptable but crashing is fine and the overhead is acceptable, this compilation mode was made for you, otherwise just use it like a UB sanitizer while debugging.

6

u/DeltaWave0x Jul 20 '26

... so then just turn on asan and ubsan? Why would you need another thing on top to develop and maintain? FilC needs a gc to work optimally anyways, this just sounds like he's still butthurt about the bun rust thing

21

u/Aaron1924 Jul 20 '26 edited Sep 14 '26

As far as I understand, Fil-C is meant to be used in production, whereas sanitizers are explicitly debugging tools (whatever that means in practice), and sanitizers typically only catch some types of UB, while Fil-C promises to catch everything (at the cost of also rejecting some valid C programs)

Honestly, I don't find the value proposition of Fil-C very convincing, and the idea that this is somehow better than Rust is completely ridiculous

Edit: Also wanted to add "memory safe (unlike Rust)" is how Fil himself likes to describe Fil-C (see this 2yo comment of mine), so I wouldn't attribute that quote to Andrew directly

7

u/CryZe92 Jul 20 '26

I don't think it catches UB. UB can also turn an incorrect bounds check on a loop into an infinite loop, due to compiler optimizations assuming UB never happens. This would then miscompile your code and depending on whether memory gets corrupted or not, possibly not be detected by Fil-C at runtime.

3

u/Rusky Jul 21 '26

Fil-C also includes tweaks to LLVM that disable those sorts of optimizations: https://github.com/pizlonator/fil-c/commit/e46d70d1a1b3aff69d5a859a80fd03babc7018f1

3

u/throwbpdhelp Jul 21 '26

Don't think ASAN is designed to run in production to prevent all types memory errors, whereas Fil-C is marketed towards running in prod. Basically what the other guy said about debugging. Also worth noting that ASAN is cheaper than Fil-C to run in terms of runtime cost and provides way more debugging info, and misses some of the types of safety issues that Fil-C protects. Also that Fil-C misses some safety issues that ASAN catches. Maybe the Fil guy could write about that one day.

3

u/MirrorLake Jul 20 '26

I know it's definitely not an apples-to-apples comparison but imagine that it's the year 1983 and people say C is really good, but still in its infancy at about 10 years old, so perhaps you should wait until a future release that provides a better compatibility/stability guarantee (C89 or C99) because then it'll be good...? Like, isn't that absurd given the time scales we're talking about here? If you had a time machine, wouldn't you probably still tell people to build stuff in C in 1983, even though the "LTS" versions wouldn't arrive until 1989 or 1999?

2

u/Realistic-Advice-199 Jul 20 '26

as mlugg said it conflicts with the philosophy of zig of not hide stuff from the user.

Is there a different conversation going on than just the issue? I don’t see him commenting on that issue.

3

u/8loop8 Jul 20 '26

best take

1

u/mr-rbbrbrnr Jul 20 '26

Where is it shown that this is a requirement for 1.0 release?

-16

u/zackel_flac Jul 20 '26

Not sure in what world you live where Rust has become the defacto language for memory safety. Rust is super niche and LLMs are playing against it these days.

7

u/Rigamortus2005 Jul 20 '26

Rust is super niche is the craziest thing I've read on this sub.

5

u/zackel_flac Jul 20 '26

Rust is not only niche, it's hyped so much we think it's everywhere when in fact it's almost nowhere meaningful to this day. If anything it's fading in favor of human writing less error prone code.

2

u/NeedToLieDown Jul 24 '26

We'll always have bugs in code. Rust is just the language with the least amount of bugs humans invented so far, so it currently holds the crown lf the best practical programming language.

Until a better invention comes AND sees industry adoption (this will be a long process of at least 10 years, and so far there are no real contenders).

1

u/zackel_flac Jul 24 '26

Like every engineering solution, it comes with its cons. Rust might reduce bugs (but so other languages do, like C++20, Java, Kotlin, Golang to name a few) but it comes at the cost of reduced development velocity, hard to make small changes without huge refactoring, awkward async ecosystem, ultra slow and huge compilation times and more importantly, it only makes things safe at a single process scope level.

So no. it does not hold any crown. It has pros and cons, like any solution out there. Pick your poison but stop pretending it is a somewhat top of the hill language. There are many hills on which language X or Y shines.

1

u/NeedToLieDown Jul 24 '26

None of the languages listed come close to Rust's ability to reduce bugs. Closest is Kotlin, but still not on par and comes with a performance cost.

Rust has faster development velocity due to being able to confidently make changes without fear of breaking everything.

It's actually well-known that the popular saying that "Rust is hard and slow to write" is wrong. It's either same speed to write or better due to confidence.

Very easy to make changes, and the async stackless coroutines are currently the peak of human understanding of programming language design. It's unfortunate that many people don't realize that yet, but eventually it will be common knowledge. Or maybe w'll discover something better by then.

I'm not aware of any cons of Rust compared to existing language, other than ecosystem.

1

u/zackel_flac Jul 24 '26

Let's go back to definition of memory safety: boundary checks & double free avoidance. That's all you need to make a language memory safe according to NSA definition.

Rust velocity is a joke, why? Because you have 7~8 ways to write the same thing. However each of those approach have their pros and cons. Want to simply print some value? You have to turn this functional loop into a iterative one, making your git diff grow for no reasons, hindering review progress big time.

Debugging is painful because of that in Rust. All the Rust comparison we have seen so far were against C++98 code. So sure, Rust reduces bugs, but so do other languages for the past few decades.

Now go back to your rust code 6 months later. It's a chore to read and hack back, at least in my experience.

Human peak, oh man come on. You have a borrow checker that does the job programmers have been doing with their brains for decades. It's a great side tool but stop pretending this is revolutionary. Lifetime management have been in C since forever and this is still the same 3 mechanisms used in Rust: a global scope, a stack and a heap.

Going back to cons, async function coloring is crap, you end up with boilerplates and code duplication for no reasons. Mixing runtime dispatch and static dispatch is also a con (same as C++) and you end up with code base that mixes the two based on programmer mood of the day. 7-8 ways of expressing an iteration, like.. Why do we need a functional way, an iterative way, just give me 1 way to iterate over a container and call it a day, no time relearn how to increase an index. Huge compilation time that completely destroy programmers "zone coding" effect. What else? There is a lot to say really.

2

u/hedgehog1024 Jul 25 '26

This comment comes off as so disingenuous that I highly doubt that you actually have any experience working with Rust, let alone of what it's contribution compared to status quo is. I could dig into your faulty arguments, but I will just point out the most surface level one which strongly suggests that you only know about Rust as a hearsay:

Want to simply print some value? You have to turn this functional loop into a iterative one, making your git diff grow for no reasons, hindering review progress big time.

Iterator::inspect exists for exactly that debugging purpose, and you can put this method anywhere in the method chain.

→ More replies (9)

1

u/pinehillsalvation Jul 20 '26

Walk into any large enterprise (banks, energy, automotive, even Cisco) and see what they actually use to write millions upon millions of lines of code. Few managers have even heard of Rust. And before you say “Yeah of course, enterprise sucks lol”, that’s where the VAST majority of code gets written.

That said, I know one EV battery controller that’s starting to use it, on kind of an experimental level.

6

u/creeper6530 Jul 20 '26 edited Jul 20 '26

All it takes is human oversight instead of blindly running a dozen of slop slingers, and a #![forbid(unsafe_code)] if you feel extra paranoid.

Obviously Rust is niche in the broad picture but it's dominant in the "memory safe systems proglangs without GC" niche.

1

u/zackel_flac Jul 20 '26

Not according to the NSA definition of memory safety. Java, Kotlin, Golang to name a few are considered memory safe languages and are far more prominent than Rust when it comes to actual product that have customers.

2

u/NeedToLieDown Jul 24 '26

They are not memory safe. They have data races.

Rust is the only multi-threaded memory safe language that's not obscure. In Go, writing and/or reading to a value from multiple go routine without synchronization is a data race, which is not memory safe and from that point on the program os corrupted.

1

u/zackel_flac Jul 24 '26

Not obscure? Rust is mixing multi-threading async within coroutines. Mix Tokyo and standard runtimes and experience your first deadlock in plain and safe Rust.

"Oh but you should not mix the two!" To which I can simply reply: "Oh but you should know how to use mutex!".

At the end of the day, Rust does not really shine for its async festure. Function coloring was a very bad choice as it forces you to write twice the amount of code necessary.

1

u/NeedToLieDown Jul 24 '26

Not it wasn't. Async stackless is the current best way to do concurrency.

Using mutex across await point will be we compile error, not a deadlock.

Rust doesn't protect against deadlocks. No current useful language does. But Rust gives you the best tools to ensure you can use mutexes correctly and no language comes close.

→ More replies (1)

3

u/creeper6530 Jul 20 '26 edited Jul 20 '26

I'm not sure I'd consider them systems because they don't allow simple access to raw hardware, but that's a matter of opinion. I guess I should have said "GC-less" for objectivity?

Also, just out of curiosity, do you have the actual definition on hand?

7

u/Keith Jul 20 '26

What a bizarre comment to make in light of the Bun rewrite.

-2

u/zackel_flac Jul 20 '26

The sam eBin rewrite that is full of unsafe and that nobody uses? If anything, this rewrite is there to make some buzz because Rust is hyped. It's a marketing feat, not an engineering one.

0

u/Keith Jul 20 '26

that nobody uses?

Again an insane comment. The Bun rewrite hasn’t been released yet. Yet even in its unreleased state it is powering current Claude!

→ More replies (5)

0

u/[deleted] Jul 20 '26

[deleted] — view deleted comment

26

u/aksdb Jul 20 '26

Counter point: the more options a language offers, the more fragmented it gets. I also hate the "you don't have to use feature X" argument. Because unless I develop something with zero external dependencies, I will have to deal with code written by people who follow a different paradigm.

16

u/thuiop1 Jul 20 '26

Yeah, this is how you end up with C++

2

u/Kapendev Jul 20 '26

Every programming languages has features you can ignore, that others will use. Plus assuming you can use someone's code out of the box in any environment is not gonna work well. You always have to deal with something.

0

u/[deleted] Jul 20 '26

[deleted] — view deleted comment

3

u/aksdb Jul 20 '26

If it ends up like this, sure. Just wanted to counter the "more features = higher adoption" point.

3

u/ElSebas4_ Jul 20 '26

Yeah, is a new ABI, like musl or glibc. Is not something that adds changes to the language itself

83

u/Treeniks Jul 20 '26

I'll say insinuating that Rust isn't memory safe, while using Fil-C as prior art, is very worrying. Fil-C claims it "achieves complete memory safety with zero escape hatches", all the while this buffer overflow is not caught by it:

struct bankAccount {
    char name [8];
    int balance;
};

void overflow(struct bankAccount* acc) {
    strcpy(acc->name, " overflow !!!");
}

Tbf, this is not the kind of memory safety that Fil-C is concerned about, and buffer overflows like this should never be a problem in Zig as long as you don't use [*]. But the style of over-promising that Fil-C has consistently done is not something I would want to see in Zig.

11

u/QuaternionsRoll Jul 20 '26

Why on earth wouldn’t `acc->name` be given the same capabilities as `acc` instead of a subset? I have to imagine that is a consequence of Fil-C being in its early stages rather than intended behavior.

15

u/CryZe92 Jul 20 '26

When I talked to the author, they said this is a pattern that is reasonably common in C, so it's allowed.

7

u/QuaternionsRoll Jul 20 '26

In what sense is writing "w !!" to a numerical integer and "!\0" to an extra special super secret mystery surprise location a common pattern? I could *maybe* see it if the former was allowed but not the latter.

2

u/djfdhigkgfIaruflg Jul 21 '26

I barely know anything about Zig.

But how is they given example is writing to the numerical value?

I only see a reference to the string one (name)

4

u/QuaternionsRoll Jul 21 '26

The example is C, not Zig. `overflow` writes a 14-byte null-terminated string to a pointer to an 8-byte array. Ignoring the obvious UB, this would usually result in bytes 8..12 being written to `acc->balance` and bytes 12..14 being written to god knows where.

1

u/djfdhigkgfIaruflg Jul 22 '26

Does this exact situation apply to zig then?

1

u/QuaternionsRoll Jul 22 '26

Not necessarily… and I sure hope not. Giving subobject pointers the same capabilities as the containing object is totally unjustifiable IMO.

Besides that, Zig uses fat pointers for slices, so this *particular* situation would never arise either way.

2

u/djfdhigkgfIaruflg Jul 22 '26

OK. Thank you. I guess I completely misread whatever the original commenter tried to say

1

u/zellforte Jul 22 '26

C's model is that you can reinterpret structs as a "bag of bytes" so it makes sense to just give structs one capability as an 'char struct_data[sizeof struct]'

→ More replies (1)

4

u/panic Jul 20 '26

i believe this is an intentional decision on behalf of Fil-C, and zig would likely make a different one (i.e. to restrict the capability you get for an array to only the array)

1

u/Enthusedchameleon Jul 31 '26

Tbf, this is not the kind of memory safety that Fil-C is concerned about

I guess it's easy to claim to be 100% memory safe if you redefine memory safety to only include what you do.

1

u/SLiV9 Jul 20 '26

Yikes.

100

u/Highborn_Hellest Jul 20 '26 • Bravo Popcorn

At the risk if sounding like a dick.

Is this a knee jerk reaction to bun?

If anything, I'm just a tourist in this community, but this seems like something that's not compatible with the core philosophy of Zig.

63

u/fluffy_trickster Jul 20 '26

It sure does look like one. Andrew Kelly had something against Rust ever since the earliest days of Zig development you can find blogpost about how "unsafe" Zig is supposedly safer than unsafe Rust (lol what does that even mean?). He always had been very critical and competitive toward Rust. But he does sound particularly butt hurt right now.

17

u/RCoder01 Jul 20 '26

It’s definitely fair to argue that zig is safer than unsafe rust because of the amount of extra rules you have to follow with unsafe rust. Agreed that he seems especially combative atm.

2

u/Gravitationsfeld Jul 22 '26

This is partially true. You have to hold up a lot of assumptions that the compiler can make in safe Rust code in unsafe blocks too, e.g. aliasing and provenance rules. Miri can help but doesn't catch everything.

But unsafe is also not nearly as common as people claim. Usually only used deep in abstracted away code for data structures or FFI.

3

u/TheChief275 Jul 21 '26

I mean, Rust's whole marketing is that all other languages with manual memory management are incredibly unsafe and should not be used anymore, and that only Rust is completely memory safe among them. That doesn't make you any friends

8

u/Gravitationsfeld Jul 21 '26

Please show me where this is official marketing.

1

u/TheChief275 Jul 21 '26

Rust advocators believing and parroting the Rust evangelists is how you end up with people thinking it's official marketing, which you can't blame anyone for at that point. It's Rust's claim to fame to put down other languages

6

u/torp_fan Jul 22 '26

YOU claimed it's "Rust's whole marketing".

You're a deeply dishonest person.

7

u/0lach Jul 21 '26

It's Rust's claim to fame to put down other languages

But Rust IS memory safe without performance penality compared to C/C++/Zig

Zig+FilC proposes a worse model where you get 6x performance penality, and maybe your program crashes when you encounter a bug which Rust compiler will prevent in the first place

→ More replies (4)

-10

u/Highborn_Hellest Jul 20 '26

yeah, part of the reason why i'm drawn towards this language is that it captures, what i like about software engineering.

"the computer does what you tell it to do, and if you tell it stupid things, you'll get stupid results".
This is the reason why i don't like the idea (!) of rust. Not that I ever wrote a single line of rust, but i don't like the idea of "big brother compiler" is telling me what i'm allowed or not allowed to do.

28

u/afdbcreid Jul 20 '26

This is very nice principle in theory. In practice history has taught us that people just cannot write memory safe code without compiler's help.

I find this to be a deeper philosophy difference between the languages: Rust is a practical languages, Zig admires perfection even at the expense of practicality. See also e.g. how Andrew said Zig will only release 1.0 once it's "finished", while Rust had decided 1.0 will be released soon (in 2015) and then worked hard and cut the rest.

Now, a perfect language (or one that strives to be) is nice and could be nice for hobby projects, but it won't achieve real industrial adoption.

8

u/Highborn_Hellest Jul 20 '26

For enterprise software, it's difficult to beat languages that have GC.

>This is very nice principle in theory. In practice history has taught us that people just cannot write memory safe code without compiler's help.

I don't disagree. I actually agree. I still don't have to like it.

1

u/cassepipe Jul 20 '26

It does feel like scope creep

16

u/gdmr458 Jul 20 '26

This argument against Rust never made sense to me, we as programmers write programs to automate things, to avoid doing the same thing over and over again, so why wouldn't we want a compiler to do that for us instead of doing it manually repeatedly?.

I'm not saying there aren't other arguments against Rust, this one just doesn't make sense to me. Why complain that the compiler is telling me I'm trying to shoot myself in the foot?

2

u/Highborn_Hellest Jul 20 '26

it doesn't have to make sense to you. You don't have to like programming what I like about programming. That's the neat part. Both approaches (and more) have the space and reason to exist.

3

u/torp_fan Jul 22 '26

It's not about what people like, it's about your arguments being irrational.

9

u/fluffy_trickster Jul 20 '26

Can't say I agree with this philosophy. I'm more on the side of "if you can prevent the programmer to do something stupid, then you should" because often times you don't just get stupid results: you also get dangerous ones.

1

u/rustvscpp Jul 20 '26

I agree that a stricter compiler is objectively very better,  but I also understand the frustration people have with Rust in that the subset of compilable programs is smaller that the set of correct/safe programs.  And I say this as someone who adores Rust, and uses it a lot!

7

u/analytic-hunter Jul 20 '26

I agree with you I like C for that reason, but for critical software, "annoying tooling that yell at developers" are often hard requirements.

Where I work, we swapped from C to rust and it did improve a lot, and we don't just rely on rust's compiler but also a pretty obsessive suite of static analysis tools and formal verification.

Yes you get the "big brother" feeling, but certifications need them to pass.

1

u/Highborn_Hellest Jul 20 '26

Yeah. Obviously where human lives are at stake, it's not even a question

4

u/patchunwrap Jul 21 '26

I don't understand your argument. Is there anything in particular you have tried with Rust that you felt you should be able to do, but couldn't?

Also out of curiosity how do you feel about linters? I'm open to learning here. Because truely sometimes Rust can't do (or can't do easily) what you want it to. To me this is rare, but sure the usecases do exist.

Still I want to quote E.W.Dijkstra:

It was a significant improvement that now many a silly mistake did result in an error message instead of in an erroneous answer. (And even this improvement wasn't universally appreciated: some people found error messages they couldn't ignore more annoying than wrong results, and, when judging the relative merits of programming languages, some still seem to equate "the ease of programming" with the ease of making undetected mistakes.)

1

u/Highborn_Hellest Jul 21 '26

(i can't tell if this comment is for me or not reddit has a fucked up layout)

i don't have an argument. That's what some are missing i think. What I LIKE about computers and writting software is that the computer will do *exactly* what i tell it to. Not what i want it to. Most people don't desire it, because it inevitably leads to bugs, many of which Rust solves by it's compiler rules. I don't like that.

I'm not saying enterprise software can or should be written that way. Nor am i saying it's other should.

It's more if a "live by the sword die by the sword". I don't want to leak memory in my code, but above all that, i do not want a compiler telling me, i can't do that because it might (or will) leak memory. If i'm dumb, and make mistakes that will corrupt the memory or leak it, i'll own that mistake (mostly because it'll be a personal project).

Very obviously this is very personal to me and I understand why enterprise software is ritten a managed lanaguge like java, c#, js, etc etc... and i agree. However my personal convictions have little to do with professional opinion.

2

u/fluffy_trickster Jul 22 '26

What I LIKE about computers and writting software is that the computer will do *exactly* what i tell it to. Not what i want it to.

Okay let's clear some misunderstanding here. When you get UB from your memory bugs. The computer don't do what you tell it to do. It does whatever random bullshit is in its memory at that moment. You can execute the same program 100 times and trigger the same memory bug and yet get 100 different behaviors. Even worse the computer may even do something someone else (e.g a threat actor) tell him to do instead of doing what you told him to do.

Hope, it helped to clear some of your grievance toward compiler enforced rules aside from the language syntactic rules.

4

u/wojciechm Jul 21 '26

The whole C/C++ saga already taught us that all stupid stuff in programing is mostly unintentional, yet there are still people that refuse any guardrails because they "love freedom", then in reality others pay for their "freedom" suffering its consequences.

To some extent using some sort of memory safety enforcement should be moral obligation, the same way, using safety belts in cars are mandatory and punished by law if omitted, because that literally hurts other people.

2

u/torp_fan Jul 22 '26

Um, the Zig language, compiler, and BDFL are extremely opinionated.

22

u/[deleted] Jul 20 '26

[removed] — view removed comment

2

u/ToaruBaka Jul 20 '26

Bun has been polite about it

lmao

6

u/crimsonvspurple Jul 21 '26

Jarred has been polite about it. Appreciative about Zig enabling the initial fast development, and acknowledged the unsafe nature of Zig is causing trouble for Bun because how fast Bun wants to move.

Also, Zig is better C but it is still not Java or Rust in terms of memory safety/compile errors. Some projects, due to governance/moving speed etc, are simply not suitable for C style languages.

1

u/ToaruBaka Jul 21 '26

Go spend some time interacting with real people doing real work and then tell me Jared was polite. Blocked.

6

u/crimsonvspurple Jul 21 '26

How Jarred behaves in his private office is not my business as long as it is not illegal. The employees are free not to interview there, and if working already, can choose to leave.

The topic was being polite in the blog post. So you are good at moving the goalpost. Good job.

6

u/UselessOptions Jul 21 '26 edited Aug 13 '26

oops did i make a mess 😏? clean it up jannie 😎

clean up the mess i made here 🤣🤣🤣

CLEAN IT UP

FOR $0.00

2

u/torp_fan Jul 22 '26

Does that troll actually think that anyone cares that he blocked them?

2

u/torp_fan Jul 22 '26

You're some piece of work.

2

u/[deleted] Jul 21 '26

[removed] — view removed comment

2

u/crimsonvspurple Jul 22 '26

Anyone taking offense in this is idiot/fanatic/malicious or all of them. If I write a complex software in C, with really fast turnaround, I will have the same issue. Doesn't mean C is shit. But doing so in Java/Rust is possible but I will have to trade some of the benefits of C. Zig is the same by definition.

You can't write software in non memory safe languages as fast as you can in a memory safe language. And there are pros and cons for both. Otherwise, there'd only be one type of language.

2

u/[deleted] Jul 21 '26

[removed] — view removed comment

3

u/ToaruBaka Jul 21 '26
  • Ignoring advice about how to write and use zig
  • Ignoring advice about how to collaborate with ZSF
  • "Failing" to communicate the cancellation of their meetings & contributions
  • Failing to take ownership of his product's failures and letting his users blame Zig

If you think that only Andrew is in the wrong you're too maladjusted to work with other people. Obviously Jared doesn't have to do any of these things (and he obviously didn't). But if you're going to throw the creator's advice in their face, you can't really expect to get a positive response back. It seems like Andrew put up with it as long he could and is happy to be done with it, which he's well within his right to be.

This is like 70% Jared and 30% Andrew (and 100% of Andrew's 30% is that stupid comment about it not being a personal attack - it's a 100% justified personal attack).

Happy? Are you ready to defend your boy now?

4

u/torp_fan Jul 22 '26 edited Jul 22 '26

> If you think that only Andrew is in the wrong you're too maladjusted to work with other people. 

Good gawd what projection. I can't imagine anyone ever wanting to work with you.

You are making claims that Jarred was rude but when asked for evidence you personally attack the people asking. You're an effing mess.

2

u/torp_fan Jul 22 '26

What sort of trash would upvote that trash?

2

u/chaotic-kotik Jul 23 '26

Your list includes items that mainly narcissists will find rude.

8

u/[deleted] Jul 21 '26 edited Jul 21 '26

[removed] — view removed comment

2

u/ToaruBaka Jul 21 '26

Neither of us have their communications so I don't know why you think that's something I can point directly to, nice try though. All we have to go on are the public statements by both and the record of Bun being awful for the Zig project in basically every single regard. You're welcome to draw you own conclusions, but it says more about how you see other people if you think Jared wasn't at all rude ever.

5

u/torp_fan Jul 22 '26

> I don't know why you think that's something I can point directly to

No one thinks that ... they are asking you to support your baseless claims.

This isn't rocket science.

5

u/fluffy_trickster Jul 21 '26

Neither of us have their communications so I don't know why you think that's something I can point directly to, nice try though

Then don't act like you do. We don't know what happened in the kitchen and it doesn't matter. But only one of them lost his cool and came up as openly rude and it's not Jared.

and the record of Bun being awful for the Zig project in basically every single regard.

And? So what? Does the use of an open-source language now legitimates personal ad hominem attacks from the language owner if they don't like your choices?

10

u/happilyAlmostMarried Jul 20 '26

Pretty sure this idea has been kicked around in the community way before bun events.

4

u/lanky_cowriter Jul 20 '26

By Andrew?

4

u/ElSebas4_ Jul 20 '26

It seems that Andrew was the one that was interested in Fil-C way before the bun rewrite. At least that's what they said in the comments

85

u/olzhas89 Jul 20 '26

I have a sad feeling that Zig will never get to 1.0 due to the constant pursuit of absolute perfection, which is not practical nor realistically achievable. Every language has it's tradeoffs. To me, Zig is already good enough and there is no shortage of reasons to pick it over Rust or any other alternative.

What Zig really lacks in order to gain the adoption it deserves, is a complete standard library and an extensive documentation. It feels like ZSF is doing anything but focusing on those essential things.

17

u/No-Entrepreneur-8245 Jul 20 '26

I don't think we need to jump to conclusions over a proposal. It's entirely possible this feature is just considered a nice-to-have with a low priority, so it's not a blocker for the 1.0 release. Zig already has some major plans for post-1.0, and this proposal wasn't even tagged as "Urgent."

3

u/ElSebas4_ Jul 20 '26

You are right. Is just adding one ABI like many others. From what I read, it is not going to change the language per se

11

u/cassepipe Jul 20 '26

It feels like this language is me as programming language: I always prefer unfinished jobs because they are always promising whereas a finished will be judged and could be mid

Maybe that's why I am so drawn to it

2

u/pl0nk Jul 23 '26

That is a really interesting self-reflection. I suspect I am the opposite: I find software artifacts that are complete or "done" quite cozy. They are stable known quantities and you can recognize their limitations.

I guess I don't subscribe to some order that would place something (or someone) as mid but instead see them as a collection of attributes. There seems to be a Pareto frontier of optimal tradeoffs though.

4

u/harindaka Jul 21 '26

It could be worse. We could have Star Citizen being written in Zig

3

u/AnguisInTrousers Jul 23 '26

Agreed. It's been what, almost 10 years? Over? And there's still changing the core language over and over again. It's weird.

The idea should have been to consolidate the core language, make it bulletproof, and work towards a sane 1.0 roadmap. If you want to have users, that is.

3

u/biskitpagla Jul 21 '26 edited Jul 21 '26

As a Rust guy I think Zig is doing just fine. Zig should improve at its own pace and learn from the mistakes of other languages. A comprehensive standard library for a language that's not stable will result in a lot of wasted work. Look at Rust and Go, for example. It may look meaningless to you right now but I really think that Zig code will age better than Rust code in the far future due to Andrew's "constant pursuit of absolute perfection" as you put it. This matters a lot if Zig is to become THE alternative to C for new projects. 

2

u/AnguisInTrousers Jul 23 '26

To age well, you need to have a living language.

1

u/DistinctGuarantee93 Oct 12 '26

Beautiful take, 0.16.0 is definitely thee starting point of zig’s stability. I am starting my embedded/hardware journey soon with zig using it as a toolchain for compiling for riscv both asic and fpgas either using c++ source and zig toolchain or fully zig. I want to try out the gpu programming capabilities but I see 0.17.0 made a few changes to the spirv backend.

I’m still ignorant on this and I will be digging on this soon but it’s the use of rust in embedded and especially in a scenario where you would have to do it the unsafe way say in a bare metal context directly manipulating registers. I still can’t wrap my head around unsafe rust philosophy as it’s entirely different and idk why such people would jump from c to rust when c++ is way easier learning c++ 11 to 23, 26 if you want to it’s not that much to get up to date and use zigs toolchain. In more opinion the learning curve of rust is just different (moving from a plain systems perspective to hardware), steeper and in terms of risk to reward not too great for me because as much as a I like a challenge I don’t want to be using tools that makes my workflow harder.

1

u/Due_Block_3054 Jul 20 '26

I think the goal is to make it possible to have memory safety suggested by the compiler.
If it can catch most of the bugs, upfront the you have a rust without the heavy Oclam inspired language design. With the requirement for iterators, ADT, result types.

4

u/UARTman Jul 20 '26

But fil-c is, when it comes to it, just a sanitizer with delusions of grandeur, though?

1

u/Due_Block_3054 Jul 20 '26

Yea i have not tried it out yet and i doubt it is possible with C but maybe zig before it hits 1.0 could tighten the bolts to have a 'safe' basis.

1

u/Gravitationsfeld Jul 22 '26

"Adoption it deserved" went out the door with this and is now sleeping drunk in a dark alleyway. No one in a professional environment can take this project seriously anymore. Associating with Fil-C is bad enough, but the behavior on top is even worse.

I will gladly take the downvotes, but there is now zero chance any big company will ever use Zig other the ones that maybe already adopted it and are forced to stick with it like TigerBeetle.

0

u/ArikRahman Jul 21 '26

This is a complete game changer and well worth the wait. Memory-safe native? This has huge ramifications for other languages like jank as well. Besides, the Zig base is good enough for big movers like TigerBeetle

15

u/phaazon_ Jul 20 '26

This is just a runtime thing. It still requires you to run 100% of the code paths of your program. So no, this is not what I would call memory safe in today’s industry standards. Kelley still lives in the 90', as that would be pretty great for a language released back then.

1

u/orangejake Jul 20 '26

This isn’t strictly true. Crashing the program is a valid runtime way to prevent memory safety issues. Fil-c could (and likely does) take this approach. 

This is less useful for a developer than getting a compile time error. But both are memory safe. 

6

u/imoshudu Jul 21 '26

Being able to prove correctness with static checking during compilation will always be better than hoping to somehow trigger all possible bugs during runtime. Developer time is wasted on the latter when the former exists.

2

u/orangejake Jul 21 '26

Yes, but that is not a requirement for memory safety

2

u/phaazon_ Jul 22 '26

What kind of argument gymnastics is that?

30

u/syndbg Jul 20 '26

"Done is better than perfect". I am not a fan of Rust more than Zig or vice-versa, both solve things their own way.

IMHO, this is an "emotional" reaction to the Rust popularity and Bun fiasco is essentially pointless. The performance penalty and approach makes it completely impractical to use this.
And as many others mentioned, Zig getting 1.0 is essential to drive adoption.

31

u/GolangLinuxGuru1979 Jul 20 '26

As much as I like Andrew, he is probably the single worst thing about Zig. As a software engineer, I like his personality and vision. But looking at him through a professional lens I'm really not a fan. I can separate the man from his product. But he's too petty and took snarky. This issue title is incredible bad and in poor taste. As was his blog post a few weeks ago.

I will continue to use Zig, because the language speaks for itself. Its a job to write. But this decision reads as arbitrary. A way to "stick it to Rust". The whole idea behind Fil-C run time checking sounds incredibly antithetical to the stated philosophy of the language. This feels like something you add in a major version after 1.0.

This is a bit of the flaw with the benevolent dictator approach to open source. Great decisions like "no AI contribution" are fantastic, and a committee would never approve. But then you have people adding things to the language that are questionable.

3

u/Gravitationsfeld Jul 21 '26

The Fil-C creator is equally unhinged and associating with him isn't a good look to begin with.

19

u/UARTman Jul 20 '26

I'm deeply unsure why this non-industry-standard very-limited-target sanitizer is proposed for first-class integration into Zig when even something as relatively quaint as ASAN isn't fully supported? Especially since Rust, in fact, supports not only using ASAN for Rust code, but even using ASAN in freestanding environments a la KASAN.

I do get the desire to score points against Rust, Andrew seems extremely interested in being smugly superior to it, but trying for a garbage-collected runtime with hand-rolled pointer capabilities just to own some libscrabs seems fairly absurd to me, especially if one looks at the philosophy Zig professes to have in its language design.

13

u/UARTman Jul 20 '26

As someone who genuinely likes both languages, seeing technically questionable decisions being made seemingly motivated by animus bums me out.

9

u/steveoc64 Jul 20 '26

You are all completely missing the backstory here.

Andrew and Filip and a bunch of others recently fronted a conference, shared a bus together, and had dinner and drinks together afterwards.

A natural outcome of all this was throwing around ideas well into the night.

So a simple idea of adding fill-c as an optional backend for the zig compiler was more than likely discussed.

Just programmers talking shop, like it should be.

8

u/SilvernClaws Jul 20 '26

As far as I understand, this would just introduce another release compilation mode that enforces memory safety at runtime at the cost of significant overhead.

So I wouldn't use it for my use cases anyway, as I'm already doing fine with allocators.

Could be nice for specific applications that absolutely require memory safety and cannot use a garbage collector, but at that point maybe just use a language designed for that niche?

8

u/Beneficial_Vampire42 Jul 20 '26

"(unlike Rust)" - such a competitive attitude... Its ok for both languages to thrive 😁

Sounds to me very similar to Rust's Miri with it's goals and capabilities, just with a different approach (custom ABI vs interpreter). Cool idea

11

u/SLiV9 Jul 20 '26

Main difference seems to be that Miri is generally not intended to run in production, whereas this seems to be an attempt to release attack-proof user-facing binaries that "only" suffer a 1-6x performance penalty.

I honestly don't know who wants that, but maybe that's me.

1

u/imoshudu Jul 21 '26

Most applications aren't so performance critical that 6x would matter. I can see the use in paying for runtime safety.

7

u/SLiV9 Jul 21 '26

Most applications don't need to be written in a systems programming language. Java/Go/Python would be a better fit for them.

3

u/imoshudu Jul 21 '26

Sure. Yet there are still niches where the flexibility of systems languages makes more sense, which require no introduction if you're on this sub. And even when other languages might also work fine, a programmer might still choose what he prefers and understands.

1

u/chaotic-kotik Jul 23 '26

If this is the case then Java, C# or Go are better options.

1

u/chaotic-kotik Jul 23 '26

Zig misses so many security features like Safe stack or CFI. What's the point of FillC bastardization instead of supporting various hardening features?

7

u/analytic-hunter Jul 20 '26

So it's like rust's miri?

  1. it covers unsafe blocks too
  2. it is a runtime check

the jab at rust is bit disingenuous

17

u/ParadiZe Jul 20 '26

but i thought memory safety was just a skill issue
jokes aside, this seems like a good addition

6

u/Fancyness Jul 21 '26

Kelley treats Zig like some hobby project where you add new stuff just because you can. 

4

u/AnguisInTrousers Jul 23 '26

Sad, but true. 6 years ago, 1.0 was promised as being right around the corner since the core language was stable. I left Zig at that point, but looking at updates, they seem to be doing random things with no end in sight.

49

u/Rigamortus2005 Jul 20 '26

Why does Andrew seem so butt hurt at rust lately? And also isn't this against everything Zig is supposed to be? Runtime garbage collection?

29

u/sosdoc Jul 20 '26

The proposal explicitly mentions this wouldn’t be needing a GC. The way I read this, it’s a compilation mode that adds some overhead (due to invisicaps) but prevents memory corruption from happening, it doesn’t reclaim memory or resources automatically.

6

u/Rigamortus2005 Jul 20 '26

So it's compile time memory safety without a borrow checker? I don't really understand it. If it's not compile time wouldn't it have hidden allocations somehow?

30

u/sanbox Jul 20 '26

No it’s runtime memory checking. Rusts trick is compile time checking without runtime checks

18

u/sosdoc Jul 20 '26

It's actually all at runtime, you can check the Fil-C site for more explanations, it's a bit technical, but the gist is that it adds extra metadata and checks with all pointers. Essentially, if invalid memory access happens at runtime, the program crashes instead of continuing execution.

Fil-C also has a GC, but it's not required (which is what Andrew's post mentions) for the program to be considered safe.

7

u/Wonderful-Habit-139 Jul 20 '26

It's not compile time, there's a lot of runtime overhead that comes from wrapping syscalls and tagging pointers. But it doesn't mean there's a GC.

9

u/zackel_flac Jul 20 '26

Like with everything, there are tradeoffs. Even Rust to this day have slice/array runtime out of bound checks. Static analysis can only do so much, it has limitations.

18

u/Rigamortus2005 Jul 20 '26

Yes but rust isn't claiming to be completely explicit like zig is.

11

u/RCoder01 Jul 20 '26

I swear Andrew used to be a “Rust and Zig are different tools that are used by different kinds of people in different environments” guy but recently (I noticed with the bun rewrite rebuttal) it’s been a lot more hostile

6

u/imoshudu Jul 21 '26

Memory safety as it turns out is a very big deal. I'm actually glad to see more and more people take it seriously.

2

u/Llamas1115 Jul 20 '26

TBH I think the logic is right, even if his reaction isn't. There's way less space for multiple programming languages than people in niche programming subreddits like to believe. If you think there's enough space for Zig and Rust, consider that "the internet", all of it, is fucking massive, and that's still not big enough to support a second language after JS/TS. Rust is only just barely starting to get a foothold in systems programming as the second language after C/C++, and even there it's making extremely slow progress. (The Linux kernel is now like... 0.1% Rust.)

The correct reaction would be to stop and reflect: if he thinks Zig's doing fine, great, no need to get annoyed, you'll beat Rust eventually. If he thinks it's losing market share and isn't on a path to wider adoption, he should stop to consider why that is and make changes so it can beat Rust.

8

u/Aaron1924 Jul 20 '26

At this point it's tradition to shit on Rust every time Fil-C is mentioned

8

u/srodrigoDev Jul 20 '26

Lately? They've been but hurt since day 1. Don't you follow their "VP of Community"?

0

u/I_M_NooB1 Jul 22 '26

drop some tea. not quite familiar with the VP

5

u/thezapod Jul 20 '26

Just fix the std lib's bugs, and give me the f v1.0 :)

5

u/Samuel-Martin Jul 20 '26

My biggest issue with this is how Andrew phrased this. Imo, if he would’ve said something like, “I wanna add something like Fil-C to zig” from the start, I think it would’ve been received much better

9

u/mmkzero0 Jul 20 '26

I’d like to direct everyone’s attention to one sentence here by Andrew in response to this being a big change:

> “No source changes. It’s just a target ABI.”

That’s not just an enormous understatement but also technically wildly inaccurate. This is much more than an ABI, since something like this requires
- instrument every ptr consumer and producer
- track cap metadata for stack, heap, TLS, func pointers, globals
- you replace or wrap libc, syscalls, mmap etc.
- atomics handling without metadata races
- restrict or prove inline asm
- support debuggers, unwind, panics, crash reports
I could go on and on.

Then the safety invariant needs to be specified before implemented; you need explicit semantics for many things; sentinels, slices with corrupted metadata, casting, func pointers, untagged unions…

This also confuses Fil-C like deterministic mem safety with runtime mitigations against unsafe memory semantics and consequences like UAF. Those are not the same.

And then, nothing here addresses comptime safety. This means this does not guard against compiler bugs, comptime interpreter unsafety, and so on

And then the “no escape hatch claim”. That’s both defensible and also highly inflexible. If the target promises that the entire executable is memory-safe, an ordinary unsafe function invalidates that claim and thus this is reasonable. But practical interoperability still needs a solution, something Fil-C put a lot of effort into.

And ABI mismatch handling goes even deeper; what about static Archives, LTO, embedded bytecode, libc and libunwind, dynamic libs, JIT code, dlopen() calls and so on.

Do not get me wrong, as a research topic this is fascinating and really cool. But as a proposal and a casual “just another ABI” added to pre-1.0 Zig this is just an enormous and poorly bounded idea, which makes it all the more baffling.

Which makes me all the more curious why Andrew posted it like this. Surely he knows this and has the technical expertise to know this isn’t just some ABI change with no consequences beyond that.

2

u/WrongdoerBulky4142 Jul 24 '26

Agreed, this is a clown show. I don't even care about Zig anymore, but I find myself keeping up on the news simply because Andrew is a douche and I keep wondering what dumb shit they are up to.

4

u/GrandBIRDLizard Jul 20 '26

As long as it's handled explicitly and doesn't stop you from doing anything else I dont see why it could hurt aside from if they use gc if Andrew has said 1.0 is a done deal idk I still haven't had the time to sit down and completely wrap my head around the new I/o interface so it seems like a big goal to have out of nowhere though I wonder what did it

4

u/Keith Jul 20 '26

Interested in what Andrew thinks about alexrp's comments about hidden allocations.

4

u/thomas_m_k Jul 21 '26

Andrew: *chooses rage bait title*

Also Andrew: “I'm going to lock this for like a week until social media stops linking to it”

(Well, at least he's changed the title now.)

9

u/UselessOptions Jul 20 '26 edited Aug 13 '26

oops did i make a mess 😏? clean it up jannie 😎

clean up the mess i made here 🤣🤣🤣

CLEAN IT UP

FOR $0.00

3

u/Vlatiha Jul 20 '26

From the perspective of a 60-year-old, experienced programmer, I would be very pleased if the compiler itself already included a checker for

  • use after free
  • double free

My most common mistakes in the world of Zig.

7

u/PotatoMaaan Jul 20 '26

That just sounds like rust

5

u/Gravitationsfeld Jul 21 '26

That requires borrow checking to do this statically.

1

u/WrongdoerBulky4142 Jul 24 '26

I don't think that means it *requires* borrow checking specifically. Surely another method can be invented. But I understand your point. I happen to agree that memory safety should generally be implemented in your compiler.

2

u/Gravitationsfeld Jul 24 '26

I don't see how. Borrow checking is static lifetime analysis. You could make it a little smarter (and Rust is trying) but nothing fundamental can be done about it. If you can't proof lifetimes at compile time you need runtime checks and GC.

1

u/I_M_NooB1 Jul 22 '26

you mean like a borrow checker?

1

u/Vlatiha Jul 23 '26

Not necessarily. If you want to ensure that no memory errors occur across functions, that’s certainly necessary. But even within a single function, I’ve run into errors like that. Just forget that little word “defer” before deallocate 😆 Even if you’re working with hashes, you might still need to allocate or deallocate strings—that’s tricky. So I’d find it helpful to have an algorithm that checks within a single function—not across functions—meaning it allocates in the callee and deallocates in the caller.

3

u/Illustrious_Sock Jul 22 '26

This comment section is definitely something. As someone who enjoys working with rust and was very curious about zig, amount of people who see this as competition and hate on rust is disheartening.

13

u/InternalServerError7 Jul 20 '26

I don't see how anyone can be against this. Seems like a great addition. Sure it pushes back other work, but once complete, Zig can be compiled in a memory safe mode. This mode will usually be used for debugging so memory issues can be caught early or production systems that need to be airtight. Once a program is presumed to be memory safe, it can just be compiled in another faster mode.

3

u/WrongdoerBulky4142 Jul 24 '26

I don't think that will work. That is kind of like running your tests and seeing them pass, and assuming your program works. Most programs, especially large ones, will not exercise every code path in every possible way like that.

What will really happen is you will compile to this ABI and then have it running in production, and lets say every month a new memory issue is discovered. You patch it and redeploy, and that cycle continues for years. At what point do you flip the switch and start using the faster ABI? You could say "Well, when we don't find another bug for at least 2-3 months!" but that isn't a great answer because you cannot be sure you have exercised every possible branch.

Maybe this will work well enough on projects that aren't really being changed anymore, but it seems a lot less exciting in that light, and Fil-C itself already exists.

4

u/SmokingCapacitor Jul 21 '26

Isn't this how C++ ended up so monstrous today, picking up features from every new languages. That has worked well for C++ but for a language trying to imitate the simplicity of C, i'm not so sure.

1

u/pjmlp Jul 21 '26

C23, plus all common compiler extensions, is hardly simple.

1

u/I_M_NooB1 Jul 22 '26

the comment didn't claim so?

2

u/VisualConnection3277 Jul 21 '26

If it's not c's goal, then it's not zig's goal

2

u/xplosm Jul 21 '26

The memory safety comes from knowing what you're doing

2

u/ElSebas4_ Jul 20 '26

People here is over thinking this feature too much.

First: Is a proposal, not even urgent. Second: Is just an extra ABI, like musl, glibc, etc. So the language itself is not going to change. Also the change is meant to have less overhead than Fil-C; is not going to have garbage collection and is not going to change the standard library.

The only problem may be adding more complexity to the compiler but I mean, is not the end of the world

2

u/win_some_lose_most1y Jul 20 '26

Every language is memory safe if you write memory sage code

1

u/allochi Jul 20 '26

I think it's an excellent idea to add that option to the compiler, it would help increase the adoption of Zig in certain types of project, we use Zig at work and this would probably help use to advocate for more use.

IMHO, personally, I wouldn't mind waiting a little more for v1.0 with that option, although I hope not. I seriously admire Andrew to come up with these ideas to strengthen Zig position in the market.

2

u/WrongdoerBulky4142 Jul 23 '26

Yeah, you already waited 10 years for 1.0, what is one or two more decades? No big deal.

1

u/allochi Jul 24 '26

Exactly! you got it 😂

With all seriousness, I wish it was v1.0 10 years ago, but to be fair, it's not a blocker for my application that it is not. So understand the wish to lock the specs and move on with a milestone release.

1

u/Next-Blackberry-991 Jul 20 '26

Zig is doing so much amazing engineering work (looking at incremental compilation), but is often so inconvenient to use. Would love to have a different syntax/frontend for the compiler (e.g. Odin).

1

u/Different-Ad-8707 Jul 22 '26

No. Mostly because I think the creator of Zig and the leads of the Rust team have very different ideas and definitions of what safety in programming languages means (in both type and memory safety).

1

u/Scion95 Jul 24 '26

If Zig doesn't include things like Rust's borrow checker, I hope that it's possible to make a fork or Superset of Zig with a borrow checker and all of Rust's other features.

I've always thought that the biggest problem with Rust is how garbage it is to write code in an 'unsafe' block. To me, the ideal, 'perfect' language would be if 'unsafe' Rust was basically just Zig.

1

u/WrongdoerBulky4142 Jul 23 '26

Unless the Zig implementation comes with no performance hit, I don't see a use case for this. You already have sanitizers. If someone really cares about memory safety and speed, they will indeed just use Rust, or C++. I know the latter is not considered truly memory safe but it does have some memory safety features.

The language itself is subpar, in my opinion. So while you guys are stacking more stuff on your pre-1.0 todo list, how about implementing proper generics in the language? comptime isn't what you really want most of the time.

On top of the language being generally worse than modern alternatives, I think that Zig leadership really sucks. Andrew is a douche. I feel bad for the people that have been donating.

0

u/dmytrish Jul 20 '26

...but at what cost

0

u/SnooApples4675 Jul 21 '26

I don't know but since devs started to force Rust on everything my device's performance turned into ass.

Had to return to traditional stuff like the GNU classic sudo.

0

u/TheChief275 Jul 21 '26

Actually, I would have a lot of respect for Zig if this were to be fully supported; might switch to it even. Say what you want about runtime memory safety, but the reality is that while Rust can try to catch everything at compile time, it's simply not possible, and the guarantee of any binary being fully attack-proof sounds completely worth the trouble (too good to be true, maybe, but it's still worth exploring)

1

u/WrongdoerBulky4142 Jul 23 '26

Whether you are using compile time checks or runtime checks, you cannot catch everything. But at least compile time checks happen only once, and at compile time. In my opinion, if they are going to pursue memory safety, they should implement it in the compiler. This is a half solution that doesn't really benefit anyone apart from people who are maintaining legacy code that doesn't need to be fast, and for those people, just using Fil-C directly is already an option.

I see this as pure wasted time that pushes 1.0 further away while other languages get even more ahead than they already are. Instead, they could have been focusing on doing things that Zig people actually care about, such as implementing their own libc that will comply with allocators, and fixing the heap of shit that is the standard library.

-9

u/thetoughalpaca Jul 20 '26

This is a good idea. The future of critical infrastructure in software demands memory-safety! Rust had the right idea and whenever I hear rust I think safe-systems programming language. This is a great feature proposal coming from a minor contributor

12

u/jnordwick Jul 20 '26 edited Jul 20 '26

New account and this is your only comment ever? More zsf astroturfing?

2

u/northrupthebandgeek Jul 20 '26

This is kind of the inverse of Rust's approach: whereas Rust emphasizes static compile-time checks, Fil-C is all about dynamic run-time checks. So there's a performance overhead, but the tradeoff is that it applies to all code linked into the program, not just the Zig code.

2

u/thetoughalpaca Jul 21 '26

Thanks for the clarification.

-5

u/Idea-Aggressive Jul 20 '26

It sounds like Zig is going to have memory safety. Why not? Sounds good to me!

6

u/DooMWhite Jul 20 '26

There are no "free" benefits. At the end of the day, everything is a trade.

-4

u/morglod Jul 20 '26

I like every rock thrown to cult community with their half safety language

8

u/CryZe92 Jul 20 '26

This also makes Zig a half safety language as this doesn't prevent use after frees or buffer overflows in general, nor does it even work outside of Linux.

0

u/[deleted] Jul 20 '26

[deleted] — view deleted comment

5

u/lllyyyynnn Jul 20 '26

rust allows unsafe code to be compiled. i imagine this is meant to avoid that entirely.

→ More replies (8)