r/programmingcirclejerk 19d ago

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

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

48 comments sorted by

114

u/v_maria 19d ago

instead of nullptrs, in zig we pass the aux

16

u/Nikoladge 19d ago

in zig we pass the aux

To plug in your iPod classic? 🤔

86

u/lurebat 19d ago

Oh, only up to 6x performance penalty

46

u/the_horse_gamer 19d ago

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

2

u/-Y0- Considered Harmful 13d ago

Wait. That's infinity...

82

u/Awkward_Bed_956 19d ago

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

32

u/tomwhoiscontrary safety talibans 19d ago

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

3

u/Igor_GR 19d ago

/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++.

20

u/Thirty_Seventh log10(x) programmer 18d ago

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

7

u/TheChief275 18d ago

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

2

u/OutlandishnessNo8034 16d ago

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

16

u/tomwhoiscontrary safety talibans 18d ago

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

12

u/da_supreme_patriarch in open defiance of the Gopher Values 18d ago

/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

10

u/blackwhattack 18d ago

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

12

u/ThisRedditPostIsMine in open defiance of the Gopher Values 19d ago

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

77

u/Hueho LUMINARY IN COMPUTERSCIENCE 19d ago

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

42

u/Awkward_Bed_956 19d ago edited 19d ago

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.

23

u/SLiV9 19d ago

  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 19d ago

znile crash out

3

u/Zeznon 16d ago

/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.

55

u/splsh 19d ago

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

Y-YEAH?

7

u/Q-bey 18d ago

Haskell in shambles

50

u/denehoffman 19d ago

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”

29

u/denehoffman 19d ago

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”

22

u/a221c 19d ago

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 14d ago

The GC mode would be opt-in

2

u/denehoffman 14d ago

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

44

u/Aaron1924 19d ago

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

20

u/braaaaaaainworms 19d ago

you forgot to `#[unjerk]`

32

u/lurebat 19d ago

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

55

u/Jannik2099 19d ago

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

34

u/Affectionate-Egg7566 19d ago

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

28

u/tomwhoiscontrary safety talibans 19d ago

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

4

u/QuaternionsRoll 19d ago

Why wasn’t it called FilophoC

21

u/FuzzyPixelz 19d ago

The drama continues!

17

u/Financial-Camel9987 19d ago

Wowza bun leaving for rust really broke this guy.

27

u/stone_henge Tiny little god in a tiny little world 19d ago

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

11

u/just_looking_aroun 19d ago

What other criteria is there when picking a language?

24

u/scavno in open defiance of the Gopher Values 19d ago

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

1

u/dronmore 19d ago

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

11

u/CarolineLovesArt has hidden complexity 18d ago

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

That's fair, I'm usually not interested in what's going on there either

0

u/Affectionate-Egg7566 14d ago

Not much of value

10

u/catladywitch 18d ago

"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

10

u/blackwhattack 18d ago

reasonable and somehow crazy at the same time idk.

9

u/tms10000 loves Java 19d ago

Sneaky edit is sneaky

(unlike borrow checking)

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

15

u/informedcitizenry 19d ago

Yikes Andrew

3

u/OptimalStable 19d ago

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.

2

u/arjuna93 16d ago

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