#Is Zig a smaller language than C?

1 messages · Page 1 of 1 (latest)

mild hare
#

ZIg's standard library is far more comprehensive than C's. Just browse the source on GitHub or look at https://ziglang.org/documentation/master/std/#A;std

I don't know how you would "count" language features, but it has features that C doesn't, but is still a very simple & consistent language.

weary vortex
#

It definitely has a more robust stdlib, which doesn't matter since you can selectively use only what you need

still oar
#

it has more features, but also gives you more power over a lot of stuff, like allocators, configurable stdlib stuff, etc

#

where C has an implicit default allocator with malloc and free, zig as a language has no knowledge of allocation directly, and instead leaves it to the user to decide how to allocate

weary vortex
#

I would personally say so

#

C has a lot of weird things going on, an artifact of its age

#

It is not complex, so it is not that bad, but there are certain choices which are unnatural to say the least (for example, the array handling is not what you would expect if you were accustomed to modern languages)

#

I guess it depends on your level of experience though

#

Zig really does not have good documentation imo

rugged lance
#

Yep. You need to realize that C has been around for decades so there is MUCH more material available for learning C. So you have more resources for learning and debugging when you get stuck. Zig has far fewer resources (but there are plenty of friendly and helpful people to help)

weary vortex
#

Language complexity is not the most relevant factor in how easy it is to learn imo

#

brainfck is super simple

#

not the easiest language to write something in though

tall galleon
loud fulcrum
# rugged lance Yep. You need to realize that C has been around for decades so there is MUCH mor...

the best part: 99.99% of that material is flat out wrong and teaches HORRIBLE practices. a friend of mine recently went through the very highly regarded book https://gustedt.gitlabpages.inria.fr/modern-c/ by one of the most well respected authorities on the c language. my friend sent me some random snippet of code from the book, asked some dumb question about it. after answering his question, i took a look at the snippet, ran it through my brain's compiler, and within like 5 minutes i had found an insidiously nasty bug caused by a misunderstanding/oversight of c's nuances that had been in the book for many years. well what do you know, my friend reported it and the author agreed and fixed it. if the literal authority on c isnt able to make a book for learning without making insidiously nasty and hard to find bugs and no one finds them until now, then maybe its hard to actually learn the c programming language

#

that bug aside, that book is 100% the best resource for learning (mostly 😂) correct C

dense willow
#

Yeah I've read this book. Its not bad but it has many incosistencies

hollow storm
rugged lance
#

Or feel free to spam, I’m interested too :)