5

Truly standalone Scala scripts by Przemek | Signify Technology

 2 years ago
source link: https://www.signifytechnology.com/blog/2021/05/truly-standalone-scala-scripts-by-przemek-pokrywka
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
Image 2021 05 24 T10 16 16

Truly standalone Scala scripts by Przemek Pokrywka

Let’s face it: if you want to quickly hack a script for use by somebody else, Scala is rarely the first choice.

Unlike Bash and Python, the essential dependencies (Java Virtual Machine, Ammonite) are usually missing on the target operating systems. This leaves you with a dilemma: should you instruct your users to install the missing bits or should you ship something, that they’ll run instantly (Bash, Python)? I think this is one of the reasons, why most of the common helper scripts is not being written in Scala. That is a shame. TSK - The Scripting Kit (https://github.com/tsk-tsk/tsk-tsk) aims to change that. With TSK you can create a Scala script that is instantly self-installable-and-executable after you save it and set the executable bit. You achieve that by prepending your Scala code with a special preamble, which consists of shell commands disguised as a Scala comment. You end up with something that works on multiple systems from the get-go and is nicely editable with IDEs at the same time. A scripting nirvana!

This talk was given by Przemek Pokrywka at Scala Love in the City, hosted by Signify and Konfy.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK