Kotlin interpreter for Apache Zeppelin


Kotlin is a cross-platform, statically typed, general-purpose programming language with type inference. It is designed to interoperate fully with Java, and the JVM version of its standard library depends on the Java Class Library, but type inference allows its syntax to be more concise.


Name Default Description
zeppelin.kotlin.maxResult 1000 Max n
zeppelin.kotlin.shortenTypes true Display shortened types instead of full, e.g. Int vs kotlin.Int



fun square(n: Int): Int = n * n

Kotlin Context

Kotlin context is accessible via kc object bound to the interpreter. It holds vars and functions fields that return all user-defined variables and functions present in the interpreter. You can also print variables or functions by calling kc.showVars() or kc.showFunctions().


fun square(n: Int): Int = n * n

val greeter = { s: String -> println("Hello $s!") }
val l = listOf("Drive", "to", "develop")


Output: l: List<String> = [Drive, to, develop] greeter: (String) -> Unit = (kotlin.String) -> kotlin.Unit fun square(Int): Int