Pull to refresh

Вышел первый релиз Kotlin 1.0

Reading time 5 min
Views 31K
Original author: Kotlin 1.0 Released: Pragmatic Language for JVM and Android
Вчера вышел первый релиз (1.0) языка программирования Kotlin от компании JetBrains.
Как пишет компания в своем вчерашнем пресс-релизе — «это был долгий путь но мы наконец выпустили первый релиз и вместе с тем представляем новое лого(иконку) языка»
It’s been a long and exciting road but we’ve finally reached the first big 1.0, and we’re celebrating the release by also presenting you with the new logo

image


Делается акцент на том что это прагматичный ЯП для JVM и Android c упором на совместимость, безопасность, выразительность и хороший инструментарий:
Kotlin is a pragmatic programming language for JVM and Android that combines OO and functional features and is focused on interoperability, safety, clarity and tooling support.

Being a general-purpose language, Kotlin works everywhere where Java works: server-side applications, mobile applications (Android), desktop applications. It works with all major tools and services such as
IntelliJ IDEA, Android Studio and Eclipse
Maven, Gradle and Ant
Spring Boot (Kotlin support released today!)
GitHub, Slack and even Minecraft :)


Подчеркивается понятие прагматичность в данном случае — создатели не ставили целью изобрести полностью новый ЯП и концепции, а построили например систему типов, предотвращающую появление багов или создали абстракции — которые способствуют повторному использованию кода и в целом фокусировались на вещах способных сделать ЯП очень хорошим и удобным инструментом:
Understanding one’s core values is crucial for any long-running project. If I were to choose one word to describe Kotlin’s design, it would be pragmatism. This is why, early on, we said that Kotlin is not so much about invention or research. We ended up inventing quite a few things, but this was never the point of the project. Of course we were building a type system that prevents bugs, and abstraction mechanisms that facilitate code reuse, as anybody in our position would. But our (pragmatic) way of doing it was through focusing on use cases to make the language a good tool.


А также самое критичное — совместимость с существующим кодом и инфраструктурой:
In particular, this approach lead us immediately to the notion that interoperability with existing code and infrastructure is crucial.


Чтобы меньше пришлось переучиваться, переписывать заново, т.е. чем больше можно переиспользовать — тем лучше:
But elegance, though highly appreciated, is not the primary goal here, the primary goal is being useful. And the less our users have to re-learn, re-invent, re-do from scratch, the more they can re-use, the better.


По этим же причинам — не создавался собственный сборщик проектов, а также было решено использовать теже самые интерфейсы коллекций что и в JDK, последнее в том числе для простоты, чтобы избежать проблем преобразования данных «туда-обратно»:
— So, why doesn’t Kotlin have its own package manager, or its own build system?
— Because there’s already Maven and Gradle, and re-using their huge number of plugins is crucial for many projects.
— Why did we invest a lot of time and effort into making JDK-compatible collection interfaces, when it was so much easier to just redesign collections from scratch?
— Because tons and tons of Java code work with JDK collections, and converting data on the boundary would be a pain.


Создатели подчеркивают что язык полностью готов к промышленному использованию и проверен на многих реальных масштабных проектах:
Is it mature enough and ready for production?

Yes. And it has been for quite some time. At JetBrains, we’ve not only been implementing the compiler and tooling but have also been using Kotlin in real-life projects on a rather extensive scale over the last two years. In addition to JetBrains, there are quite a few companies that have been using Kotlin in production for some time now.


Поясняется что столь долгий путь к релизу (более 5 лет с момента появления в 2010) был обусловлен тщательной проверкой архитектурных решений на практике т.к. компилятор должен быть обратно-совместимым со всеми будущими версиями Котлина:
In fact, one of the reasons it took us a long time to reach 1.0 was because we paid extra attention to validating our design decisions in practice. This was and is necessary, because moving forward the compiler will be backwards compatible and future versions of Kotlin must not break existing code. As such, whatever choices we’ve made we need to stick with them.


Что за сценой Котлина? Опенсорсный проект и сотни контрибьюторов, компания JetBrains сейчас пока основной спонсор Котлина, которая инвестировала в него огромные ресурсы и будет продолжать это делать в долгосрочной перспективе. Уже сейчас около 10 больших продуктов компании используют Котлин.
JetBrains is the main backer of Kotlin at the moment: we have invested a lot of effort into developing it and we are committed to the project for the long run. We wrote it out of our own need to use in our own products. And we’re happy to say that to date, close to 10 JetBrains products, which include IntelliJ IDEA, JetBrains Rider, JetBrains Account & E-Shop, YouTrack as well as some of our smaller IDE’s and some internal projects are using Kotlin. So it’s here to stay!


Компания планирует организовать централизованное обсуждение предложений по дальнейшему развитию языка и сделать этот процесс еще более прозрачным.
Moving forward we are planning to set up a centralized venue for design proposals and discussions, to make the process even more visible and organized. Standardization efforts have not been started for Kotlin so far, but we realize that we’ll need to do it rather sooner than later.


Архитектура языка и развитие проекта осуществляется командой внутри компании из более 20 человек в полном режиме.
Language design and overall steering of the project is done by the team employed at JetBrains. We currently have over 20 people working full time on Kotlin, which also yet another testament to JetBrains’ commitment to Kotlin.


Первый релиз нацелен на долгосрочную обратную совместимость языка и его библиотеки стандартных типов:
As of 1.0, we are committed to long-term backward compatibility of the language and its standard library (kotlin-stdlib)
-a newer compiler will work with older binaries (but older compilers may not understand newer binaries, like javac 1.6 can’t read classes compiled by javac 1.8);
-older binaries will keep working with newer binaries at runtime (newer code may require newer dependencies, though).


Ближайшие планы — постоянные улучшения инструментариев языка, поддежка JavaScript (компиляция как в JVM так и в JS где это возможно) и оптимизация генерации Java8 байткода с использованием новых возможностей.
As for the plans, our nearest goals are (apart from bug fixes):

Constant performance improvements for the Kotlin toolchain (this includes, for example, incremental compilation in Gradle, that is in the works now);
JavaScript support (including cross-compilation into both JVM and JS where possible);
Support generating Java 8 byte code with optimized lambdas, etc (Java 6 will be actively supported as long as Android users need it).
Tooling updates and bug fixes will be released as incremental updates, i.e. 1.0.X. Bigger changes will first go though an Early Access Program (EAP) and then will be released as 1.1.


Доки, мануалы — доступны на официальном ресурсе проекта — kotlinlang.org
Обратная связь через форум или чат котлина


Have a nice Kotlin! Now :)


p.s. все вроде круто и ожидаемо, всем спасибо, единственный нюанс только навевает сомнения — гарантия вечной обратной совместимости, т.е. тоже самое что и в самой Java. Так ли это необходимо? Последствия известны на примере ущербных generics, устаревшего дизайна коллекций и не всегда удобной реализации лямбд и тд. многие могут сами добавить из наболевшего. Так ли это будет критично если раз в 10-15 лет эта самая обратная совместимость будет не соблюдаться для изменения языка в лучшую сторону? У нас уже есть Java с вечной обратной совместимостью, так ли нужно это теперь еще в Котлине? Предлагаю голосовать:
Only registered users can participate in poll. Log in, please.
Нужна ли в Котлине «вечная» обратная совместимость?
17.95% да, обязательно, также как в Java 149
29.4% не нужна: очень редко (раз в 10-20 лет) можно и нарушать 244
47.59% не нужна: только в пределах мажорного релиза должна быть 395
5.06% не нужна никакая: в любом релизе можно нарушать 42
830 users voted. 265 users abstained.
Tags:
Hubs:
+29
Comments 41
Comments Comments 41

Articles