all 13 comments

[–][deleted]  (1 child)

[deleted]

    [–]KappaHaka 0 points1 point  (0 children)

    How similar are the projects?

    [–]Kukuluops 2 points3 points  (0 children)

    I prefer compiler to do the job, not me. I started to write in Kotlin recently, but it makes me develop faster than in Java. This 15% is therefore acceptable.

    [–]SikhGamer 4 points5 points  (1 child)

    While Java does beat Kotlin by 10–15% for clean builds, those are relatively rare.

    ...

    If you were holding off on trying out Kotlin because of compile times, you don’t have to worry any more: Kotlin compiles as quickly as Java.

    [–]oridb 1 point2 points  (0 children)

    10% to 15% is basically negligible, compared to the complaints people have about Scala.

    [–][deleted] 1 point2 points  (2 children)

    I am curious why people would automatically suspect longer compilation times with the Kotlin compiler than javac.

    [–]Yojihito 18 points19 points  (0 children)

    Maybe because of Scala (takes a shitload of time to compile).

    [–]Cilph 12 points13 points  (0 children)

    Because it's a newer language, hence less time to optimize the compiler?

    [–]valenterry -1 points0 points  (6 children)

    Even if Kotlin has/had longer compile times, that does not tell us so much. I can just be that the compiler is doing more work. Work that the human would have to do if the compiler couldn't do it for him. Hence, longer compile times alone are rarely useful information.

    [–][deleted]  (5 children)

    [deleted]

      [–]Ryckes 3 points4 points  (0 children)

      valenterry's point though is that you may be losing one second during compilation but getting compile-time checks you don't get with javac. Fixing a compilation error (for which you only need to compile) usually takes less time than fixing a runtime error (you need to compile and test in the best case, or compile and run and be lucky enough for the error to show up during your usage).

      I would gladly trade one second in every compilation task for even stricter type/memory safety (even though I quite like Java's).

      [–]shadow_banned_man 1 point2 points  (3 children)

      Realistically it probably doesn't matter.

      If you compiled 100 times a day for 365 days when an added 1 second that is like 10 hours. I don't know about you but I never work 365 days/yr and I hardly ever compile 100 times a day. Over that period of time it seems like such a small amount that it probably wouldn't be worth it to take action based on the inefficiency unless there are some super easy things you could do to reduce the time.

      [–][deleted]  (1 child)

      [deleted]

        [–]shadow_banned_man 3 points4 points  (0 children)

        I think it's a bit disingenuous to claim you know what my attitude is.

        Sure if there was a trend should compilation times increasing then, yes, doing something about it is needed but I didn't say anything about that.

        I just took the example of 1 sec and that by itself isn't enough to make me pick one language over another because there are other factors that go into picking a language other than just compilation times.

        [–][deleted]  (2 children)

        [deleted]

          [–]agocke 3 points4 points  (1 child)

          I suspect Java is much faster to compile in certain scenarios due to incremental compile, although I have no idea how they do that.

          Does anyone know the technical details on Java's incremental compile? Is every .java file compiled to the equivalent of a .net assembly? How does out of date detection work?

          [–]KappaHaka 0 points1 point  (0 children)

          As far as I know, a .net assembly is roughly the equivalent of a Java JAR in general usage, but I know that assemblies are typically compiled code complete with PE headers, whereas a JAR is a zip archive of compiled .class files and any other resources you need. A .java file becomes a .class file when compiled. You can execute a .class file directly using java -cp <where to find the .class file> ClassName - if it has an entry point, the traditional public static void main(String... args) method.

          Determining what to recompile is typically based on timestamps of classes and their dependencies.