-
Notifications
You must be signed in to change notification settings - Fork 60
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
Migrate code to Kotlin #242
base: master
Are you sure you want to change the base?
Conversation
3e37d48
to
b4dc108
Compare
@Pitterling, any thoughts? |
99a32ec
to
d930008
Compare
May I kindly ask, what is the benefit of this migration? |
Null safety, better stdlib for collections, etc |
Ok, I expected something different that is specific to this project particularly. To me Kotlin has different a knowledge curve, longer compilation time, and IDEA IDE as a prerequisite. |
Frankly speaking, I do not think there's "the killer feature which makes Kotlin the only solution". However: I just do not want to read and maintain code that looks like https://github.com/openjdk/jdk/blob/739769c8fc4b496f08a92225a12d07414537b6c0/src/jdk.compiler/share/classes/com/sun/tools/javac/platform/PlatformUtils.java#L44-L65 Just in case, most of the current code in PR is auto-conversion from Java with minor cleanup, so it does not mean the current .kt files are "the best". For instance, I think it is worth replacing SAX (event-style) parsing of the configuration files with DOM-like parser that would read the document and convert it all at once. Currently, the parser is "too clever" (see I am sure there are cases when slightly less efficient code is good enough, so even if migration to Kotlin would increase compilation times I do not really care since speeding up the Kotlin compiler is in the priorities of the Kotlin team (see the roadmap ), and the compilation does include type verification (e.g. data types, null safety). So it reduces the number of tests I have to write manually. By the way, if tests are present, then the compilation time is less important as test execution still takes cycles. So it is not like I am saying "ok, I want to play with Kotlin, let's ksar be the first project". I am sure moving to Kotlin would help the further ksar evolution. |
Here's a recent report on ~2x improvement in the compilation time for the new K2 compiler: https://youtu.be/db19VFLZqJM?t=2651 |
Most of the conversion was automatic, so there might be glitches.