TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Kotlin 1.1 Released with JavaScript Support, Coroutines and more

168 pointsby lynfogeekover 8 years ago

12 comments

WkndTriathleteover 8 years ago
A 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.<p>The only significant sources of variance were the following:<p>a) Groovy&#x27;s support for functional programming is starting to show its age. It worked with everything, though.<p>b) The Scala 2.12 compiler has at least one bug that appears to affect its interaction with Java 8 lambdas (in particular, in at least one case expr.method() and (expr).method() will not pass the compiler&#x27;s typecheck, but { val x = expr; x.method() } does. (All three pass IntelliJ&#x27;s typechecker for Scala.) Outside of this (aggravating) issue and slower build times, it did work.<p>c) Java works well with everything but ends up being quite verbose, especially in regards to a functional programming style (no surprise there).<p>d) Kotlin (1.0) works well with everything and is relatively succinct except for Mockito due to everything defaulting to &#x27;final&#x27; - but it appears that Kotlin 1.1 fixes this with a compiler plugin.<p>Based on my experience with all four languages, I would definitely try adding Kotlin to projects. It seems to be surprisingly mature and stable given how much less time it has spent in development (relative to the other three languages.)
评论 #13764400 未加载
评论 #13764059 未加载
评论 #13764218 未加载
评论 #13765851 未加载
评论 #13778411 未加载
vbezhenarover 8 years ago
Kotlin for me is Java made right. It&#x27;s not complex, it has awesome interoperability with Java, it uses JDK, not reinventing its own wheels and it has everything I need from modern language.<p>But it seems that Jetbrains has its own vision for Kotlin being a completely independent language. So while it works for me right now, I&#x27;m not sure if it will work in the future. They are going native and it&#x27;ll bring a lot of changes, for sure. Honestly I would prefer it to stay as Java enhancer, as I&#x27;m not interested in Native and I need very little JavaScript interoperability, if any (probably just translating some common code between backend and frontend).<p>But we will see, I don&#x27;t want to sound too pessimistic. Kotlin is the best language I&#x27;ve used so far.
评论 #13764175 未加载
评论 #13764995 未加载
评论 #13764761 未加载
评论 #13764346 未加载
sandGorgonover 8 years ago
Kotlin is not just for android apps.<p>Kotlin is getting first class support on next generation Spring web framework with functional programming support - <a href="https:&#x2F;&#x2F;speakerdeck.com&#x2F;sdeleuze&#x2F;functional-web-applications-with-kotlin-and-spring-5" rel="nofollow">https:&#x2F;&#x2F;speakerdeck.com&#x2F;sdeleuze&#x2F;functional-web-applications...</a><p>it&#x27;s almost done with first class support for vert.x which is a high-performance reactive webframework <a href="https:&#x2F;&#x2F;github.com&#x2F;vert-x3&#x2F;vertx-kotlin-common" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;vert-x3&#x2F;vertx-kotlin-common</a><p>The reactor project (erlang for the jvm?) is building first class support for kotlin <a href="https:&#x2F;&#x2F;github.com&#x2F;reactor" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;reactor</a><p>I think its going to be a great year for building backend systems on jvm.
评论 #13764858 未加载
grabcocqueover 8 years ago
What I like about Kotlin is it&#x27;s what you might call a &quot;pragmatic Scala&quot;, and could find a sweet spot between Java and Scala where its added expressiveness allows it to shine, but Scala&#x27;s complexity and performance issues aren&#x27;t in evidence to scare the development managers into staying with Java.
评论 #13763772 未加载
mwcampbellover 8 years ago
I wonder how Kotlin&#x27;s JavaScript backend compars to Scala.js in Li Haoyi&#x27;s list of fundamental reasons for betting on Scala.js:<p><a href="http:&#x2F;&#x2F;www.lihaoyi.com&#x2F;post&#x2F;FromfirstprinciplesWhyIbetonScalajs.html" rel="nofollow">http:&#x2F;&#x2F;www.lihaoyi.com&#x2F;post&#x2F;FromfirstprinciplesWhyIbetonScal...</a><p>I have a few concerns about Kotlin&#x27;s JS backend:<p>How much can the complete JS bundle be optimized by an advanced whole-program optimizer like the Google Closure Compiler?<p>Kotlin for JS has no reflection, and I think JetBrains should <i>not</i> look into that as they said they are. But is there powerful compile-time code generation instead, e.g. through annotation processors?<p>Is there, or will there be, a healthy ecosystem of pure-Kotlin libraries that can be used with both the JVM and JS?
评论 #13768241 未加载
danneuover 8 years ago
For fun, I&#x27;ve been working on a simple hobby web server in Kotlin that wraps Jetty: <a href="https:&#x2F;&#x2F;github.com&#x2F;danneu&#x2F;kog" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;danneu&#x2F;kog</a><p>I think Kotlin is the statically-typed language I&#x27;ve been waiting for, especially with the team&#x27;s interest in native and JS targets.
评论 #13766254 未加载
dep_bover 8 years ago
I wouldn&#x27;t touch Java if I could write something in Kotlin instead. I&#x27;m using Swift on a daily base and while it still has it&#x27;s issues (compile times, breaking changes) it&#x27;s a great language to work in and extremely similar to Kotlin.<p>Better type safety means less crashes.
meddlepalover 8 years ago
I&#x27;ve been very happy writing Kotlin backend code for the last fourteen months or so.<p>Definitely excited. It&#x27;s an awesome JVM language.
评论 #13763829 未加载
评论 #13764510 未加载
afastowover 8 years ago
The post specifically mentions using Kotlin Javascript to develop React applications. Are there any simple examples out there showing this? I&#x27;m not seeing any after a quick google search and look through the docs.<p>Developing a modern frontend app is complex enough with Javascript or Typescript. It&#x27;s pretty hard to ask people to figure it out from scratch in Kotlin by just saying that it&#x27;s possible but not showing how.
评论 #13765751 未加载
netcraftover 8 years ago
kotlinjs is very interesting to me - anyone have experience with writing kotlin and typescript and can compare?
curyousover 8 years ago
Why couldn&#x27;t they have used &quot;func&quot; for functions, like so many languages do, instead of &quot;fun&quot;?
评论 #13766238 未加载
评论 #13770817 未加载
评论 #13766307 未加载
jbmorgadoover 8 years ago
Does this mean we can now build a full React Native app using only Kotlin?
评论 #13767908 未加载