<http://holgerbrandl.github.io/kotlin/2017/05/08/k...
# feed
e
holgerbrandl: I, for one, welcome our kscript overlords! All we need is
apt-get kscript
supported (and
brew install kscript
of course)
h
@elizarov Never thought about it, but it’s a good idea and I’ll look into [it](https://github.com/holgerbrandl/kscript/issues/25). Though. the current [installation](https://github.com/holgerbrandl/kscript#installation) using
curl -Lso ~/bin/kscript <https://git.io/v9R73> && chmod u+x ~/bin/kscript
seems pretty straightforward already.
o
curl from random url + chmod+x? Asking for a trouble…
h
I see your point.
o
Otherwise it looks really cool 😄
I dunno, is it possible to launch a daemon JVM process like gradle or something, so that JVM is always ready for a script? It can die automatically in few minutes of inactivity, recycle periodically to avoid memory leaks, etc.
h
there are frameworks like nailgun (http://martiansoftware.com/nailgun/) to do so, but in the end it’s just 300ms for the jvm warmup, so I have not looked into it yet.
m
You can use AppCDS as well (as it's for local development purposes) which can speed startup quite a bit
o
300ms in a bash script processing thousands of files might add up to smth
m
maybe write a bash replacement 🙂 btw holger, your /start/,/stop/ example does not appear to match the kotlin example, and in your line numbering example, the kotlin can be shorter using string interpolation.
o
kash? 🙂
c
FYI here's Scala equivalent, for inspiration: https://github.com/lihaoyi/Ammonite
h
@mikehearn thanks for your suggestions. I’ve corrected them.
@cedric I’ve worked with ammonite for a while, but somehow never embraced it enough to use it as an actual bash replacement. It was/is useful for scala-prototyping. I wish the kotlin REPL (which could serve the same prototyping purpose) would be half as stable as ammonite, but somehow it’s (imho) progressing just slowly.