cough-syrup v0.0.1
CoughSyrup is a shallow fork of CoffeeScript.
Installation
If you have the Node Package Manager installed:
npm install -g cough-syrup
Leave off the -g if you don't wish to install globally.
Getting Started
Execute a script:
cough /path/to/script.cough
Compile a script:
cough -c /path/to/script.cough
Comparison of CoffeeScript and CoughSyrup
The original CoffeeScript source code has been minimally modified, mainly so that CoughSyrup more closely resemble Scheme and Haskell.
The current changes to the code allow
interposition of spaces between functional identifiers and CALL_START tags;
recognition of implicit left-associative function calls (i.e., function calls in applicative order without explicit parentheses or CALL_START/CALL_END tags);
use of backslashes to indicate the beginning of one-parameter parameter lists;
use of the pattern '\i \j \k ->' to indicate currying (i.e, this pattern is rewritten as '(i) -> (j) -> (k) ->');
use of semicolons to toggle between applicative and point-free compositional order (i.e, 'f g h' is equivalent to 'f(g)(h)', whereas if 'k = ; f g h', then 'k(0)' is equivalent to 'f(g(h(0)))');
use of additional characters (e.g., '-', '?', '!') in INDENTIFIERs' names (To accommodate this change, the four existential operators, each of which were formerly represented by '?', have been modified: INDEX_SOAK is now '|'; the binary existential operator is now '??'; and FUNC_EXISTS and the unary existential operator now precede their operands.);
use of the backtick to immediately compose a pair of functions when in applicative mode and to immediately apply the first of a pair of functions on the second when in compositional mode -- that is,
- '; f `g h ;' is interpreted as '(i) -> f(g(h)(i))' and
- 'f `g h j' is interpreted as 'f((i) -> g(h(i)))(j)'