News for hackers. Stuff that matters.
Re:Ask HN: Has anyone here programmed in Kotlin? What do you... by merb on Saturday July 25, 2015 @11:07AM (#9947764)
Currently it sucks to write tests with JUnit while using Kotlin, there is Spek (Jetbrains made it(, but it's early (too early).

XML based Build Tool, I mean seriously? It should at least be somehow human readable.

A language should need a sane integration of it, not the library itself. Okai DI is definitly somewhat that isn't needed, but a good integration is still suitable.

I mean good Multithreading lives in RxKotlin which is based on RxJava, however I still think that Threading or some kind of Library which should handle mutli prozessors / async capabilities should live INSIDE the language (like go, erlang or lots of others).

I mean currently Java9 will get a lot of new things which will definitely help out Scala to compile faster and Java10 will bring these closer. So there is no real reason for a language that still lacks a lot of stuff. As already said, Kotlin is small, on some edges thats good, on some it's just too small and I don't get it why they built while, break and continue into a somewhat functional language. Especially when while, break and continue is really hard to handle / read.

Re:Ask HN: Has anyone here programmed in Kotlin? What do you... by mahmoudimus on Saturday July 25, 2015 @04:35PM (#9948901)
IMHO, I'm not sure if any of the above there besides the testing libraries is something that should be part of Kotlin, _especially_ if it hasn't even yet hit v1.0.

That having been said, I think your concerns will be addressed, _eventually_, but JetBrain is not trying to disrupt Java or its ecosystem before mainstream adoption of the language.

Re: async capabilities like Erlang/Go, until the JVM can support continuations, an industry standard solution like bytecode instrumentation, which Java9 will improve on, will entrench libraries like Quasar / RxKotlin to be basically drop in. These libraries provide seamless interoperability with existing synchronous libraries (see https://github.com/puniverse/comsat) to get around the fact that Erlang's/Go's async capabilities are not built-in to the language.

Re:Ask HN: Has anyone here programmed in Kotlin? What do you... by michel-slm on Saturday July 25, 2015 @10:45PM (#9949942)
There is Quasar if you want Go or Erlang style concurrency in either Java or Kotlin (and the Pulsar wrapper to it for Clojure).

No reason to bake it into the language -- and as you can see from comparing the Java and Kotlin sample code, there is a reason for a language that let you write Groovy-like DSLs.

http://docs.paralleluniverse.co/quasar/

Re:Ask HN: Has anyone here programmed in Kotlin? What do you... by Bienlein on Monday July 27, 2015 @04:13AM (#9953985)
>> No reason to bake it into the language

Go-style channels and goroutines are built on green threads which Go/Erlang has, but the JVM does not have. One way to work around this is to use fibers and continuations which is what Quasar is doing.

Re:Ask HN: Has anyone here programmed in Kotlin? What do you... by lakedaemon on Saturday July 25, 2015 @03:08PM (#9948624)
For tests : I have had some nice experience writing jUnit tests with pitest (PIT) : there is a gradle plugin to do that in AS/Idea

The only issue I had was to ignore Package class to make pit work

For DI, Dagger2 works fine with kotlin

For multithreading : Quasar supports Kotlin (I'm waiting for quasar to support android though)

Re:Ask HN: Has anyone here programmed in Kotlin? What do you... by mahmoudimus on Saturday July 25, 2015 @04:01PM (#9948795)
> For multithreading : Quasar supports Kotlin (I'm waiting for quasar to support android though)

Have you opened up an issue on Quasar's repo (https://github.com/puniverse/quasar) so Parallel Universe can track this for a possible milestone?

Re:Ask HN: Has anyone here programmed in Kotlin? What do you... by lakedaemon on Monday August 03, 2015 @08:58AM (#9995380)
We don't need to : I read somewhere that it was on their roadmap...
Re:Ask HN: Has anyone here programmed in Kotlin? What do you... by mplatvoet on Sunday July 26, 2015 @10:00AM (#9951062)
If you want easy multithreading on Android take a look at Kovenant http://kovenant.komponents.nl/android/features/
Re:Ask HN: Has anyone here programmed in Kotlin? What do you... by michel-slm on Sunday July 26, 2015 @10:59AM (#9951206)
Can you use PIT with Kotlin? Really tempted to try it out but wasn't sure. I suppose if it works at the bytecode instead of source level it would just work.
Re:Ask HN: Has anyone here programmed in Kotlin? What do you... by lakedaemon on Monday August 03, 2015 @08:57AM (#9995375)
Yes you can (I managed it and it works beautifully). But you have to make it ignore Package Class at the moment because top functions in a package (say my.great.pack) can be in different .kt files and are gathered in a single class (my.great.pack.PackPackage) and pit doesn't seem to be able to cope with a class whose source come from more than 1 file (or I missed something).

Just put something like this in your gradle.build file :

apply plugin: "info.solidsoft.pitest"

pitest { targetClasses = ['org.lakedaemon.suggest.', 'org.lakedaemon.compress.'] //by default "${project.group}." excludedClasses = ['org.lakedaemon.compress.decoders.DecodersPackage', 'org.lakedaemon.compress.decoders.EncodersPackage'] avoidCallsTo = ['org.apache.log4j.', 'org.lakedaemon.L.', 'org.slf4j.', 'java.util.logging.'] pitestVersion = "1.1.4" //not needed when a default PIT version should be used threads = 4 outputFormats = ['XML', 'HTML'] enableDefaultIncrementalAnalysis = true testSourceSets = [sourceSets.test/, sourceSets.integrationTest/] mainSourceSets = [sourceSets.main/, sourceSets.additionalMain*/] }

Re:Ask HN: Has anyone here programmed in Kotlin? What do you... by EdwardDiego on Saturday July 25, 2015 @08:34PM (#9949631)
> Currently it sucks to write tests with JUnit while using Kotlin

Why?

> XML based Build Tool, I mean seriously? It should at least be somehow human readable.

It's entirely human readable in my subjective opinion. At the very least, it's as human readable as HTML...

> A language should need a sane integration of it, not the library itself.

Any language which has constructors already has the best DI integration available.