
The Kotlin Language: 1.0 Beta Is Here - TheAnimus
http://blog.jetbrains.com/kotlin/2015/11/the-kotlin-language-1-0-beta-is-here/
======
kcorbitt
I've been using Kotlin on Android for about six months, and can't recommend it
highly enough. If you're stuck in the Java ecosystem, Kotlin will make your
life much better.

I also recommend it for people coming from the world of dynamic typing (Ruby,
Javascript, Python, etc.). If you can appreciate the guarantees of a static
type system -- and I submit that anyone who has worked on a project of more
than a few KLOC can -- give Kotlin a try. It's much less verbose than Java,
and gives you the tools and constructs to program in much the same style as
you would in a dynamic language, but with extremely good compile-time
correctness checks. It may not be Haskell, but it's pragmatic, practical and
productive.

The tooling is also world class, as you might expect from a language developed
by JetBrains. I recommend using Kotlin with IntelliJ -- the intellisense is
guaranteed to boost your productivity.

Seamless Java interop has been a huge priority for the developers, so the
ecosystem is also quite good. Its biggest weakness (for my use case anyway) is
the lack of a good, modern web framework. Hopefully now that Kotlin is more
stable a native library ecosystem will emerge that plays to Kotlin's strengths
more than Java's.

~~~
Nilzor
How does it affect built time and the feedback cycle?

~~~
jinst8gmi
Build times are supposed to be comparable to Java.

~~~
zserge
Build times are used to be slower, but I think recent Kotlin compilers have
"daemon" mode to speed things up.

I personally use Kotlin on a daily basis for Android development and build
time is comparable to the one of Java. May I also recommend Anvil framework
([https://github.com/zserge/anvil](https://github.com/zserge/anvil))? It
brings declarative layouts and data bindings, which works best with the
immutable data types of Kotlin (much like React does in the web).

~~~
kcorbitt
I also highly recommend Anvil. Anvil + Kotlin makes Android development feel
sane and at times even joyous! I should write a blog about my experiences.

------
eropple
I've been using Kotlin for a little while, as the backend language for the
side project/maybe-startup I'm working on. I went with it because of my
troubling tendency to write Scala code I can't read three weeks later, and in
that I think Kotlin's a big success: the Java interop is good (still some
weirdness around DI frameworks and non-nullable types, which is unavoidable if
you're using something like Jersey with HK2), the language itself has _most_
of the niceties I want, and I find that the tooling is really pretty good in
general. And the Kotlin community, in my experience, has been really good
(aside from...sigh...yet another Slack chat to be in), unlike the continuing
and perpetual disaster of Scala whenever certain members of the This Should Be
Haskell mafia are allowed near anyone who's just asking a question.

I miss things from Scala once in a while, but they're usually me being way too
cute with my code anyway--good for tiny personal things, not for something I'm
hoping I'm looking at three years from now, not just three weeks from now.

~~~
wpietri
That's helpful. I have this side Scala project, a long-lived daemon[1], that
I've been meaning to rewrite in something else, as I've grown disenchanted
with it. (Bruce Eckel and Paul Phillips contributed to that. [2]) But every
alternative I could think of was not so appealing. I'll check this out.

[1] [https://github.com/wpietri/sunrise](https://github.com/wpietri/sunrise)

[2]
[https://news.ycombinator.com/item?id=10163446](https://news.ycombinator.com/item?id=10163446)

------
vbezhenar
I tried Kotlin in one small project, which used Java API and I can recommend
it. There are a lot of handy features there.

There were quite a bit of breaking changes, but, of course, it's expected from
unreleased language. It wasn't hard to fix things.

For me Kotlin is in sweet spot between verbose Java and complex powerful
Scala. From a practical point of view, I would prefer it to both. Any
competent Java programmer will catch Kotlin fast enough, and it has almost
anything I would want from a "improved Java" language.

------
smithkl42
Kotlin seems to fill a niche comparable to TypeScript: a language that doesn't
try to break new ground, but picks a bunch of tried-and-true ideas to fix
severe problems in the underlying platform. Like TypeScript, I hope that it
ends up being the right language, with the right compromises, at the right
time.

~~~
dodyg
Yup. It helps that Kotlin is also a smallish language. You can pick it up in a
day.

------
nikolay
How is it better than Ceylon 1.2? Ceylon compiles to JVM bytecode, JavaScript,
Dart, and will to LLVM in the future. As a language, it's a great superset of
Java.

I posted [0] about the great new Ceylon 1.2 (which is backed by Red Hat), and
nobody seemed to care, but there's so much hype about Kotlin - I don't get it!

[0]
[https://news.ycombinator.com/item?id=10474126](https://news.ycombinator.com/item?id=10474126)

~~~
commentzorro
_Don 't know Ceylon or Kotlin except superficial poking around the websites._

So, let me ask you, how is Ceylon better than Kotlin? I'd like to see a good
write-up (separate blog post) that compares and contrasts the two. What are
use cases where one language would be significantly better than the other?

(Edit) Wow! Did not expect such a dearth of samples (for both languages) on
Rosetta Code.

[http://rosettacode.org/wiki/Category:Ceylon](http://rosettacode.org/wiki/Category:Ceylon)

[http://rosettacode.org/wiki/Category:Kotlin](http://rosettacode.org/wiki/Category:Kotlin)

and only one overlap:

[http://rosetta.alhur.es/compare/Ceylon/Kotlin/#](http://rosetta.alhur.es/compare/Ceylon/Kotlin/#)

~~~
eropple
Given that a _strength_ of Kotlin is that you can dumb-port Java straight to
it without even thinking about it, I'm not really surprised it doesn't have
much presence on Rosetta Code. It's not the right audience.

------
davidcaseria
Looking at the syntax briefly it seems very similar to Scala. Is there any
major differences between Scala and Kotlin?

~~~
whateveracct
Can't do much FP in Kotlin. Unless your definition of FP is programming with
lambdas.

~~~
coldtea
Which is mostly what used to be, 10 years ago. Closures, map, fold, etc.
Before Haskell and Clojure like immutability and extra trimmings became
fashionable...

In 1995 or even 2000 era LISP discussions you rarely if ever see those other
concerns about FP that hipster functional programmers bring forward today.

(I guess it's also something that was helped by Moore's Law style speed
development slowing down and the advancements in multicores...)

~~~
pjmlp
Quite right, back on those days FP was Smalltalk (yes really), Scheme, Common
Lisp, Emacs Lisp, Caml Light (no OCaml yet), Standard ML and Miranda (no
Haskell yet).

Which like you mention is where I point those hipsters to.

Then again, all new generations think they know best.

------
programminggeek
I've used both Kotlin and Scala a bit and for some very specific message
passing/protocol tricks, Scala was able to let me do what I wanted more than
Kotlin. That was maybe 6-12 months ago, so I'm not sure if that has changed.

That said, there is something pretty cool about Kotlin that I like. Congrats
on 1.0 Beta.

------
bink-lynch
I looked around and found a nice writeup on Kotlin:

[https://medium.com/@octskyward/why-kotlin-is-my-next-
program...](https://medium.com/@octskyward/why-kotlin-is-my-next-programming-
language-c25c001e26e3)

------
platz
are non-exhaustive pattern matches in kotlin warnings, errors, or neither?

looks like from the docs:

"If `when` is used as an expression, the `else` branch is mandatory, unless
the compiler can prove that all possible cases are covered with branch
conditions."

So it is an error, I assume?

~~~
kcorbitt
With the caveat that I haven't tried it myself:

> What about pattern matching? This is where the word “sealed” above comes in
> handy; we can do an exhaustive pattern match without an else/otherwise
> branch

from [https://medium.com/@octskyward/kotlin-
fp-3bf63a17d64a#.8dbwa...](https://medium.com/@octskyward/kotlin-
fp-3bf63a17d64a#.8dbwaz4yi)

~~~
commentzorro
This looks to be single value matching only and no compile time exhaustion
checks. This looks like really nice (i.e. sugary) alternative to switch but
not quite pattern matching.

------
pjmlp
It would be sweet if it already had a CoreCLR backend.

Portable code between WP and Android without JNI pain.

~~~
kodablah
They have taken steps to separate (most) of the frontend and the backend and
will be resuming work on the JS side after 1.0. While I haven't dug into the
internals very much, it seems with the concept of "platform types" (i.e.
implicitly nullable) and not having anything too JVM-specific, CLR support
might be an approachable project for the community. I recommend the community
take it and keep it up to date with pre-releases of Kotlin. With ScalaCLR
IIRC, when Typesafe decided to stop supporting it it basically withered as new
Scala features were rapidly developed.

It also has a better chance than ScalaCLR due to how small the runtime is.
But, like Swift with ObjC, since the runtime is so small so many of the
libraries are going to targer the JVM and reference JVM libs which may make
the cross-VM ecosystem non-existent (doesn't mean it still won't have good CLR
uses of course).

~~~
yole
Right now developing a new backend for Kotlin is much harder than necessary
because the compiler doesn't have any IR and any desugaring passes - in other
words, each backend has to work directly with the full AST (annotated with
types etc., but still using all language constructs).

We plan to rework this post-1.0, after which building a new backend will be
much more feasible.

------
merb
it would be great if playframework also had kotlin support. The problem here
is that kotlin has no sbt support.

~~~
strictfp
Is Play any good these days? Tried it when it was new, was an utter mess.
Found a couple of bugs within the first hour or so...

~~~
whateveracct
I know that Play 2 is happily used in production all over the place. I'm
guessing it's a lot better than when you used it.

------
TorbjornLunde
Anybody used it compiled to JavaScript? What’s your experience? How does it
compare to TypeScript?

------
bcbrown
How easy is it to write Kotlin code for Hadoop mappers and reducers?

------
Drup
Comparison with Ceylon ?

~~~
thom_nic
Here's a preso:

[https://speakerdeck.com/evacchi/kotlin-and-ceylon-modern-
pro...](https://speakerdeck.com/evacchi/kotlin-and-ceylon-modern-programming-
languages-for-a-modern-jvm)

I can't say I've used Ceylon much but I think Kotlin's syntax is much nicer
and it's much easier to approach than Scala.

~~~
mercurial
I'd imagine having Jetbrains behind Kotlin means much better tooling, which is
likely to be more important for a lot of people than language features like
ADTs.

------
EdwardDiego
I'm disappointed with the people who are down-voting this comment, as it's, in
my opinion, informative and provides a reasonable summation of the differences
between Kotlin and Scala.

I'd ask people who disagree to put their disagreement into words.

~~~
dang
We detached this subthread from
[https://news.ycombinator.com/item?id=10493049](https://news.ycombinator.com/item?id=10493049)
and marked it off-topic.

