3 ms·
Wouldn’t Kotlin be a more reasonable choice in that case? It has ADTs and a lot of the same niceties of Rust.
by hardwaregeek 1y ago
Wouldn’t Kotlin be a more reasonable choice in that case? It has ADTs and a lot of the same niceties of Rust.
- actionfromafar 1y agoGarbage collector in Kotlin makes it a no go for C or C++ displacement.
- pjmlp 1y agoAs someone that has left pure C++ applications in 2006, and has mostly written mixed language projects since 1999, usually the displacement is more religious than anything else. In many use cases even if the performance is within the project delivery deadlines there will worthless discussions about performance benchmarks completly irrelevant to the task at hand. And ironically many of the same folks are using Electron based apps for their workflows.
- Artamus 1y agoI'm inclined to think that the Python -> Rust was only for some odds and ends. I know the biggest recipient of Rust trainings was the Android platform team at first, which I think also used a lot of C++. Kotlin is definitely available at Google, but when talking about sym types et al it's not nearly as nice to use as Rust / OCaml.
- sureglymop 1y agoYes. It can also be compiled to native. I just think it was held back too much by the java/jvm backwards compatibility but then again that's probably also the justification for its existence. I definitely find it (and jetpack compose) make developing android apps a much better experience than it used to be. What I like a lot about Kotlin are its well written documentation and the trailing lambdas feature. That is definitely directly OCaml inspired (though I also recently saw it in a newer language, the "use" feature in Gleam). But in Kotlin it looks nicer imo. Allows declarative code to look pretty much like json which makes it more beginner friendly than the use syntax. But Kotlin doesn't really significantly stand out among Java, C#, Swift, Go, etc. And so it is kind of doomed to be a somewhat domain specific language imo.
- DerArzt 1y agoI wouldn't say it's doomed. For projects in large organizations that have a large amount of java already, it provides better ergonomics while allowing interop with the existing company ecosystem.
- deleted 1y ago[deleted]
- pjmlp 1y agoJava is castrated on purpose on Android as means to sell Kotlin. If that wasn't the case, Google would support Java latest with all features, alongside Kotlin, and let the best win. See how much market update Kotlin has outside Android, when it isn't being pushed and needs to compete against Java vLatest on equal terms.
- StopDisinfo910 1y agoBlame Oracle. If they had been more forward looking and a bit less greedy, Java vLatest would be the default language on Android.
- pjmlp 1y agoNot at all, I stand by Oracle on their lawsuit. Android is Google's J++, which Sun sued and won. Kotlin is Google's C#. Plus everyone keeps forgetting Kotlin is a JVM based language, Android Studio and Gradle are implemented in JVM languages, JVM are implemented in a mix of C, C++ and Java (zero Kotlin), Android still uses Java, only that Google only takes out of OpenJDK what they feel like, and currentl that is Java 17 LTS, most of the work on OpenJDK was done by Oracle employees.
- StopDisinfo910 1y ago> Not at all, I stand by Oracle on their lawsuit. I think it will be very hard for us to find anything in common to agree on then. Anyway, it’s pretty clear Google is pushing Kotlin because they don’t want to have anything to do with Oracle which has not been cleared by the verdict of their last trial. The situation has nothing to do with anything technical. Blaming them for pushing Kotlin when the alternative you offer is them using a language they have already been sued for their use of seems extremely misguided to me.
- rendaw 1y agoI think GP means "algebraic data types" not "abstract data types", probably specifically tagged unions. Both Kotlin and Java can (now) do something similar with sealed classes but it's quite less ergonomic.
- swiftcoder 1y agoPotentially, but Kotlin is even more recent that Rust, and didn't get blessed internally at Google till somewhat later
- michaelcampbell 1y agoKotlin never had the "shiny new" aspect to it that Rust did; everyone gave it a bit of side-eye for coming from a company that wrote the IDE to support it well.