General statistics
List of Youtube channels
Youtube commenter search
Distinguished comments
About
Mathew Gordon
Developer Voices
comments
Comments by "Mathew Gordon" (@mgord9518) on "Developer Voices" channel.
Previous
1
Next
...
All
Zig and C are extremely close in terms of performance, close enough that they should be considered identical for real life use cases. For example, I implemented Base91 in Zig, directly copying the C implementation it originated in. My Zig version is faster than Clang + Musl, Clang + GlibC and GCC + Musl, but slower than GCC + GlibC. Is Zig faster than C? Completely depends on what you're doing, what compiler and libc you use.
2
Yeah I find myself mostly just reading the standard library for help, luckily it's pretty easy to read.
2
@HairyPixels LLVM is extremely complex and HUGE, Zig's experimental machine code backends are already leagues ahead in terms of speed. Zig having its own backend means they can specifically tailor it for Zig's needs instead of trying to build Zig around LLVM's quirks. Zig without LLVM is about 5MB in size, Zig with LLVM is over 100MB. "Why can't they fix this?" probably because they have little competition thus no motive to do so.
2
"If a language can't do something well or at all, you should extend it to do so" That's how you get the ridiculous clusterfuck of syntax and features that is C++. Sometimes it's better to have a clean start without the warts of an outdated foundation.
2
@_slier I find Zig's syntax elegant. It's extremely readable and consistent
2
@ssmith5048 Yes... 5 years is the early stages for a language that intends to not release as a shitty language. I'd be weary of any language that hits 1.0 in less than 5-10 years.
2
@zachend2750 That can apply to any language. Fact of the matter is that you HAVE to use the stable interface that the OS gives you if you actually want your executables to continue working past an OS update. Linux is the only mainstream OS with a stable syscall interface thus the only big OS that supports truly static executables, Windows only provides win32 and other APIs, macOS only provides LibSystem. So Go does need libc (or whatever system API) for Windows and macOS, as does Zig, as does any other compiled language.
2
@kristoff-it Zig's build system also has some amazing cross-compilation. I spent days trying to build a C project for ARM using Meson, ended up just having to throw it in a VM for whatever arch I was building for. Then I made some Zig bindings for that project (had some other use cases) and now building is literally as simple as specifying what CPU to use.
1
@zachend2750 Regardless of how you feel about it it's just how it is. An OS can choose how to supply functionality to programmers, whether it's through a syscall or an API
1
@bionic_batman Normally it does, although you can also statically link libc so that you won't need libc on the host system (at least on Linux) Although this is a giant pain in the ass so I've actually seen a few people use Zig to help compile CGo statically
1
@khatharrmalkavian3306 Yeah, the goliath Zig and its massive big-tech funding from rich hobbyists vs the little guys: Rust (Mozilla), Go (Google) and C
1
Previous
1
Next
...
All