All Projects → cotowali → cotowali

cotowali / cotowali

Licence: MPL-2.0 license
A statically typed scripting language that transpile into POSIX sh

Programming Languages

V
68 projects

Projects that are alternatives of or similar to cotowali

Plus
This project is being developed privately.
Stars: ✭ 215 (-60.98%)
Mutual labels:  transpiler
dragon
Dragon is a universal Python translater.
Stars: ✭ 26 (-95.28%)
Mutual labels:  transpiler
phptojs
PHP-to-JavaScript transpiler
Stars: ✭ 29 (-94.74%)
Mutual labels:  transpiler
Moonscript
🌙 A language that compiles to Lua
Stars: ✭ 2,694 (+388.93%)
Mutual labels:  transpiler
dotlin
Kotlin to Dart compiler
Stars: ✭ 212 (-61.52%)
Mutual labels:  transpiler
clava
C/C++ Source-to-Source Tool based on Clang
Stars: ✭ 55 (-90.02%)
Mutual labels:  transpiler
Rockstar Js
JavaScript transpiler for the esoteric language 'Rockstar'
Stars: ✭ 189 (-65.7%)
Mutual labels:  transpiler
Gloa
Glóa - a statically typed language that compiles to Lua. *UNDER DEVELOPMENT*
Stars: ✭ 19 (-96.55%)
Mutual labels:  transpiler
sbt-babel
An SBT plugin to perform Babel compilation.
Stars: ✭ 12 (-97.82%)
Mutual labels:  transpiler
webfx
A JavaFX application transpiler. Write your Web Application in JavaFX and WebFX will transpile it in pure JS.
Stars: ✭ 210 (-61.89%)
Mutual labels:  transpiler
C4go
Transpiling C code to Go code
Stars: ✭ 253 (-54.08%)
Mutual labels:  transpiler
elephize
Typescript to PHP translation tool
Stars: ✭ 27 (-95.1%)
Mutual labels:  transpiler
jazzle
An Innovative, Fast Transpiler for ECMAScript 2015 and later
Stars: ✭ 65 (-88.2%)
Mutual labels:  transpiler
Retyped
Access 3600+ libraries from C# and let Bridge.NET compile your project into JavaScript.
Stars: ✭ 216 (-60.8%)
Mutual labels:  transpiler
bfpile
Optimizing Brainfuck compiler, transpiler and interpreter
Stars: ✭ 19 (-96.55%)
Mutual labels:  transpiler
Transcrypt
Python 3.7 to JavaScript compiler - Lean, fast, open! -
Stars: ✭ 2,502 (+354.08%)
Mutual labels:  transpiler
cxgo
Tool for transpiling C to Go.
Stars: ✭ 234 (-57.53%)
Mutual labels:  transpiler
transpiler
ABAP to JS transpiler
Stars: ✭ 57 (-89.66%)
Mutual labels:  transpiler
CFortranTranslator
A translator from Fortran to C++. We provide statement-wise translation to improve readability.
Stars: ✭ 81 (-85.3%)
Mutual labels:  transpiler
yahdl
A programming language for FPGAs.
Stars: ✭ 20 (-96.37%)
Mutual labels:  transpiler

We need financial support to continue development. Please become a sponsor.

Cotowali

A statically typed scripting language that transpile into POSIX sh

Website

License: MPL 2.0 Join Cotowali Discord

Concepts of Cotowali

  • Outputs shell script that is fully compliant with POSIX standards.
  • Simple syntax.
  • Simple static type system.
  • Syntax for shell specific feature like pipe and redirection.

Example

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)

// Call command by `@command` syntax with pipeline operator
assert(((1, 2) |> @awk('{print $1 + $2}')) == '3')

There are more examples

Installation

Use Konryu (cotowali installer written in cotowali)

curl -sSL https://konryu.cotowali.org | sh
# add to your shell config like .bashrc
export PATH="$HOME/.konryu/bin:$PATH"
eval "$(konryu init)"

Build from source

  1. Install required tools

  2. Build

    z build
  3. Install

    sudo z symlink
    # or
    sudo z install

How to use

# compile
lic examples/add.li

# execution
lic examples/add.li | sh
# or
lic run examples/add.li

Development

See docs/development.md

Docker

docker compose run dev

Author

zakuro <[email protected]>

Acknowledgements

Cotowali is supported by 2021 Exploratory IT Human Resources Project (The MITOU Program by IPA: Information-technology Promotion Agency, Japan.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].