Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Just to be clear: Zig is just as memory unsafe as C and C++
It's a really cool language, but on the memory safety side it has nothing in common with Rust
And on the thread safety side, no systems language can even dream to come close to Rusts guarantees -
@12bitfloat every system language that would come close to rust regarding syntax would be their worst nightmare. I could not even use Rust in same sentence as dream. In exception of that sentence fuck. A nice programming language for people lacking discipline..
-
3dgoosee861d@12bitfloat Rust is the safest of all, I know, but Zig got at least panics for division by zero, max integer addition, null pointer dereference and out-of-bound memory access.
Most segfault cases. -
Sometimes, you just want to divide by zero... sometimes you just want to crash your game...
...like when e.g. you want to test your crash uploader's mechanics. -
12bitfloat1086622h@whimsical Let's do a challenge: I write a reference conformant Rust parser and you write a conformant C parser, let's see who finishes first lol
(and we're not even talking about C++... good fucking luck with that)
hint: for variables, pointer-ness is a property of the variable, not the type.
`int* a, b;` declares a as int* and b as int. Lot's of fun, that is -
BordedDev296122h@12bitfloat You make it sound like it's hard, C compilers were written by hand before you were born XD -
12bitfloat1086622h@BordedDev Okay big boy, write one then :P
You guys shit on Rusts syntax but have no idea how hard C and C++ are to parse, yet you claim they have such beautiful syntax
As someone that had the misfortune of writing a compiler for a very old pascal inspired language I can tell you, syntax of old languages sucks hard. So many edge cases, special rules, rules changing based on context, etc. -
AlgoRythm5017317hI’m probably the biggest Zig fan on this app and I just can’t recommend it right now. Head Honcho Alex keeps fucking up the standard library because he’s chasing perfection.
The comptime stuff is probably the absolute best part of Zig. It’s the best comptime system of any language, by far, by miles and miles. -
AlgoRythm5017317h@D-4got10-01 you can never divide by zero if you’re good friends with uncle epsilon! -
12bitfloat1086616h@AlgoRythm The fact that unused variables and tabs for indentation are compile errors in Zig is so absurd. I really want to learn the language at some point but pointless anti-user stuff like this is really unfortunate -
BordedDev296114h@12bitfloat Maybe I will, but just the AST part, do you want to write a rust one? -
AlgoRythm5017313h@12bitfloat tabs thing is a bit dumb but I never even knew about it. I just used spaces anyways. Unused variables bring errors is fine IMO.
I liked the way Zig held me to a higher standard while I was writing in it. The whole language is that way. The stdlib forces you to think with efficiency, most things avoid heap allocations so you need to learn new ways to split strings etc -
12bitfloat1086612h@AlgoRythm Yeah that's Andrews justification: add "friction"
I appreciate the motivation but I think his conclusions are kinda stupid. At the end of the day we are all adults, I don't need my language to force me to use all variables lest I am too stupid to write good code
I'm a big boy who's mature enough to clean up my warnings once I'm done writing something. But in the middle of development I don't want to be bothered by a pedantic helicopter parent who thinks I'm too dumb to realize warnings are bad
It's not like we're talking about C++, where a warning could either mean you have one indentation too much or your entire application is *probably* UB because you violated aliasing
There, sure, make warnings errors. But not for something dumb like an unused variable -
12bitfloat1086612h@BordedDev Not really :P I'm too busy with other stuff. I might implement a C parser in Rust though. I need a frontend for my compiler anyways because manually constructing the syntax tree is getting kinda old... -
D-4got10-01248111h@AlgoRythm > 'you can never divide by zero if you’re good friends with uncle epsilon!'
Thanks. I actually had to look it up. It's been so long since I attended a math class. I'll have to remember this one. -
D-4got10-01248111h@3dgoosee > 'you guys have multiple envs?
I have production - and that's it'
Fortunately, yes. Dev && Prod are separated. -
@12bitfloat Ah so you admit writing the Rust parser would be more work than a C one
-
12bitfloat1086636m@BordedDev Absolutely not. I just need some language to drive my backend, and C is well known (so good for a portfolio project) and simpler than any of the other well known low level languages I could implement. Parsing Rust would be way easier, the borrow checker is what sucks to implement :P
Related Rants

I finally got it working! Now I have a foundation for a kernel and an uefi bootloader written in pure Rust
To...
So today I was reading a paper on different languages and I saw how good Zig is on the paper:
- same performance as C
- memory safety (underlined behavior, not trump's one)and rust
Basically the same with concurrency
Maybe I will need to switch languages;
Any arguments for C except the ecosystem, it's age/maturity and easy syntax?
rant
zig
rust
v