4 ms·
Zig 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 .
by jitl 5y ago
Zig 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 5y agoThe "Kotlin of C", what a beautiful metaphor!
- pjmlp 5y 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 5y 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 5y agoJava is still Java, regardless of the version, otherwise we should add Kotlin versions to the discussion as well.
- Grimburger 5y 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 5y 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 5y 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 5y 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.
- charcircuit 5y agoFrom talking to a Googler the reason why Google devotes resources to Kotlin is that there was and still is a large external demand from the Android development community for Kotlin.
- pjmlp 5y agoKotlin adoption was triggered from inside, with some anti-Java attitude. https://talkingkotlin.com/the-first-kotlin-commit-in-android/ https://talkingkotlin.com/the-first-kotlin-commit-in-android...
- 5y ago
- holoduke 5y agoAre they pushing? Most documentation for Android dev is still Java. Or by default Java. It's only the Intelij guys pushing for Kotlin by creating a lockin in their IDE. One reason I refuse to use it.
- pjmlp 5y agoYou have missed all the Kotlin only Jetpack libraries, NDK documentation now using Kotlin, Jetpack libraries originally released in Java now rewritten in Kotlin. They are still using Android Java on the system layers, because they aren't rewriting the whole stack. Even the update for Java 11 LTS subset on Android 13 is mostly likely caused by the Java ecosystem moving forward, than the willingness of Android team to support anything other than what can be desugared into Java 8 / DEX somehow. You are right in relation to JetBrains, they even acknowledge it on their blog post introducing Kotlin. https://blog.jetbrains.com/kotlin/2011/08/why-jetbrains-needs-kotlin/ https://blog.jetbrains.com/kotlin/2011/08/why-jetbrains-need... "And while the development tools for Kotlin itself are going to be free and open-source, the support for the enterprise development frameworks and tools will remain part of IntelliJ IDEA Ultimate, the commercial version of the IDE. And of course the framework support will be fully integrated with Kotlin."
- sedatk 5y ago> You have missed all the Kotlin only Jetpack libraries, NDK documentation now using Kotlin, Jetpack libraries originally released in Java now rewritten in Kotlin. Also, Oracle's lawsuit against Google for copying Java APIs.
- pjmlp 5y agoThis doesn't compute, because Kotlin is heavily dependent on the Java ecosystem, regardless how Google screw up Sun and the Java community with their Android Java.
- sedatk 5y agoI still see it as a passive aggressive move for Google to get back at Oracle. They can't back away from Java API completely but they can hurt Oracle by discrediting Java language.
- exikyut 5y agoHuh. I read about this the other day as well - https://news.ycombinator.com/item?id=30842602 https://news.ycombinator.com/item?id=30842602: > If only [Oracle] hadn't sued Google, Java would still have been the pre-eminent language for Android development. Sadly Android is stuck at legacy Java 8 permanently now. So, modern Java is stuck as a server-side language with dozens of competitors. A reply argued that Android is on Java 11 now, and then you noted (hi!) that it's "a subset". Huh. I'm trying to get a handle on understanding the ramifications of the legal/licensing situation, and the actual concrete impact on Java's use in Android. The subject seems somewhat murky and opaque. Is there possibly a high-level disambiguation about what's going on published anywhere?
- pjmlp 5y agoThe set of Java 11 LTS features and standard library missing from Android 13 is left as exercise for the reader, they are relatively easy to find out, hence subset. You can check the Javadoc for the standard library, and the JVM specification. Then compare with DEX/ART and the Android documentation for Java APIs.
- kaba0 5y agoThe whole Oracle google lawsuit had nothing to do with modern Android’s use of Java — java has been open-sourced since and for a long time now (by oracle themselves). The lawsuit was about Sun’s license that explicitly demanded a purchase for use on mobile devices for their Java programming language (as that was the area they wanted to get money from). Google instead copied most of the APIs and called it a day, and Oracle bought Sun and went after the lawsuit. But since the license changed in the meantime so that OpenJDK is completely open-source and has the same license as the Linux kernel, it was all about an older state of things.