Skip to content
This repository was archived by the owner on Feb 24, 2021. It is now read-only.
/ clutchlang Public archive

An expression-oriented and object-oriented modern programming that compiles to JavaScript.

License

Notifications You must be signed in to change notification settings

clutchlang/clutchlang

Repository files navigation

Clutch Logo

Build Status Coverage Status License is MIT

Clutch

Clutch is an expression-oriented and object-oriented modern programming that compiles to JavaScript.

// fib(n) -> if n < 2 then n else fib(n - 1) + fib(n - 2)
function fib(n) {
  return n < 2 ? n : fib(n - 1) + fib(n - 2);
}

Clutch's goals:

  • Make functional programming a delight but keep aproachable to traditional use
  • Defaults that prefer immutability and optimizations
  • Low overhead compilation and interpoability to and with JavaScript

STATUS: Highly experimental. Currently is a CoffeScript-like tool that does a 1:1 transpilation of most of Clutch's syntax to the equivalent in JavaScript. The goal, of course, is to become a complete static language, so we are pretty far from that!

Running

There is a simple script, npm run clc, which supports an experimental CLI:

# Compiles and outputs path/to/file.cl.js
$ npm run clc -- path/to/file.cl

To print the debug AST tree instead of JavaScript, add --parse or -p:

# Prints to stdout
$ npm run clc -- path/to/file.cl -p

To run in worker-mode, i.e. run the CLI and continously receive input:

# Write on stdin. Two newline characters triggers a compile
$ npm run clc -- -w

Learn more

About

An expression-oriented and object-oriented modern programming that compiles to JavaScript.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •