Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Are we interested in introducing Kotin language for development? #992

Open
elonzh opened this issue Mar 17, 2023 · 4 comments
Open

Are we interested in introducing Kotin language for development? #992

elonzh opened this issue Mar 17, 2023 · 4 comments

Comments

@elonzh
Copy link
Contributor

elonzh commented Mar 17, 2023

There are several reasons why Kotlin is a great choice for Java projects:

Interoperability: Kotlin is designed to be fully interoperable with Java, which means that you can use Kotlin code alongside existing Java code seamlessly. This makes Kotlin an excellent choice for projects that require compatibility with existing Java codebases.

Concise syntax: Kotlin has a much more concise syntax compared to Java, which means that you can write code faster and with fewer errors. For example, Kotlin can eliminate boilerplate code that is necessary in Java, such as semicolons and getters/setters.

Null safety: Kotlin is designed to be null-safe, which means that it is less prone to null pointer exceptions. This is because Kotlin has a built-in null safety system that makes it easy to write code that avoids null references.

Functional programming support: Kotlin has excellent support for functional programming concepts such as lambdas, higher-order functions, and immutable data structures. This makes it easier to write code that is more expressive and easier to reason about.

Coroutines: Kotlin has built-in support for coroutines, which is a powerful concurrency feature. Coroutines make it easy to write asynchronous code that is both easy to read and efficient.

Better tooling support: Kotlin has excellent tooling support, including a plugin for IntelliJ IDEA, which makes it easy to develop, debug, and deploy Kotlin code.

Overall, Kotlin is an excellent choice for Java projects because of its interoperability with Java, concise syntax, null safety, functional programming support, coroutines, and better tooling support.

@elonzh elonzh changed the title Are you interested in introducing Kotin language for development? Are we interested in introducing Kotin language for development? Mar 17, 2023
@kermitt2
Copy link
Owner

Hi @elonzh !

@lfoppiano and I were discussing about it recently and indeed we were thinking to switch as much as possible to Kotlin now for development involving some (existing) Java environment, for all the good reasons you are listing! Kotlin is really convincing and I am only starting to discover its potential (I am always quite late in anything).

So for Grobid specifically, we could start mixing like this https://kotlinlang.org/docs/mixing-java-kotlin-intellij.html.

@elonzh
Copy link
Contributor Author

elonzh commented Mar 18, 2023

IDEA supports converting Java code to Kotlin and I have been using this for a while, it's pretty helpful in introducing Kotin language for legacy Java code.

Kotlin is my first JVM language because it's productive and I am using it to modify Grobid for some needed parts. If Kotlin is on our roadmap, maybe I can make some contributions.

@lfoppiano
Copy link
Collaborator

I haven't written much new code in Java recently, but we should kick it off in grobid to start rolling the ball.

@lfoppiano
Copy link
Collaborator

lfoppiano commented Apr 7, 2023

@elonzh I think one way to speed up the integration of kotlin in grobid would be to send a PR with the changes in gradle (I guess we need some changes in the gradle). After that I can help spreading it :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants