Live data from Hacker News

Kotlin/Native Tech Preview: Kotlin without a VM

blog.jetbrains.com

1–10 of 79 posts

Re: Kotlin/Native Tech Preview: Kotlin without a VM

#2
Using kotlin in web pages, client side and server side could be a big win. You could be able to use exactly the same language in all you stack. Although programming for the frontend will be different than programming for the backend, the fact that any of them can review the code of the others is great. You could also move resources in peak times to help a little.

Re: Kotlin/Native Tech Preview: Kotlin without a VM

#4
post #2

Using kotlin in web pages, client side and server side could be a big win. You could be able to use exactly the same language in all you stack. Although programming for the frontend will be different than programming for the backend, the fact that any of them can review the code of the others is great. You could also move resources in peak times to help a little.

I still prefer TypeScript for web frontend code, because it fits a lot nicer into that ecosystem (React, MobX, webpack, etc.) and the structural typing also feels better suited for that environement.

Kotlin could however be awesome for cross-platform mobile dev, targeting both iOS and Android with a lot of shared code and truly native apps on both.

Re: Kotlin/Native Tech Preview: Kotlin without a VM

#5
post #2

Using kotlin in web pages, client side and server side could be a big win. You could be able to use exactly the same language in all you stack. Although programming for the frontend will be different than programming for the backend, the fact that any of them can review the code of the others is great. You could also move resources in peak times to help a little.

> use exactly the same language in all you stack

isn't this what people are doing with JavaScript?

Re: Kotlin/Native Tech Preview: Kotlin without a VM

#6
post #2

Using kotlin in web pages, client side and server side could be a big win. You could be able to use exactly the same language in all you stack. Although programming for the frontend will be different than programming for the backend, the fact that any of them can review the code of the others is great. You could also move resources in peak times to help a little.

> use exactly the same language in all you stack isn't this what people are doing with JavaScript?

It is, but the problem with that is that they're doing it in JavaScript.

Kotlin could offer better performance and certainly offers strong type safety throughout the stack, which I at least certainly believe gives a better programming experience.

Re: Kotlin/Native Tech Preview: Kotlin without a VM

#7
post #2

Using kotlin in web pages, client side and server side could be a big win. You could be able to use exactly the same language in all you stack. Although programming for the frontend will be different than programming for the backend, the fact that any of them can review the code of the others is great. You could also move resources in peak times to help a little.

> use exactly the same language in all you stack isn't this what people are doing with JavaScript?

you don't have co-routines in JavaScript, you cannot use java libraries in JavaScript, the tooling support for java/kotlin is much better than for JavaScript, Javascript is weakly typed,... In general I think kotlin is much better language. JavaScript has a lot of issues

Re: Kotlin/Native Tech Preview: Kotlin without a VM

#8
post #4
post #2

Using kotlin in web pages, client side and server side could be a big win. You could be able to use exactly the same language in all you stack. Although programming for the frontend will be different than programming for the backend, the fact that any of them can review the code of the others is great. You could also move resources in peak times to help a little.

I still prefer TypeScript for web frontend code, because it fits a lot nicer into that ecosystem (React, MobX, webpack, etc.) and the structural typing also feels better suited for that environement. Kotlin could however be awesome for cross-platform mobile dev, targeting both iOS and Android with a lot of shared code and truly native apps on both.

TypeSript is more mature and better option for frontEnd now, but I hope kotlin will catch up.

I wouldn't use kotlin for cross-platform mobile dev. There are few things Android and iOS share, you end up having to codebases in the same language (which it is good in its way). If you want to do truly native apps, just avoid sharing code because you will use different patterns and different libraries and apis. You could share the business logic but that is something I think should be on the server not in the app. The app is only the frontend.

Re: Kotlin/Native Tech Preview: Kotlin without a VM

#9
post #8
post #4

Earlier quoted context omitted.

I still prefer TypeScript for web frontend code, because it fits a lot nicer into that ecosystem (React, MobX, webpack, etc.) and the structural typing also feels better suited for that environement. Kotlin could however be awesome for cross-platform mobile dev, targeting both iOS and Android with a lot of shared code and truly native apps on both.

TypeSript is more mature and better option for frontEnd now, but I hope kotlin will catch up. I wouldn't use kotlin for cross-platform mobile dev. There are few things Android and iOS share, you end up having to codebases in the same language (which it is good in its way). If you want to do truly native apps, just avoid sharing code because you will use different patterns and different libraries and apis. You could s…

In my experience, there is a lot of opportunity for sharing code between mobile platforms that doesn't have any real downsides. Things like:

- data structures for your domain objects

- network code (just plug in an appropriate platform-specific driver)

- like you said, business logic - especially if the app has to work offline

- if you're using something like https://realm.io/, you could avoid a lot of duplication

Anything to do with the UI then has to be platform-specific of course.

Re: Kotlin/Native Tech Preview: Kotlin without a VM

#10
I think using ARC for memory management is smart. However, the cycle collector isn't going to work when you start doing interop with native objects. So I think Kotlin is going to need a "Weak" annotation in the standard library, which will be a no-op on the JVM and JS.
Post reply on HN