Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
KScript
Search
oshai
January 13, 2020
Technology
22
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
KScript
oshai
January 13, 2020
More Decks by oshai
See All by oshai
Maintaining an Open Source The Good, Bad & Ugly
oshai
0
38
Klean Code with Kotlin
oshai
0
80
JVM languages shootout - Java, Scala & *Kotlin*
oshai
0
67
Koroutinify ; Lessons learned from applying Coroutines in Kotlin Backend ; Deep dive into Coroutines
oshai
1
140
Klean that Code, Boil those Boilerplates
oshai
2
100
Scala vs. Kotlin; Friend or Foe?
oshai
0
180
No forks, One star. Now what?! — How I published my Kotlin Open-Source lib
oshai
0
90
Scala--pack your Future[T]; Kotlin is coming! (Kotlin TLV)
oshai
0
210
X tips [X==9] for building a Bulletproof Deployment Pipeline with Jenkins
oshai
0
63
Other Decks in Technology
See All in Technology
Refining Active Record
shugo
0
150
Post AI時代のリファクタリング実践記 / Refactoring in the post AI era
kaminashi
1
230
DevelopersIO 2026 知識の地図を描く ─ オントロジーとは何か?
ishikawa_satoru
1
1.7k
実践!Cloud Run ハンズオン!! / Cloud Run handson
y0hgi
2
280
アウトプット初心者、半年間のふりかえり
4o1sobblue
0
430
M5Stackで作る BLEマウス GPSログの世界
tomokusaba
0
420
ソフトウェア ファクトリー - 再現性のあるソフトウェアの工場づくり / Software factory
iktakahiro
6
4.9k
JAWS-UGグッズ職人仕事の流儀
kentapapa
0
100
[JAWS-UG彩の国埼玉#12]そろそろ準備する?re:Invent2026をやさしく解説 / reinvent2026-sainokuni
sh_fk2
1
340
日本語に強いオープンな大規模言語モデル「LLM-jp」
odashi
4
1.1k
Conditional PED-ANOVA: Hyperparameter Importance in Hierarchical & Dynamic Search Spaces
pfn
PRO
0
130
フロントエンドカンファレンス関西2026 - 速すぎるUIに、待ち時間を
teamlab
PRO
0
130
Featured
See All Featured
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
3
1.3k
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
74
43k
Abbi's Birthday
coloredviolet
4
10k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
22k
Practical Orchestrator
shlominoach
192
12k
It's Worth the Effort
3n
188
29k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Principles of Awesome APIs and How to Build Them.
keavy
128
18k
Bootstrapping a Software Product
garrettdimon
PRO
306
120k
Claude Code のすすめ
schroneko
67
230k
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
69
67k
Skip the Path - Find Your Career Trail
mkilby
1
260
Transcript
KScript @OhadShai
My Name is Ohad
And I write scripts in...
Bash
Perl
And you?
Kotlin
fun main() { println("Hello World!") } ››› kotlinc Hello.kt -include-runtime
-d hello.jar ››› java -jar hello.jar Hello World!
println("Hello World!") ››› kotlinc -script helloKotlinScript.kts Hello World!
println(args.joinToString(" ")) ››› kotlinc -script helloKotlinScript.kts Hello World! Hello World!
import java.io.File fun explore(current: File) { println(current.path) if (current.isDirectory) {
current.listFiles().forEach { explore(it) } } } explore(File("../scripts")) ››› kotlinc -script FileExplorer.kts ../scripts ../scripts/requirements.txt ../scripts/pgdump_parser.py ../scripts/pgdump_diff.py ../scripts/update_schema.py ../scripts/.gitignore ../scripts/utils.py ../scripts/README.md
KScript
println("Hello World!") ››› kscript hello.kts Hello World!
println("Hello World!") ››› time kscript hello.kts Hello World! kscript hello.kts
7.33s user 0.78s system 224% cpu 3.608 total ››› time kscript hello.kts Hello World! kscript hello.kts 0.49s user 0.18s system 120% cpu 0.555 total
#!/usr/bin/env kscript println("Hello World!") ››› ./hello.kts zsh: permission denied: ./hello.kts
››› chmod u+x ./hello.kts ››› ./hello.kts Hello World!
Input modes Script > kscript script-file.kts URL > kscript https://git.io/v1cG6
Inline* > kscript 'println("Hi")' REPL > kscript -i test Text Processing > cat some_file | kscript -t 'lines .filter { "^de0[-0]*".toRegex().matches(it) } .map { it + "foo:" } .print() '
kscript Open source created by Holger Brandl for Type Safe
scripts
Major Features Dependencies & Imports @file:MavenRepository("jcenter","http://jcenter.bintray.com" ) @file:DependsOnMaven("net.postgis:postgis-jdbc:2.3.0") @file:DependsOnMaven("com.github.ajalt:clikt:2.3.0")
Major Features Packaging into self executing jar (using Capsule) ›››
kscript --package hello.kts [kscript] Packaging script 'hello' into standalone executable... [kscript] Finished packaging into 'hello'
IDEA bootstrap ➜ ~ kscript ——idea my-script.kts [kscript] Setting up
idea project from my-script.kts
Issues encountered • Dependency resolution did not always work on
my Mac (and errors were sometimes funky) • Auto completion in IDE is not always working as expected.
Questions?
Thanks!