Hacker News new | past | comments | ask | show | jobs | submit login
Kotlin Goes Open Source (jetbrains.com)
94 points by bad_user on Feb 14, 2012 | hide | past | favorite | 37 comments



While Clojure remains my favorite JVM language, I think Kotlin is the first language to have a fighting chance at replacing Java as an industry-wide blue-collar language. It doesn't try to solve programming's problems with new approaches like Clojure and Erlang; on the contrary - it's meant to let programmers continue thinking more or less as they have been thinking so far, but it has all the modern features and a good balance of power vs. ease of use/learning. It's what Java was 17 years ago.


Can you compare Kotlin with Ceylon [http://www.ceylon-lang.org/]? I'm very interested in what's the core/main difference between them and will be better in which use-cases.


I think the main difference is Java interop. Kotlin is fully compatible with Java and Java libraries, while Ceylon is not quite (the Ceylon FAQ says: "since Ceylon will be based on its own modular SDK, making a clean break from the legacy Java SDK, Ceylon will require new frameworks designed especially for Ceylon").


How does it compare with Scala?


Well, this is a sensitive subject. Scala is no doubt more powerful and has some awesome features, but I'd say that Kotlin has 99% of the features 99% of Scala developers choose Scala for in the first place (in other words, those Scala features that Kotlin is missing are not the ones that made most Scala developers choose Scala), while it is far easier to learn (in its entirety). Also, IDE support is far superior, and will remain so (because some Scala features, like structural types, make some actions like refactoring impossible at times). Also, it compiles to Javascript as well as to Java bytecode.


Sorry I wasn't more specific. How does it compare with Scala's Java compatibility? I know that Java compatibility is one of Scala's strengths, but the more I read, it also seems like it's one of its biggest weaknesses.


Sometimes I just think Scala sucks at marketing – completely.

- I think that especially the adjustments and features in the upcoming Scala 2.10 address real-world requirements like performance, reflection and database access.

- Scala compiles to JavaScript for months already as well as .NET.

- I remember the claim regarding IDE support from the Kotlin presentation. JetBrain's own engineers disagreed with it. I think the jury is still out there.


it's in the same position as go and c - it's not a revolution, but it would make life so much better.


I'm not sure that Java 8 won't render Kotlin largely irrelevant.


The "blue collar" crowd shifted to python/ruby/php a long time ago.


For web apps, maybe. I often find it surprising to learn how unfamiliar web programmers are with the vast amount of non-web programming out there. And even in the web world, almost all heavy-duty middleware is JVM (or, sometimes, C++) based (see twitter, tumblr, Google, Facebook etc.)


It's a bit of a stretch to describe Google, Facebook and Twitter's engineers as "blue collar". Sophisticated middleware is hardly a blue collar domain, definitely more "white collar".


Yeah, you got a point there :) Nevertheless, there's lots of blue-collar programming done in Java in the enterprise world. Much, much more than Ruby/python/PHP.


Nice to see them dropping the silly "System.out" prefix for println. A minor point, but it was rather silly. See other Kotlin examples here: http://kotlin-demo.jetbrains.com/ Kotlin copies much of its design and syntax from earlier Scala versions e.g. the use of companion classes, constructor syntax etc. but leaves out some of the most useful features found in Scala today. Kotlin, unlike Scala cannot make existing classes implement a new interface, nor can it do structural typing (http://codemonkeyism.com/scala-goodness-structural-typing/). It would be great if they added these features, without them I feel like I'm getting a poor man's Scala. The only consolation is that Kotlin does string interpolation, something which is being added to Scala 2.10 anyway.


I don't want to get into an argument over Scala, but let's just say that Scala has some really cool features from a language design perspective, but many of them come at a HUGE cost to ease of learning or reading code, or to IDE support. Scala's power, which is without a doubt very impressive for a statically-typed language, comes at a price which many organizations are unwilling to pay.


Do you have data to back up that claim? The only example I've come across is Yammer. Real world adoption data paints a different picture, one of rapid adoption of Scala by both start-ups and more traditional organizations like banks: see: http://thecodegeneral.wordpress.com/2011/11/27/scala-adoptio... and http://highscalability.com/blog/2012/2/13/tumblr-architectur...


I just compare Scala's growth to that of Java or even Ruby (since RoR). I also think that this adoption is not the result of Scala's power features but in spite of them (really, there was little choice in the statically-typed JVM languages). But I really have no skin in this game, and Java does need a modern replacement to fill a certain niche, and I have a hunch it will be Kotlin.


Is this a theoretical thought or a practical consideration?

I think the Java ecosystem needs a good, mature language now ... and I fear Kotlin is still at least half a decade away from being stable. While Kotlin compares nicely to Java 7, we need to keep in mind that both Java and Scala won't stop being developed. So pragmatically speaking, it will need to compete against Java 12 and Scala 2.16.


The thing frightening me about Ceylon and Kotlin is that they both seem to have that the "language design is hard, let's go shopping" approach which burdens developers with stuff only the language designer should care about. I will certainly have a look at the approach they take towards type constructor polymorphism.


I'm not sure type constructor polymorphism is what makes a bank, or a web startup for that matter, adopt or reject a language.


No. What I tried to say is that whether they make it work or not just tells a lot if they are willing to go the "extra mile" for their developers.


I feel like we see the same things with languages as we had with version control. For a long time, you had only CVS, then you had (too) many options to choose from: monotone, darcs, mercurial, git, and I certainly forgot some.

Now, we see new languages appear (and get some exposure) at a frightening pace: Rust, Go for system programming, and on the JVM: XTend, Ceylon, Kotlin, Clojure, Scala, Groovy, etc

It's great to see things move, but when you have so many option, it can be hard to make a choice. I expect some of these to take the lead, like git seems to be doing in the DVCS space.


Every company wants to have control over its own programming language. Even more since Oracle sued Google over Java.

Microsoft -> C# Google -> Go, Dart Apple -> Objective C Oracle -> Java VMWare -> Groovy Red Hat -> Ceylon JetBrains -> Kotlin Mozilla -> Rust

Facebook and Amazon should invent their own languages as well.


Oracle hasn't sued Google over the usage of Java the language. And going with Kotlin or Groovy won't protect you from Oracle.


AT&T -> C. Xerox -> Smalltalk...

You arranged a bunch of companies and programming languages which were designed by those companies (or with their support) and said that the motivation for designing those languages was "control". The fact the some of these examples were indeed (at least partially) motivated by "control" doesn't prove that all other examples fall into the same category.

Mozilla wants Rust to have control over their programming language?

Step 1. Invent programming language.

Step 2. Control it.

Step 3. Profit!


Neither Facebook nor Amazon are developer's companies. They will do very well with whatever technology they used. Amazon will run any program written in any language on their elastic cloud. Facebook's apps can be written in any language, too.


>Facebook and Amazon should invent their own languages as well.

http://movelang.org/ Built by Facebook engineer.


Great job, JetBrains! `Going open' (as either OSS or FOSS) seems to be the only logical decision for a programming language. Proprietary programming languages rarely stand the test of time, even when they're awesome.


I'm suspicious of ANOTHER language. There are too many already.

Regulation XKCD: http://xkcd.com/927/


What's a "meta-language"?


A description of a language in another.


Kotlin compiles to bytecode - it's no more a meta language than Java itself by that definition.


I've revised my original comment now. Thank you.


Hmm.. so in essence Kotlin could be used as a drop in replacement for Android programming.


If the language is "much simpler than Scala", why do I get stuff like this? :-)

http://imgur.com/EaxXZ


That's quite an error for such a small piece of code... None of the following functions can be called with the arguments supplied: final fun <T:Any?,R:Any?> Array<T>.map(var result:Collection<R>,var transform:Function1<T,R>):Collection<R> defined<java_root>std final fun <T:Any?,R:Any?>Interable<T>.map(var result:Collection<R>,var transform:Function1<T,R>):Collection<R>defined in <java_root>.std


The language and its compiler are also "much newer than Scala."

That or we need to write our own compiler (named Klang) and use it to convince the Kotlin devs to get off their butts and fix those error messages. :)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: