this post was submitted on 15 Nov 2023
1010 points (96.2% liked)

Programmer Humor

32473 readers
589 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 17 points 1 year ago (8 children)

Rust: it will take 10 months to build the app you want, but it will run super fast.

Zig: it will take 10 days to build the app you want, but it will run super fast.

You get to pick one cult. Which one is it?

[–] [email protected] 93 points 1 year ago* (last edited 1 year ago) (2 children)

Rust: works

Zig: segmentation fault

[–] [email protected] 17 points 1 year ago* (last edited 1 year ago)

Also no higher-order functions like map, filter, reduce etc.

Really weird design decision for a brand new language.

Comptime is pretty dope tho, I wish Rust had that instead of relying on macros so much.

[–] [email protected] 2 points 1 year ago (1 children)

So how is Zig different from C or C++, then?

[–] [email protected] 6 points 1 year ago

Much nicer than C, much simpler than C++, much less cruft than both.

[–] [email protected] 50 points 1 year ago

Rust has cute crab

Zig has scary lizard

[–] [email protected] 27 points 1 year ago (1 children)

Zig isn't even v1 and without any API stability guarantees.

[–] [email protected] 21 points 1 year ago (1 children)

It finished even faster when it crashes right?

[–] [email protected] 5 points 1 year ago

Development paradigms spearheaded by MySQL and PHP, where it was discovered that you can be really fast if you don't care about getting the right answer.

[–] [email protected] 24 points 1 year ago (1 children)

I'd like to point out, the value add of Rust isn't speed, it's safety in a low-level language. C is also just as fast, it's just that Rust guarantees safety in a wide class of potential catastrophic bugs with little to no runtime overhead, by using the design of the language and compiler.

[–] [email protected] 4 points 1 year ago

That's very true. My main issue though is the steep learning curve

[–] [email protected] 13 points 1 year ago* (last edited 1 year ago)

Idk I just wrote a simple cli tool in 2 hours in Rust. Complete with arg validation, actually helpful --help output, and parallelisation.

[–] [email protected] 12 points 1 year ago

Never heard of zig before, thanks

[–] [email protected] 6 points 1 year ago

I dunno man... having "no macros" as a selling point?

[–] [email protected] 1 points 10 months ago

I wanted to try zig a couple of times now but was always put off by lacking tooling and generally bad compiler errors. Its kinda hard to justify spending time on something if you see the compiler point out an error inside a standart lib zig file and there is no directon for a fix whatsoever. Im hoping it'll get better because the language seems really great