5 ms·
I think Zig’s compatibility with C is such a valuable feature. I also wish we could rewrite everything in a modern language, but the reality is that we can’t a
by jonpalmisc 4y ago
I think Zig’s compatibility with C is such a valuable feature.
I also wish we could rewrite everything in a modern language, but the reality is that we can’t and that if we could, it would take a LONG time. The ability to start new projects, or extend existing ones, with a modern and more ergonomic language—Zig—and be able to seamlessly work with C is incredible.
I look forward to the self-hosted compiler being complete, and hopefully a package manager in the future. I’d really like to start using Zig for more projects.
- jitl 4y agoZig as the “Kotlin of C” makes it very appealing. Kotlin has seen fantastic adoption in JVM projects because you can convert files one at a time from .java to .kt, with only a modicum of one-time build system shenanigans up front. Then your team can gain experience gradually, fill in missing pieces like linters over time, all without redesigning your software. What zig offers is even better - because zig included a CC, you can actually reduce complexity with zig by getting a single compiler version for all platforms, rather than a fixed zig + each platform’s cc. And with it, trivially easy cross-platform builds - even with existing C code. That’s cool! Go has excellent cross-compilation, but Go with C, not so much. Rust is a powerful tool, but it’s a complex ecosystem unto itself - both conceptually and practically. It has great interoperability frameworks, but the whole set of systems comes at a substantial learning cost. Plus, porting an existing software design to Rust can be a challenge. It’s more like the “scala of C” if we’re trying to stretch the analogy past the breaking point.
- richardfey 4y agoThe "Kotlin of C", what a beautiful metaphor!
- pjmlp 4y agoKotlin has seen fantastic adoption in Android projects, because of the way Google pushes it, while stagnating Android Java on purpose. On the JVM world not really. https://www.infoq.com/news/2022/03/jrebel-report-2022/ https://www.infoq.com/news/2022/03/jrebel-report-2022/
- jitl 4y agoThat poll pours a cold bucket of water on “fantastic adoption” among all the respondents, but compare adoption of Kotlin and Java releases after Kotlin’s release. 1 in 6 respondents using language versions after 2016 are using Kotlin. I don’t think that’s too shabby.
- pjmlp 4y agoJava is still Java, regardless of the version, otherwise we should add Kotlin versions to the discussion as well.
- Grimburger 4y agoAs someone not familiar with android development, this is somewhat confusing because I always thought Google was pushing dart/flutter for mobile these days? Or is it both at once?
- jitl 4y agoDart/Flutter is their React Native competitor. It’s in the same space as Xamarin - A secondary language and UI toolkit who’s selling point is rapid development for multiple platforms. Kotlin is to Java (on Android) as Swift is to Objective-C (on Apple) - the successor primary platform language.
- Grimburger 4y agoThanks, that's a solid summary. Feels like an environment that moves so quickly (to someone like me anyway). Can barely keep up.
- Aldo_MX 4y agoI think it is better to compare Flutter with Apache Cordova / Ionic Capacitor, as Flutter actually has a DOM tree behind the scenes, but instead of using a Web View to render the application Flutter renders the app directly to a GPU Accelerated surface using Skia.
- 4y ago
- kristoff_it 4y ago> I also wish we could rewrite everything in a modern language, but the reality is that we can’t and that if we could, it would take a LONG time. The ability to start new projects, or extend existing ones, with a modern and more ergonomic language—Zig—and be able to seamlessly work with C is incredible. That's the Maintain it With Zig approach :^) https://kristoff.it/blog/maintain-it-with-zig/ https://kristoff.it/blog/maintain-it-with-zig/
- mlinksva 4y agoSounds compelling. Is there a list of projects following this advice anywhere?
- Tozen 4y agoZig is not the only one. Other newer languages like Vlang, Odin, Rust, Nim... offer strong C interop.
- jonpalmisc 4y agoCan’t speak about the others, but Rust’s C interop is nothing like Zig’s, not to mention that Zig can also compile C.