3 ms·
I made a very simple web service with Rocket (see https://github.com/MrBuddyCasino/alexa-auth https://github.com/MrBuddyCasino/alexa-auth), which is better but
by MrBuddyCasino 9y ago
I made a very simple web service with Rocket (see https://github.com/MrBuddyCasino/alexa-auth https://github.com/MrBuddyCasino/alexa-auth), which is better but still - I‘d go for Kotlin or Go instead if performance requirements allow it.
- geezerjay 9y agoWhy Kotlin but not Java?
- Ygg2 9y ago- JVM is a good platform? Aka if you can think about it, it's probably been done in JVM and/or Java. - Java's GC is highly customizable? - It's one of top contenders in most web related benchmarks (see: https://www.techempower.com/benchmarks/#section=data-r15&hw=ph&test=json https://www.techempower.com/benchmarks/#section=data-r15&hw=...)
- openasocket 9y agoKotlin runs on the JVM too, and easily interops with Java libraries and frameworks. So all three of your points apply equally to Kotlin as they do to Java.
- MrBuddyCasino 9y agoJava is fine, too. If I have the choice I prefer Kotlin these days. Same as if I have the money I go by taxi, not by bus.
- erpellan 9y agoKotlin is what Java would look like if it was invented today. Type inference, explicit non-nullabililty, first class functions, function types, extension methods, etc. Eveyone I know who's used Kotlin would not willingly go back to Java.
- leshow 9y agoAre you sure rocket is actually faster than the Go/JVM equivalent? I'm a big fan of Rust, and I don't deny that it's possible for it to be faster, but my understanding of where Rocket's async story is that it isn't there yet. You're also using reqwest::Client inside your handlers, which is synchronous. I'd just find it hard to believe that could beat an async JVM or Go implementation.
- MrBuddyCasino 9y agoYou're right, my statement was slightly misleading. Rocket is certainly not there yet, so it would be pointless to use it to get better performance right now. Actix however is already extremely fast and shows the potential of Rust, which _in the future_ I suppose might be a driver to pick Rust over other alternatives. Since language ergonomics and productivity are inferior over e.g. Kotlin, it would be pointless to pick where it not for technical advantages such req/s, memory usage or latency.
- leshow 9y agoYeah, I have seen actix, it looks great. The recent techempower benches have been particularly revealing of Rust's potential in this area.