Kotlin
Kotlin Compiler Options
$ kotlinc -X 2>&1 | grep -i release
Native Image
$ sdk u java graalvm-ce-dev
$ cat > App.kt << EOF
fun main() {
println("Hello Kotlin!")
}
EOF
# $ kotlinc -version \
# -verbose \
# -include-runtime \
# -java-parameters \
# -jvm-target 19 \
# -Xjdk-release=19 \
# -api-version 1.9 \
# -language-version 2.0 \
# -Werror \
# -progressive \
# App.kt -d app.jar
$ kotlinc -version -include-runtime App.kt -d app.jar
$ java -showversion -jar app.jar
$ native-image \
--no-fallback \
--native-image-info \
--enable-preview \
-jar app.jar
$ chmod +x app
$ time ./app
# Static image info
$ file app
$ otool -L app
$ objdump -section-headers app
# Find GraalVM used to generate the image
$ strings -a app | grep -i com.oracle.svm.core.VM
Videos
https://www.youtube.com/watch?v=SEKsvHYZz8s (crypto 101)
Samples
fun main() {
println("Hello, Kotlin!")
}
if (true) {
doThis()
}
if (true) doThis()
Download movies.csv
Misc
Math
Last modified: 12 November 2024