top | item 28365350

(no title)

vbsteven | 4 years ago

Author here, let me nuance a little bit what I mean with "cross-platform world".

It's 2021 and there are 3 major desktop and 2 major mobile platforms, plus some smaller ones on each side. And then there is the Web, which is both mobile and desktop focused.

If you're going to write a new library that you want to use on all of these platforms, you need a programming language that works on all of these. For iOS Java is a non starter because as far as I know there is no proper JVM that can be used in App Store apps. C can target all these platforms (including the web using WebAssembly) but it is a major pain to setup the tooling for every platform, especially if your library needs complex dependencies for things like SSL.

I am not a Rust zealot that advocates rewriting everything in Rust. I only mentioned Rust once in the whole article so your "obviously" comment doesn't really hold. The reason I mentioned Rust as a language for my project is because it is one of the modern languages that have cross-platform building and dependency management builtin from the start. It is a lot less work to write an SSL-enabled library in Rust that can be used on all these platforms than it is to write one in C.

discuss

order

AshamedCaptain|4 years ago

> For iOS Java is a non starter because as far as I know there is no proper JVM that can be used in App Store apps.

I am assuming the only ways are without a JVM, like what Scala does.

> C can target all these platforms (including the web using WebAssembly) but it is a major pain to setup the tooling for every platform, especially if your library needs complex dependencies for things like SSL.

You mean dependencies for things like "a specific SSL implementation in this language" which happens not to be in the platforms where you want to ship. If you use the system SSL implementations, then you don't have this problem.

> I only mentioned Rust once in the whole article so your "obviously" comment doesn't really hold.

"Old language" and/or "unmaintained" are basically in the Cons section for every server package, even when they've had releases within the last year! And then the conclusion goes to mention the need to do something "modern" (I hate "modern" used generically like that) and goes on to only mention Rust...

> The reason I mentioned Rust as a language for my project is because it is one of the modern languages that have cross-platform building and dependency management builtin from the start

"dependency management" here probably means bundling an SSL implementation with your package, of course. Not only you are doing a disservice to everyone except for yourself by doing that (since now your binaries have an effective expiration date, they don't respect the system's certificate stores, etc.), but it is also against the advice of the 2 mentioned mobile platforms themselves, which recommend using their native SSL rather than bundling (e.g. NSStreams for iOS, and Android ... well, Android's official API is still Java...).

And the problem is, if you were comparing these languages and said "oh, it's more complicated to use than the preferred languages in iOS and/or Android", I might agree. But comparing it to Rust, however "incredible" tooling it may have...

tighter_wires|4 years ago

> For iOS Java is a non starter because as far as I know there is no proper JVM that can be used in App Store apps.

Sure but Kotlin is used in many apps and compiles to iOS natively.