Just executing single file random scripts in multiple languages (list of langs is specified in tests). It MAY or may not work for multiple files/dependencies/imports but WILL work for 1 standalone file fosho. Stdin is supported as input
Use normally as x file <args?>
x add.c 1 2 | x multiply.rb 5
# should work properly and give 15
I recommend typing gcc over and over and over again if you commonly use 2-3-4 maybe even 5 languages. If you COMMONLY write scripts in like 15 languages (which i dont get why), then this is for you, otherwise generally it's for fun.
This also assumes you have the relevant tooling present and in $PATH
. It will error out in other cases
Literally just curl it into local bin
curl -L https://manav.ch/r/gh:x?x > ~/.local/bin/x
- Perl: Idk if this is needed
- C#, Ada: Tooling be crappy
.m
is octave, not objective-c
Evaluation order based on Github metrics.
sh tests.sh
Lang (.ext) | Types | Desc |
---|---|---|
c (.c ) |
void→int |
1 if stack increases else -1 |
Ruby (.rb ) |
int→int |
Floor(abs(cos |
Javascript (.js ) |
int→int |
3x3 Gaussian blur w/ 1,1=$n$ |
Typescript (.ts ) |
int→int |
3x3 Gaussian blur w/ i,j=i+j & 1,1=$n$ |
Haskell (.hs ) |
int→float |
Schwarzschild rad for for |
Rust (.rs ) |
float→float |
Elliptic curve value from seed |
PHP (.ph ) |
float→float |
Entropy of string |
Go (.go ) |
float→float |
approx Gamma function for |
Scala (.sc ) |
float→int |
#iters to binary search |
Lua (.lua ) |
int→int |
Convert |
Fortran (.f90 ) |
int→int |
Miller-Rabin primality test for |
Python (.py ) |
int→float |
Calculate energy for QHM at |
OCaml (.ml ) |
float→float |
Golden ratio of fib series from seed |
Kotlin (.kt ) |
float→int |
10th Fibonacci num from $phi |
C++ (.cpp ) |
int→float |
Value of pi est for circ of radius |
Elixir (.exs ) |
float→float |
Calc Entropy in milli eV of |
Swift (.swift ) |
float→int |
Check if -1 + i( |
Java (.java ) |
int→float |
Calc Gauss const via AGM for |
Julia (.jl ) |
float→float |
Angle in deg for 1 + i( |
Cobol (.cob ) |
float→float |
Escape vel for planet |
OSA (.applescript ) |
float→float |
Benford Probabaility of |
Shell (.sh ) |
float→int |
Print 1st 2 decimal places of |
R (.r ) |
int→float |
Twin prime constant for |
Octave (.m ) |
float→float |
1st Bessel func at |
Dart (.dart ) |
int→float |
v if $n%2$th rocket was shot straight up |
Zig (.zig ) |
float→int |
Sum(final angles) of 2xpendulum from initial angle |
Mojo (.mojo ) |
float→int |
Stupid manipulations to get an int from a float |
Emacs Lisp (.lisp ) |
int→float |
|
Groovy (.groovy ) |
float→float |
|