- sorted by repo name
[a-z]
BashClass is an Object Oriented Programming language that compiles to BASH 4.4
- repo
- guide
- feature
- class/struct
- transpile into Bash4.4
feature | data |
---|---|
written | C++ |
statically typed? | true |
into | Bash 4.4 |
since | 2017 |
active? | false |
class Square {
var int side;
constructor Square(var int side=0) {
this.side = side;
}
function int getArea() {
return side * side;
}
}
function void print(var int num) {
># echo $1
}
function int main() {
var Square sq = new Square(10);
print(sq.getArea());
return 0;
}
A language that compiles to Bash and Windows Batch
- repo
- guide
- feature
- transpile into bash/batchfile
feature | data |
---|---|
written | OCaml |
statically typed? | false |
into | Bash/BAT |
since | 2013 |
active? | true? |
call("println", "Println Called");
cmd = "ec" ++ "ho";
call(cmd, "Echo Called");
retval = echo("Value 100%");
println(retval);
A statically typed script language that transpile into POSIX sh
- repo
- guide
- feature
- transpile into POSIX sh
- statically typeing
feature | data |
---|---|
written | V |
statically typed? | true |
into | POSIX sh |
since | 2021 |
active? | true |
fn fib(n: int) int {
if n < 2 {
return n
}
return fib(n - 1) + fib(n - 2)
}
fn int |> twice() int {
var n = 0
read(&n)
return n * 2
}
assert(fib(6) == 8)
assert((fib(6) |> twice()) == 16)
fn ...int |> sum() int {
var v: int
var res = 0
while read(&v) {
res += v
}
return res
}
fn ...int |> twice_each() |> ...int {
var n: int
while read(&n) {
yield n * 2
}
}
assert((seq(3) |> sum()) == 6)
assert((seq(3) |> twice_each() |> sum()) == 12)
A programming language that has a strong nature to be a glue of commands.
- repo
- guide
- feature
- command wrapping
- module
- considerable error
- tmpfile like a variable
- path behaves ns
feature | data |
---|---|
written | C++ |
statically typed? | false |
into | syscall |
since | 2014 |
active? | true |
import PATH
# not a Haskell code but a glue code
# how to write a procedure (function of bash)
proc revten =
/usr/bin/seq 1 10
>>= /usr/bin/tail -r
# if, else if, else
{
false
this.revten
} !> {
echo 'foo'
} !> {
echo 'bar'
}
# output connection
str s = echo 'foofoo' >> echo 'barbar'
echo s
# tmpfile
file f = seq 1 10 >>= grep 5
cat f
# where
diff local.a local.b
where file a = seq 1 10
file b = seq 1 10
Konoha is a scripting language, characterized by:
- simple
- static
- syntax extensible
- repo
- guide
- ja: http://www.konohascript.org/try/ (closed)
- feature
- simple syntax
- library
- JIT
- add user-defined syntax
feature | data |
---|---|
written | C/C++ |
statically typed? | true |
into | syscall |
since | 2012 |
active? | false |
import konoha.syntax.ClassDeclaration;
class Klass {
int a,b;
String s;
int add(){
return this.a + this.b;
}
Klass(int a, int b){
this.a = a;
this.b = b;
}
Klass(){}
}
// 1. check eval (top level)
Klass c = new Klass(1,2);
c.s = "World";
assert(c.s == "World");
assert(c.add() == 3);
// 2. check in function
function test1(){
Klass c = new Klass(10, 20);
return c.add();
}
function test2(){
Klass c = new Klass();
c.s = "Hello";
return c.s;
}
assert(test1() == 30);
assert(test2() == "Hello");
BSD 2-Clause "Simplified" License
Write shell scripts like a bearded guru by unleashing your javascript skills!
- repo
- guide
- feature
- scripting in Common-JS
- transpile into NodeJS
feature | data |
---|---|
written | NodeJS |
statically typed? | false |
into | NodeJS |
since | 2014 |
active? | false |
#!/usr/bin/nscript
module.exports = function(shell, echo, $beard) {
if ($beard)
echo("Awesome, you invoked this script with --beard. You probably are an unixian.");
else if (shell.prompt("Do you have a mustache at least?","y") === "y")
echo("Welcome, oh hairy ", shell.env.USER);
else
shell.exit(1, "Epic fail.");
};
Oil is a new Unix shell. It's our upgrade path from bash to a better language and runtime. It's also for Python and JavaScript users who avoid shell!
- repo
- guide
- feature
- transpile into c++ code
- aim to be a new Unix shell
- command language has Ruby-like blocks
- expression language has Python-like data types
feature | data |
---|---|
written | Python |
statically typed? | false |
into | C++ |
since | 2016 |
active? | true |
# Test Oil expressions
#### command sub $(echo hi)
var x = $(echo hi)
var y = $(echo '')
# Make sure we can operate on these values
echo x=${x:-default} y=${y:-default}
## STDOUT:
x=hi y=default
## END
#### shell array %(a 'b c')
shopt -s parse_at
var x = %(a 'b c')
var empty = %()
argv.py / @x @empty /
## STDOUT:
['/', 'a', 'b c', '/']
## END
transpiler written in bash: painless shellscript, indentbased, coffee for the shell with hipster-sparkles v1 BETA LANDED tadatadatadatada thanks fcard!
- repo
- guide:
- feature
- transpile into sh/Bash code
- Ruby/Python-like syntax
- automatic quoting
- halt on error or missing dependencies
- module
feature | data |
---|---|
written | Bash |
statically typed? | false |
into | Bash/POSIX sh |
since | 2016 |
active? | false |
#!/usr/bin/env powscript
require_cmd 'echo'
require_env 'TERM'
error(msg exitcode)
echo "error: $msg"
if set? $exitcode
exit $exitcode
run(@args -- foo)
if empty? foo
error "please pass --foo <string>" 1
echo $args[@] "$foo universe!!"
echo "HOME=$HOME"
run $@
Sherlock is transpiler that translate python to shell script language.
- repo
- guide
- feature
- transpile python code into POSIX sh
feature | data |
---|---|
written | Python |
statically typed? | false |
into | POSIX sh |
since | 2016 |
active? | false |
def main():
git('add', '-A')
git('commit', '-m', 'Git commit: fire')
git('push', 'origin', 'master')
main()
A statically typed scripting language with shell-like features
- repo
- guide
- en: -
- feature
- ...
feature | data |
---|---|
written | C++ |
statically typed? | true |
into | syscall |
since | 2014 |
active? | true |
#!/usr/bin/env ydsh
assert $OSTYPE =~ $/darwin/i
var w = "$(date +%w)".toInt()!
if $w < 1 || $w > 5 {
echo today is holiday!!
exit 1
}
var begin = "$(date -v -${$w - 1}d +'%Y%m%d')"
var end = "$(date -v +${5 - $w}d +'%Y%m%d')"
var name = "$begin-$end.md"
test -e $name && { echo $name already exists!!; exit 1; }
touch $name
A tool for writing better scripts
- repo
- guide
- feature
- js-like syntax
- async/await
feature | data |
---|---|
written | NodeJS |
statically typed? | false |
into | syscall |
since | 2021 |
active? | true |
#!/usr/bin/env zx
// Copyright 2021 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
let serve = $`npx serve`
for await (let chunk of serve.stdout) {
if (chunk.includes('Accepting connections')) break
}
await $`curl http://localhost:5000`
serve.kill('SIGINT')