5 ms·
Do you know of any good backend web frameworks for Kotlin? I would wish for something like FastAPI for python. Kotlin may actually be a great fit for a service
by commitpizza 4y ago
Do you know of any good backend web frameworks for Kotlin? I would wish for something like FastAPI for python. Kotlin may actually be a great fit for a service I want to build and I hadn't really thought of it as an option until now.
- arein3 4y agoSpring Web MVC
- danieldisu 4y agoMicronaut, http4k
- xwowsersx 4y agoKtor https://ktor.io/ https://ktor.io/
- malsanton 4y agoJavalin https://javalin.io/ https://javalin.io/
- piaste 4y agoIf you want something old and battle-tested, Spring Boot works just fine in Kotlin. I found the extreme OO design kinda off-putting, but once I got over it I had a great time with it. KTor [0] is the 'native' web framework for Kotlin, and there's also a full-stack framework built around it that just hit version 1.0, KWeb [1]. [0] https://ktor.io https://ktor.io [1] https://kweb.io https://kweb.io
- commitpizza 4y agoWell I care more about simplicity and easy to develop in rather than battle-tested. Something like the Javalin or http4k would probably suit me the best. Of course, I have checked Ktor before, but I don't know if I particularly fancy the way they are structuring stuff. My main issue with the java ecosystem is that it's way to enterprisy for my taste. Everything is so unnecessary complex and hard to reason about, but I will take a good hard look at Kotlin before making my decision. The thing is that I am really interested in the native compilation that Kotlin offers that would be very beneficial for me and the only reason behind picking Python otherwise would be that it is a nice language and already installed on the linux environments it will run in. Basically I will have a big api and drop (preferrably) a single binary to some machines that will talk to the api. These machines will generally be outside of my control. I have looked a bit on Rust but it seems a bit too low level and hard to work with. I have looked at Deno because it can compile down to a binary but using javascript for this project seems like a bad choice. So I chose Python at first because it seemed easy to get going with, had great tooling and is already installed in the environments I will be dropping a script in.
- deleted 4y ago[deleted]
- listenallyall 4y agoHard to imagine anything less "enterprisy" than http4k. Zero dependencies, totally modular, and can easily produce a single binary that contains your web app and the web server itself. No Spring, no Tomcat, no app servers necessary. Install a reverse proxy in front to handle HTTPS. Same goes for ktor.
- treis 4y agoThat this has 5 different answers in 30 minutes is the problem I have with the Java/Kotlin ecosystem. There's just so much to figure out before you write a line of code.
- commitpizza 4y agoPersonally, I like that I have lots of options available. Compare it to .NET and it's "Microsoft way or the high way".
- pfarrell 4y agoAgreed. Having to the ability to make those decisions is a feature of Java development, not a bug. YMMV.
- hardware2win 4y agoBoth approaches have pros and cons I prefer having one decent tool thats used across almost all projects like asp net for web instead of 5 things with their own quirks and pros cons Its annoying to have to relearn boring things on company change Like orms, web frameworks, etc. When you need custom solutions then you gotta put effort anyway
- kaba0 4y agoWell, spring is pretty much exactly that, and is probably used more than all the other mentioned projects combined.
- dotdi 4y agoNobody mentioned this yet: Vert.x It has great Kotlin support, including Coroutines. I've introduced it into our team for a major rewrite and we are very happy about 18 months in.
- pfarrell 4y agoA few years ago, I used dropwizard for both a service that ran locally and for the cloud backend at a startup. Kotlin meshed very well and we never encountered any issues with either. Also just worked on a project that used micronaut which was less mature and not very intuitive, but did support Scala and Kotlin (a goal in that project).