Code Monkey home page Code Monkey logo

tnn4 / scriptisto Goto Github PK

View Code? Open in Web Editor NEW

This project forked from igor-petruk/scriptisto

0.0 0.0 0.0 274 KB

A language-agnostic "shebang interpreter" that enables you to write scripts in compiled languages.

License: Apache License 2.0

JavaScript 1.09% C++ 0.69% Scheme 0.27% Python 2.66% C 1.67% Java 1.64% OCaml 1.68% Common Lisp 0.77% Haskell 0.34% Fortran 0.40% Go 0.54% Racket 0.47% Rust 81.22% Elixir 0.93% Dart 1.88% TypeScript 0.63% Pascal 0.34% Crystal 0.63% Reason 1.71% Zig 0.43%

scriptisto's Introduction

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

Note: some templates such as rust take more time to build during the first time. The default behaviour is to supress the build logs, so do not be discouraged that you do not immediately see any output. More info in the wiki.

Installation

Scriptisto is available as a prebuilt statically-linked standalone binary or distributions 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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.