Re:Lily: An interpreted language with a focus on expressiven...
by dmux on Thursday July 19, 2018 @03:41PM
(#17569611)
Likewise with Apache Groovy, which has optional typing:
#!/usr/bin/env groovy
// @Grab annotation won't work in scripts
import static groovy.grape.Grape.grab
grab(group: 'org.apache.commons', module: 'commons-csv', version: '1.5')
println "Starting to parse CSV"
Re:Lily: An interpreted language with a focus on expressiven...
by blattimwind on Friday July 20, 2018 @05:34AM
(#17573621)
Kotlin can do it, too: https://github.com/holgerbrandl/kscript
Re:Lily: An interpreted language with a focus on expressiven...
by arcticbull on Thursday July 19, 2018 @09:42PM
(#17571830)
Thanks for sharing that, I had no idea. You just improved my day.
With https://github.com/DanielKeep/cargo-script you can have single file Rust "scripts" with ecosystem dependencies.
When executing the file (via the cargo-script wrapper), dependencies are fetched and a binary is compiled on demand (and cached for re-runs).
It's pretty awesome for scripts where type safety is important.
Then you can just execute it with ./my-script, which will download dependencies, compile and execute.