Earlier quoted context omitted.
I suspect some combination of 1) It's hard for a new language to get traction. Lower odds that a new startup! They see so many ruby and python shops adding Go to their stack and want to compete in that space. Kotlin's biggest market seems to be android devs and competing with Go puts them in the datacenter. 2) IDEA's IDEs have a better value proposition to devs working with statically typed languages. Appealing to cu…
IDEA is pretty awesome with JavaScript too. The best IDE I have seen even for dynamic languages.
Kotlin 1.1 Released with JavaScript Support, Coroutines and more
51–60 of 89 posts
Re: Kotlin 1.1 Released with JavaScript Support, Coroutines and more
#52A few weeks ago I wrote the same application four times in four different JVM languages: Java, Groovy, Scala, and Kotlin, with a particular focus on the application using functional techniques and types as well as being reactive. I also included as goals complete test coverage with a preferred test framework from each language and complete build tooling, all within a single Gradle project. The only significant source…
Curious, if you were aiming at writing in a functional programming style, why didn't you try Clojure?
Re: Kotlin 1.1 Released with JavaScript Support, Coroutines and more
#53Earlier quoted context omitted.
Well Scala programs only get half compiled at command time, the other half is JIT at runtime. But no not hours bad.. but say a 3 minute partial compile for a 1 line change is enough to kill your dev cycle. (Not sure it is 3 minutes bad for most projects these days, but its very hard to have a 2 second Scala compile)
You get much better compile times if you keep scala compiler running in daemon mode (in SBT or IDEA; AFAIK Gradle can't do this yet), so it gets more benefits from JVM HotSpot. It makes a tremendous difference (up to 10x) on larger code bases and in fact, I often get 1-5s incremental compile times on a 20 kLOC codebase. Another trick is to modularize the project and enable parallel compilation to speed up compiling e…
Gradle definitely has a daemon: https://docs.gradle.org/current/userguide/gradle_daemon.html
I think in Scala you can do similar "must recompile all" if you do things like change a global implicit.
> I often get 1-5s incremental compile times on a 20 kLOC codebase
20k is still toy project size though. Try incremental compile with 100k or 200k LOC. It gets bad.
Re: Kotlin 1.1 Released with JavaScript Support, Coroutines and more
#54Earlier quoted context omitted.
Even with Kotlin Native in mind, we have no plans to break Kotlin's backwards compatibility guarantees, and we do plan to support the new JVM features such as value types. So if Kotlin works well as a Java enhancer for you today, it will only work better in that role in the future.
Perhaps the bigger issue here is fragmentation. Here you are, a young language with a lot of promise whose primary appeal is Java interop and whose target market is enterprise Java and already you're dividing your efforts to offer something which your target market will likely have zero interest in. Why not wait until you have real market share in the job market and only then worry about native? Kotlin is a very nich…
Also (just dreaming here) if Kotlin Native were to use some kind of Swift-like reference counting rather than a traditional GC, it could be really nice for interfacing with COM on Windows, where you need to be able to release references to COM objects immediately and possibly in a specific order. In a language with GC, your objects might not be collected soon enough, which leaves the references alive and the process hosting the COM object unable to shut down.
Re: Kotlin 1.1 Released with JavaScript Support, Coroutines and more
#55Why couldn't they have used "func" for functions, like so many languages do, instead of "fun"?
I don't think of 'func' as a standard. Off the top of my head, you can see "defun", "fn", "def", "function", and on and on in various languages. I don't see much agreement across the board.
Re: Kotlin 1.1 Released with JavaScript Support, Coroutines and more
#56Earlier quoted context omitted.
I only dabbled a few times in Scala, but I do regularly use C++ on some side projects. Do Scala compilation times get measured in hours? Just the other day I gave up compiling Cocos2D-X, after it crossed the one hour threshold on my humble dual core, 8GB.
I also haven't used Scala at scale enough to say; the incremental compilation story is much better than templated C++ but I think compiling a large codebase from scratch would be quite slow, and slower than templated C++. I think any design for generics that provides the same guarantees as C++ templates (type-safe, resolved at compile-time, value types aren't boxed) is necessarily going to cause long compilation time…
It very much depends on which features of Scala you use. If you restrict yourself to the features available in Kotlin or other "better Java" languages, Scala compiler isn't much slower. Where Scala compiler gets really slow are implicits - so if you try to write Scala as if it were Haskell then you are probably in trouble.
Re: Kotlin 1.1 Released with JavaScript Support, Coroutines and more
#57Earlier quoted context omitted.
I only dabbled a few times in Scala, but I do regularly use C++ on some side projects. Do Scala compilation times get measured in hours? Just the other day I gave up compiling Cocos2D-X, after it crossed the one hour threshold on my humble dual core, 8GB.
Well Scala programs only get half compiled at command time, the other half is JIT at runtime. But no not hours bad.. but say a 3 minute partial compile for a 1 line change is enough to kill your dev cycle. (Not sure it is 3 minutes bad for most projects these days, but its very hard to have a 2 second Scala compile)
Re: Kotlin 1.1 Released with JavaScript Support, Coroutines and more
#58Earlier quoted context omitted.
You get much better compile times if you keep scala compiler running in daemon mode (in SBT or IDEA; AFAIK Gradle can't do this yet), so it gets more benefits from JVM HotSpot. It makes a tremendous difference (up to 10x) on larger code bases and in fact, I often get 1-5s incremental compile times on a 20 kLOC codebase. Another trick is to modularize the project and enable parallel compilation to speed up compiling e…
Daemon does help a bit. Gradle definitely has a daemon: https://docs.gradle.org/current/userguide/gradle_daemon.html I think in Scala you can do similar "must recompile all" if you do things like change a global implicit. > I often get 1-5s incremental compile times on a 20 kLOC codebase 20k is still toy project size though. Try incremental compile with 100k or 200k LOC. It gets bad.
As for compiling 200k LOC - just split it into modules with sane dependencies and then you don't have that problem.
> I think in Scala you can do similar "must recompile all" if you do things like change a global implicit.
But there is a world of a difference between changing a signature of an implicit than changing an implementation of a template. If you change the implementation of an implicit, the only thing that needs recompiling is the class defining the implicit, nothing more.
Re: Kotlin 1.1 Released with JavaScript Support, Coroutines and more
#59Earlier quoted context omitted.
I only dabbled a few times in Scala, but I do regularly use C++ on some side projects. Do Scala compilation times get measured in hours? Just the other day I gave up compiling Cocos2D-X, after it crossed the one hour threshold on my humble dual core, 8GB.
I also haven't used Scala at scale enough to say; the incremental compilation story is much better than templated C++ but I think compiling a large codebase from scratch would be quite slow, and slower than templated C++. I think any design for generics that provides the same guarantees as C++ templates (type-safe, resolved at compile-time, value types aren't boxed) is necessarily going to cause long compilation time…
This isn't true of Ada, Modula-3 or Eiffel generics.
As for Rust, yes their compilation story still needs some improvements, but they still need to enable incremental compilation and cargo is yet to be able to handle binary dependencies across projects.
Where I suffered more in C++ compilation times was building the latest versions from either Swift or Rust, LLVM just takes ages to compile.
Thankfully I mostly use C++ as helping hand for Java/.NET.
Re: Kotlin 1.1 Released with JavaScript Support, Coroutines and more
#60Earlier quoted context omitted.
Curious, if you were aiming at writing in a functional programming style, why didn't you try Clojure?
It doesn't have compile-time type checking. When many people say functional code they really mean code that can be and is strictly type checked at compile time. Clojure is functional, but it's not what most people want when they say "functional".