#interpreter #write #scripts #languages #shebang #compiled #language-agnostic

app scriptisto

A language-agnostic “shebang interpreter” that enables you to write scripts in compiled languages

47 releases (5 breaking)

✓ Uses Rust 2018 edition

0.6.5 Jan 21, 2020
0.6.2 Nov 24, 2019

#31 in Build Utils

Download history 44/week @ 2020-01-22 4/week @ 2020-01-29 7/week @ 2020-02-05 49/week @ 2020-02-12 118/week @ 2020-02-19 101/week @ 2020-02-26 95/week @ 2020-03-04 49/week @ 2020-03-11 201/week @ 2020-03-18 97/week @ 2020-03-25 49/week @ 2020-04-01 192/week @ 2020-04-08 192/week @ 2020-04-15 4/week @ 2020-04-22 3/week @ 2020-04-29 3/week @ 2020-05-06

399 downloads per month

Apache-2.0 and GPL-3.0+

54KB
1K SLoC

Rust 1K SLoC // 0.1% comments OCaml 37 SLoC // 0.4% comments Python 25 SLoC // 0.5% comments RPM Specfile 24 SLoC C 16 SLoC // 0.5% comments Java 11 SLoC // 0.6% comments JavaScript 8 SLoC // 0.6% comments C++ 8 SLoC // 0.3% comments Go 6 SLoC // 0.5% comments Pascal 5 SLoC // 0.4% comments Elixir 5 SLoC // 0.8% comments FORTRAN Modern 4 SLoC // 0.5% comments TypeScript 3 SLoC // 0.7% comments Racket 3 SLoC // 0.7% comments Lisp 3 SLoC // 0.8% comments Haskell 2 SLoC // 0.7% comments Scheme 2 SLoC // 0.7% comments Crystal 1 SLoC // 0.9% comments

Scriptisto

Latest Version Build Status Crates.io License Libraries.io dependency status for latest release GitHub top language

Crates.io GitHub All Releases

It is tool to enable writing one file scripts in languages that require compilation, dependencies fetching or preprocessing.

It works as a "shebang" for those scripts, extracting build instructions from comments. If a script is changed, scriptisto rebuilds it and caches the result. If a script was already built, scriptisto immediately delegates to a binary with only <1 ms overhead.

Builds in Docker are available.

Advantages and use-cases are listed in the Wiki.

Demo

#!/usr/bin/env scriptisto

#include <stdio.h>
#include <glib.h>

// scriptisto-begin
// script_src: main.c
// build_cmd: clang -O2 main.c `pkg-config --libs --cflags glib-2.0` -o ./script
// scriptisto-end

int main(int argc, char *argv[]) {
  gchar* user = g_getenv("USER");
  printf("Hello, C! Current user: %s\n", user);
  return 0;
}
$ chmod +x ./script.c
$ ./script.c
Hello, C! Current user: username

Installation

Scriptisto is available as a prebuilt statically-linked standalone binary or distrubutions packages at Releases or at Crates.io.

Please proceed to the Installation for instructions.

Documentation

Proceed to our Wiki.

Disclaimer

This is not an officially supported Google product.

Dependencies

~2.7–3.5MB
~64K SLoC