Skip to content

Naheel-Azawy/Executor

Repository files navigation

Executor

Run everything like a script!

Supported files

  • C (gcc)
  • C++ (g++)
  • C# (mcs and mono)
  • VisualBasic .NET (vbnc and mono)
  • Go (gccgo)
  • Rust (rustc)
  • Java (javac)
  • Kotlin (kotlinc and java)
  • Kotlin Script (kotlinc -script)
  • Vala (valac)
  • Genie (valac)
  • TypeScript (tsc and node)
  • JavaScript (node)
  • Python (python3)
  • GNU Octave (octave)
  • ARM Assembly (arm-linux-gnu-as, arm-linux-gnu-ld, and qemu-arm)
  • Intel Assembly (nasm)
  • OCaml (ocamlopt)
  • Shell (bash)
  • AWK (awk)
  • Perl (perl)
  • R (R)
  • Dart (dart)
  • Julia (julia)
  • Haxe (haxe and python3)

Installation

$ curl https://raw.githubusercontent.com/Naheel-Azawy/Executor/master/install-online | bash

or

$ git clone https://github.com/Naheel-Azawy/Executor.git
$ cd Executor
$ sudo ./install

Docker

The docker image is based on archlinux/base. The image should be around 5.76GB, so the build takes time...

docker build -t executor .
docker run -it executor

Usage

$ execute hello.c

Or even better, add a shebang to your file test.vala:

#!/bin/execute
void main() { print ("Hello!\n"); }
$ chmod +x test.vala
$ ./test.vala

It's also possible to run a range of lines

$ ./test.ts --from 3 --to 5

One more cool feature! I leave you with examples:

$ execute -r Hello vala 'print (@"$(args[1]) from VALA\n")'
Hello from VALA
$ execute -r Hello c++ 'cout << argv[1] << " from CPP" << endl'
Hello from CPP
$ execute -r "1 1" c 'int i=atoi(argv[1]),j=atoi(argv[2]),k=i+j;printf("%d + %d = %d\n",i,j,k)'
1 + 1 = 2

Emacs

Add this to you .emacs:

(defun execute-program ()
  (interactive)
  (defvar cmd)
  (setq cmd (concat "execute " (buffer-name) ))
  (shell-command cmd))
(global-set-key [C-f5] 'execute-program)

screenshot

Gedit

Yes! it comes with a gedit plugin!

  • Run ./install-gedit
  • Open gedit preferences -> plugins
  • Enable Executor
  • Enjoy

screenshot

Add / Override

Create .executor.json in home directory. Example:

{
    ".js": {
        "outFile": "'{sourceFile}'",
        "cm": "",
        "rn": "gjs {outFile}"
    }
}

Clean up

Binaries will be generated under '~/.cache/execs' directory.

License

GPL

About

Run everything like a script! Check the new version `runner`

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published