Hey all, In the KEEP, regarding running a standalo...
# scripting
Hey all, In the KEEP, regarding running a standalone script https://github.com/Kotlin/KEEP/blob/master/proposals/scripting-support.md#standalone-scripting, where does
#! /path/to/kotlin/script/runner -some -params
really point to?
e.g. the following script (from 1.3. RC blog post with added shebang line) works for me:
Copy code
#!/usr/bin/env kotlinc -cp dist/kotlinc/lib/kotlin-main-kts.jar -script


import kotlinx.html.*
import kotlinx.html.stream.*

print(createHTML().html {
    body {
        h1 { +"Hello, World!" }
(provided that kotlin is installed, path to the
is correct, the script has extension
, executable atribute is set, and the shell is unix-based)
so the answer is - they should point to some scripting host, in my example - to
with appropriate params.
about that.. i am guessing this makes it so it can magically take arguments, is that all needed to wire up commandline parameters to scripts ? is there any way to customize that behaviour when running it with
kotlinc --script
It accepts arguments, yes. The
kotlinc -script
tries to construct script using the arguments supplied, i.e. - converting argument strings to the expected args of the script. There is no customization here, at least not yet.
so i guess no implicit conversions either? say String -> File or String -> Int
Yes, when possible.
­čĺ» 2