-
Notifications
You must be signed in to change notification settings - Fork 43
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
[Feature Request] Use Kotlin #26
Comments
I didn't know about Kotlin. |
Yeah I just came across it a week ago catching up on some Reactive programming with Spring. It looks like a lot of fun to program with. All the latest Java goodies, but far less verbose, and great support from IntelliJIdea (The creators). And as I mentioned you can choose to compile to any Java runtime, so kiss the "Should we move to Java ... discussion" goodbye. Should help a lot with the fluid API stuff too, as constructors support named arguments. Also IntelliJ lets you auto convert java files to Kotlin. Just cut past convert. |
Compiling to Javascript could add a lot of value as well. For example searching for linear programming on https://www.npmjs.com/ leads to packages / modules like: https://www.npmjs.com/package/javascript-lp-solver This has very good documentation and ( I just found it) looks like its very easy to use and play around with. So if Hipparchus compiles to javascript and releases to NPM it gets a whole new set of testers / users. |
Incidentally I created a hipparchus-math organization on NPM just so that no one else grabs it. It enables packages to live under So for example the |
At this point I'm not for or against the proposal, but I think there are a couple more points to consider. Using Kotlin would add a runtime dependency for Hipparchus because Kotlin comes with its own standard library. This would be Hipparchus' first external dependency. As far as I can tell the only IDE with good support for Kotlin is IDEA, which means all Hipparchus developers would be forced to use IDEA. I don't mind because I already use it, but we should make sure the other developers are OK with it. We currently have extensive tooling that works well for Java, i.e. Javadoc, JXR, Findbugs, Jacoco, and Checkstyle. Are there equivalents for Kotlin? Or do our existing maven plugins support Kotlin? |
Wow - I did not know it created a runtime dependency - thanks for pointing that out. There is an eclipse plugin for kotlin - although it looks fairly new. Atom also has a syntax highlighter (lightweight tasks). When I looked up static code analysis for Kotlin I came across detekt which looks interesting. There's also Dokka for documentation. Once you start getting into the Javascript / Typescript world there are some crazy good tools - like compodoc for Angularjs. Kotlin looks a lot like Typescript so I suspect we'll see a lot more goodness like that arriving in the Kotlin ecosystem. Kotlin has ktlint for linting. |
Another thing to consider is that it's really easy to prototype and play with code in Typescript and Javascript. For example checkout this How to make a blockchain in 15 minutes video. So with these types of capabilities there's a lot more ways to triangulate on / tool up code creation, testing, distribution, and maintenance activities. Having the code base in two different format allows CI to run different tool sets against the code bases. On commit Kotlin could automatically compile to Javascript / Typescript and tools that are built for these domains could be automatically run by Travis. |
Hi all, Hope this project keeps growing! Good luck :) |
@shiMusa I'm a huge fan of Kotlin and use it on JVM projects when I have the choice. Is there something that the standard Java bridge in Kotlin isn't doing well or you are saying adding some Kotlin specific decorators could make it even better? |
Kotlin has a lot of slick features, like eliminating the need for builders, etc. through named arguments, that I think would be useful for Hipparchus. Also you can compile to both Javascript and various versions of JVMs. See:
https://stackoverflow.com/questions/46858270/does-there-exist-a-babel-like-compiler-for-java
https://stackoverflow.com/questions/46892929/are-number-operations-using-kotlin-as-fast-as-the-equivalent-with-java-primitive
General info:
https://medium.com/@magnus.chatt/why-you-should-totally-switch-to-kotlin-c7bbde9e10d5
The val property (Non modifiable properties) will be really helpful in thread safe designs ...
Could compile to Javascript / Typescript and publish on NPM - which should bring more contributors into the fold.
The text was updated successfully, but these errors were encountered: