https://kotlinlang.org logo
#feed
Title
e

elizarov

05/11/2017, 9:38 AM
holgerbrandl: I, for one, welcome our kscript overlords! All we need is
apt-get kscript
supported (and
brew install kscript
of course)
h

holgerbrandl

05/11/2017, 9:52 AM
@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

orangy

05/11/2017, 9:54 AM
curl from random url + chmod+x? Asking for a trouble…
h

holgerbrandl

05/11/2017, 9:55 AM
I see your point.
o

orangy

05/11/2017, 9:56 AM
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

holgerbrandl

05/11/2017, 10:01 AM
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

mikehearn

05/11/2017, 10:41 AM
You can use AppCDS as well (as it's for local development purposes) which can speed startup quite a bit
o

orangy

05/11/2017, 11:44 AM
300ms in a bash script processing thousands of files might add up to smth
m

mikehearn

05/11/2017, 12:47 PM
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

orangy

05/11/2017, 12:53 PM
kash? 🙂
c

cedric

05/11/2017, 1:25 PM
FYI here's Scala equivalent, for inspiration: https://github.com/lihaoyi/Ammonite
h

holgerbrandl

06/14/2017, 8:35 AM
@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.