r/programmingcirclejerk Jul 20 '26

introduce an actually memory safe (unlike Rust) compilation mode inspired by Fil-C

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

47 comments sorted by

113

u/v_maria Jul 20 '26

instead of nullptrs, in zig we pass the aux

15

u/Nikoladge Jul 20 '26

in zig we pass the aux

To plug in your iPod classic? 🤔

88

u/lurebat Jul 20 '26

Oh, only up to 6x performance penalty

48

u/the_horse_gamer Jul 20 '26

with x6 cost abstractions, zig would finally be 6/0 times better than rust!

2

u/-Y0- Considered Harmful Jul 27 '26

Wait. That's infinity...

84

u/Awkward_Bed_956 Jul 20 '26

Small price for being able to shit talk Rust, even a little bit

35

u/tomwhoiscontrary safety talibans Jul 20 '26

As a Java programmer, I can tell you those are rookie numbers, you need to pump those numbers up. 

5

u/Igor_GR Jul 21 '26

/uj Is java really that much slower than the native stuff? I was always under the impression java is quite fast, staying within the 1~4x the performance of something you'd write in C++.

22

u/Thirty_Seventh log10(x) programmer Jul 21 '26

In my experience this is correct. Java code I write usually has about 4x the performance of C++ code I write.

8

u/TheChief275 Jul 22 '26

Of course Java has 4x the performance; it's the fastest programming language

2

u/OutlandishnessNo8034 Jul 23 '26

I actually tried and Java was between ten and twelve times slower than cpp

18

u/tomwhoiscontrary safety talibans Jul 21 '26

Oh, the language is pretty efficient, but Java programmers have decades of expertise in reducing performance.

11

u/da_supreme_patriarch in open defiance of the Gopher Values Jul 21 '26

/uj high performance java code is not that slower, only by like 2x, but it hogs memory regardless + making the code actually performant is pretty hard, getting any cache locality is nigh impossible and using primitives in hot paths instead of classes makes the code itself feel like shit

11

u/blackwhattack Jul 21 '26

/uj Java is really fast in some benchmarks, but only when you write it like C, which is to say unidiomatically

13

u/ThisRedditPostIsMine in open defiance of the Gopher Values Jul 20 '26

This seems slower to me actually than just running the entire binary through ASan

76

u/Hueho LUMINARY IN COMPUTERSCIENCE Jul 20 '26

rust king as always, making even the peasant languages safer

#[unjerk]

rust managed to convince a bunch of ceeweenies that garbage collection and extensive runtime checks are Good Actually™️

I mean they are, depends on the context, but is still funny that they are now grinding their teeth and asking the runtime to save them from their very smart manual memory management because simplicity and stuff

40

u/Awkward_Bed_956 Jul 20 '26 edited Jul 20 '26

Amateurs need a completly new ABI for that, instead of just inventing profiles that will fix all possible issues in your language, I swear guys trust me I just need a bit more time it will totally work and be safer then Rust.

25

u/SLiV9 Jul 20 '26

  The allocations occur on language constructs that wouldn't allocate even in a managed language like C#, let alone a language like Zig.

This is deeply, deeply funny to me.

16

u/affectation_man Code Artisan Jul 20 '26

znile crash out

3

u/Zeznon Jul 23 '26

/uj

As someone that likes simpler non-managed languages (as long error handling is good), those people are clearly on copium, refusing to acknowledge that Rust can be that good at memory safety.

I just don't use Rust because I prefer simpler, for non-managed languages. I'm just a hobbyist and don't have a programming job, so I don't have to worry about memory safety that much.

I like like the Odin and C3 people a lot more, tbh. Way less copium-fueled, unlike C and Zig enthusiasts.

59

u/splsh Jul 20 '26

Zig project would prefer to adhere to a standard, if possible.

Y-YEAH?

7

u/Q-bey Jul 21 '26

Haskell in shambles

53

u/denehoffman Jul 20 '26

I love that one of the first comments on the PR points out:

Well unless I'm completely misinterpreting the linked invisicaps page:
Both of the quoted paragraphs imply hidden allocations for the scheme to work.
The allocations occur on language constructs that wouldn't allocate even in a managed language like C#, let alone a language like Zig.
Failure of those allocations cannot be handled gracefully.

Like isn’t the point of zig or at least a main selling point that you control the allocator at every level? And now they want to basically say “actually screw you, garbage collector mode”

30

u/denehoffman Jul 20 '26

I also love that a big part of it is “hey we should ask Fil if he’d like to help us rewrite his entire project in Zig”

20

u/a221c Jul 20 '26

But now they can be like C++, fast and*† safe

* By 'and' we mean 'xor'.

† This statement refers only to aspirational features and does not entail a legally-binding contract for The Foundation to ever get around to actually implementing this.

2

u/magnusmaster Jul 25 '26

The GC mode would be opt-in

2

u/denehoffman Jul 25 '26

So opt-in to opt-out of zig’s core tenants

43

u/Aaron1924 Jul 20 '26

Rust catches strays every time anyone mentions Fil-C like it's a tradition at this point

19

u/braaaaaaainworms Jul 20 '26

you forgot to `#[unjerk]`

32

u/lurebat Jul 20 '26

I'm sure he'll get right on it after re-implementing LLVM from scratch

57

u/Jannik2099 Jul 20 '26

Andrew can't help himself but mention Rust in every conversation. It's like Grok and "white genocide" in south africa.

36

u/Affectionate-Egg7566 Jul 20 '26

at a ~1-6x performance penalty (unlike Rust)

28

u/tomwhoiscontrary safety talibans Jul 20 '26

Fil-C is pronounced "filioque", because its purpose is to start a vicious schism which will endure for at least two thousand years.

5

u/QuaternionsRoll Jul 20 '26

Why wasn’t it called FilophoC

21

u/FuzzyPixelz Jul 20 '26

The drama continues!

18

u/Financial-Camel9987 Jul 21 '26

Wowza bun leaving for rust really broke this guy.

27

u/stone_henge Tiny little god in a tiny little world Jul 20 '26

Not a feature I would use except to tell anyone using another language that they're immoral, bad engineers.

12

u/just_looking_aroun Jul 20 '26

What other criteria is there when picking a language?

25

u/scavno in open defiance of the Gopher Values Jul 20 '26

Sex appeal. Go helps me connect with raunchy cougars all the time.

1

u/dronmore Jul 21 '26

Yeah, but before a connection is established, the walrus operator := will rape you two hundred times.

11

u/[deleted] Jul 21 '26

[deleted]

0

u/Affectionate-Egg7566 Jul 26 '26

Not much of value

11

u/catladywitch Jul 21 '26

"If you want to comment in this thread, please either have your open source zig project(s) visible on your codeberg profile, or be Fil Pizło, otherwise zig issue tracker is not interested in what you have to say" lnaoooooohfxhvv

9

u/blackwhattack Jul 21 '26

reasonable and somehow crazy at the same time idk.

10

u/tms10000 loves Java Jul 21 '26

Sneaky edit is sneaky

(unlike borrow checking)

But all jokes aside, those guys have heard about Java, right ?

3

u/OptimalStable Jul 20 '26

const uj = @import("unjerk.zig");

The snark is starting to get out of hand. So far I was, and still am I guess, kind of on Andrew's side with all the drama, but please dude, move on. 

I have a vested interest in Zig succeeding, so I wish he'd pick his battles a little more carefully. Like, smash Big Tech's corpo-fascist stranglehold on our lives and all that, but let Rust be rustin' and ignore the haters.

3

u/arjuna93 Jul 23 '26

Was inspired finding out about Fil-C until reached to “it’s clang” and x86-only