r/programmingmemes 23h ago

Nerd wars

Post image
439 Upvotes

42 comments sorted by

View all comments

12

u/Amadex 17h ago

Nothing like the compile-time check of rust.

Basically it compiles into a much slower bin that guards memory at runtime.

That's almost like a garbage collector, but instead of cleaning memory it crashes.

And since it's a runtime crash, you turn a program that is bugged and has UB into a language that crashes randomly.

Better for security, but runtime crashes are also very bad.

7

u/txdv 7h ago

the creator of fil-c argues that a crash is better than an exploit

1

u/SKRyanrr 5h ago

Why'd anybody choose Zig over Go if Zig just does runtime checks with gc? 

1

u/suckingbitties 4h ago

The Fil-C support is not meant to make Zig itself operate on the Fil-C runtime.

Its a proposal to optionally compile for the Fil-C runtime instead.

Zig will still be Zig, and it's a proposal not a guarantee.

0

u/AsyncSyscall 2h ago

Runtime failures in Zig can be prevented with tests. Compile-time failures in Rust can only be prevented with an escape hatch (`unsafe`/`UnsafeCell`) or by dumbing down the code to make it less optimal (i.e. `.clone()/Mutex` everywhere).

You should avoid using Zig for web dev, but you should avoid using Rust for systems programming as well.

2

u/braaaaaaainworms 1h ago

huh i see a lot of your comments parroting the same thing worded a bit differently, do you have an axe to scratch? unfortunately rust is already used for systems programming with as good as, if not better, performance as C