性能文章>Kotlin 诞生 10 周年>

Kotlin 诞生 10 周年原创

https://a.perfma.net/img/3110416
2年前
197600

2011 年 7 月 19 日,在 JVM 语言峰会上,JetBrains 宣布了 Kotlin —— 一种用于 JVM 的新静态类型编程语言。

Kotlin 官方博客发文庆祝这个值得纪念的日子,并称自从 Kotlin 诞生以来,一直在改变他们在 JetBrains 的工作方式。Kotlin 也从一个 Java 的替代方案发展成如今具备完整的生态,可以针对不同的场景编写代码,包括服务器端、移动端、Web 前端、数据科学,甚至是多平台项目。
084618_9G68_2720166.png

JetBrains 分享了关于 Kotlin 的一些经典回顾。

2011

JetBrains 首次公布 Kotlin,并为其设计了如下 logo:
084924_woIP_2720166.png

首个语法原型,函数类型和字面量:

//Functions
fun f(p: Int) : String { return p.toString() }

//Function types
fun (p: Int) : String, fun (Int) : String

//Function literals
{ (p: Int) : String => p.toString()} {(p : Int) => p.toString() }
{p => p.toString()}

2012

Kotlin 的 logo 首次更新:

语法发生重大变化:

  • 弃用命名空间(Namespace):namespace 关键字被 packagekeyword 所取代
  • 使用细箭头(->) 取代粗箭头(=>)
  • 函数类型更具可读性
// before:
fun max(col: Collection<Int>, compare: fun(Int, Int): Int): Int
// after:
fun max(col: Collection<Int>, compare: (Int, Int) -> Int): Int

发布 Kotlin 的 Web 项目 Demo:
085721_4GHL_2720166.png

Kotlin 正式开源,并支持在 Android 中使用:

package com.example

import android.app.Activity
import android.os.Bundle

class HelloKotlin() : Activity() {
      protected override fun onCreate(savedInstanceState: Bundle?) {
          super<Activity>.onCreate(savedInstanceState)
          setContentView(R.layout.main)
      }
}

2016

Kotlin logo 再次更新
090106_go3J_2720166.png

Kotlin 1.0 正式发布
up6fd1630d1fdb563387a6ce0e12291249788.png

协程功能首次出现

fun main(args: Array<String>) {
    val future = async<String> {
        (1..5).map {
            await (startLongAsyncOperation(it)) // suspend while the long method is running
        }.joinToString(" ")
    }
    println(future.get())
}

2017

Kotlin 成为 Android 官方支持的开发语言
upfbbddcfe73689da6816b741f83a1da93b16.png

Kotlin/Native 首个技术预览版发布

upfb376582a329c5b671f412459d3deb070ea.png

Kotlin/Native 能把 Kotlin 编译成机器码,支持在没有虚拟机的情况下运行 Kotlin。

2018

Ktor 1.0 正式发布
uped41898193c1710c2a2d1d1d566fd50eb44.png

fun main() {
  embeddedServer(Netty, port = 8000) {
    routing {
      get ("/") {
        call.respondText("Hello, world!")
      }
    }
  }.start(wait = true)
}

2019

Kotlin 成为 Android 开发的首选语言 (Kotlin-first)

谷歌在 I/O 大会上宣布,Kotlin 编程语言现在是 Android 应用程序开发人员的首选语言。
0b9d5cce204d83ff8a8d8825d24ed1a6b6c.jpeg

2020

Kotlin Multiplatform Mobile 进入 Alpha 阶段

Kotlin Multiplatform Mobile (KMM) 是由 JetBrains 创建的跨平台移动开发 SDK,它应用了 Kotlin 的多平台功能,开发者能够使用它在移动应用中共享业务逻辑,具体来说,可通过 KMM 在 iOS 和 Android 应用中使用相同的业务逻辑代码。
025757_9koy_2720166.png

来源:https://www.xujun.org/note-137830.html

点赞收藏
堆堆

【HeapDump性能社区官方小编】各位堆友们,+微信号perfMa,可以联系上堆堆哦~

请先登录,感受更多精彩内容
快去登录吧,你将获得
  • 浏览更多精彩评论
  • 和开发者讨论交流,共同进步
0
0
https://a.perfma.net/img/3110416
堆堆

徽章

【HeapDump性能社区官方小编】各位堆友们,+微信号perfMa,可以联系上堆堆哦~