Kotlin for Creation and Apis: Only for Android?

Asked

Viewed 129 times

3

I saw some features offered by the Kotlin tool, especially when it comes to saving lines of code and verbosity generated in Java.

How is the tool to generate services and be consumed by web applications? Like Angular 2+, for example... The language would have this support?

2 answers

3


Kotlin is a language like any other. It has no binding with specific technology and is able to perform anything. Exception is any language that has limitations on use.

Of course, the support of libraries and extra tools always varies from language to language. Kotlin can be used as backend web without problems, but there is no support as good as other solutions, even having a community, today, still small. But almost everything that serves Java serves it to a greater or lesser degree, so the support is not so small.

Angular is a technology of frontend (I’ve even seen people using on backend, but not in the normal way). The support in browsers for languages other than Javascript is recent. Kotlin even has a Javascript generation mode, but when it can generate its own code it will become more powerful. In any case it is possible to integrate with Angular, but it will make little sense, and will have little compatibility. It will be more interesting to have a framework of it to replace Angular in the browser. But of course, if it is used in backend, can communicate smoothly with the client running Angular, are completely different things that communicate by universal protocols.

  • Cool... I’m looking to find a scenario for a new project I’m developing... In fact, I already have many tricks with Js and Ts, and I am integrating closer to Java, however, it is extremely verbose. I took a look at Groovy tbm, I found it interesting!

3

Yes, it is perfectly possible to build your backend with Kotlin.

One of Kotlin’s top priorities is to offer interoperability with Java. So virtually every library / frameworks you would use to build your Java backend can be used with Kotlin.

A great example today is the Spring, one of the largest web frameworks for Java, which already offers Kotlin support for more than two years.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.