Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Naheel-Azawy/runner
Run everything like a script!
https://github.com/Naheel-Azawy/runner
Last synced: 3 months ago
JSON representation
Run everything like a script!
- Host: GitHub
- URL: https://github.com/Naheel-Azawy/runner
- Owner: Naheel-Azawy
- License: gpl-3.0
- Created: 2020-03-25T16:50:36.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-06-22T10:02:20.000Z (5 months ago)
- Last Synced: 2024-06-22T19:17:05.328Z (5 months ago)
- Language: V
- Size: 187 KB
- Stars: 24
- Watchers: 2
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-v - runner - A tool that automates running/compiling code written in various programming languages. (Applications / Command-line)
README
# Runner
Run everything like a script!Note that this might not be so stable as V is still in a very early stage. Maybe check the older version [Executor](https://github.com/Naheel-Azawy/Executor)
### Supported files
- C (gcc)
- C++ (g++)
- V (v)
- 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)
- Lua (lua)
- Haxe (haxe and python3)### Installation
```sh
$ git clone https://github.com/Naheel-Azawy/runner.git
$ cd runner
$ make && sudo make install
```### Usage
```sh
$ rn hello.c
```Or even better, add a shebang to your file `test.vala`:
```c
#!/bin/rn
void main() { print ("Hello!\n"); }
``````sh
$ chmod +x test.vala
$ ./test.vala
```It's also possible to run a range of lines
```sh
$ ./test.ts --from 3 --to 5
```One more cool feature! I leave you with examples:
```sh
$ rn -r Hello vala 'print (@"$(args[1]) from VALA\n")'
Hello from VALA
$ rn -r Hello c++ 'cout << argv[1] << " from CPP" << endl'
Hello from CPP
$ rn -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 run-program ()
(interactive)
(defvar cmd)
(setq cmd (concat "rn " (buffer-name) ))
(shell-command cmd))
(global-set-key [C-f5] 'run-program)
```![screenshot](./imgs/screenshot-emacs.png)
### Gedit
Yes! it comes with a gedit plugin!- Run `./install-gedit`
- Open gedit preferences -> plugins
- Enable Runner
- Enjoy![screenshot](./imgs/screenshot-gedit.png)
### Add / Override
Create `~/.config/.runners.json`. Example:```json
{
".js": {
"ext": "js",
"outFile": "'{sourceFile}'",
"cm": "",
"rn": "gjs {outFile}"
}
}
```### Clean up
Binaries will be generated under '~/.cache/runnables directory.### License
GPL