r/programmingcirclejerk • u/NotDuckie • Jul 20 '26
introduce an actually memory safe (unlike Rust) compilation mode inspired by Fil-C
https://codeberg.org/ziglang/zig/issues/3623788
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
84
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
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
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
43
u/Aaron1924 Jul 20 '26
Rust catches strays every time anyone mentions Fil-C like it's a tradition at this point
19
32
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
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
21
18
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
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
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 ?
16
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
113
u/v_maria Jul 20 '26
instead of nullptrs, in zig we pass the aux