The Coconut Programming Language.
Project description
Coconut is a simple, modern, developer-friendly scripting language that compiles to Python, built for functional programming.
Installation
Enter in console:
pip install coconut
Command Line
Usage:
coconut [-h] [-v] [-s] [-r] [-i] [-d [level]] [-c code] [--autopep8 ...] [source] [dest]
Positional Arguments:
source path to the coconut file/module to compile dest destination directory for compiled files (defaults to the source directory)
Optional Arguments:
-h, --help show this help message and exit -v, --version print coconut and python version information -s, --strict enforce code cleanliness standards -r, --run run the compiled source instead of writing it -i, --interact force the interpreter to start (otherwise starts if no other command is given) -d, --debug enable debug output (level: 0 is off, no arg defaults to 1, max is 2) -c, --code run a line of coconut passed in as a string --autopep8 use autopep8 to format compiled code (remaining args passed to autopep8)
Syntax
Coconut is based on Python 3 syntax and compiles to Python 3 code. Coconut makes significant changes from Python 3 syntax, however:
- New operators:
compose: .. (in-place: ..=)
partial/islice: $
pipeline: |> (in-place: |>=)
lambda: ->
chain: :: (in-place: ::=)
- New syntax:
infix function calling: new 6 `mod` 3 syntax
operator functions: new (+) syntax
function definition: alternative f(x) = x syntax
non-decimal integers: alternative 10110_2 syntax
- Changed syntax:
unicode symbols: supports unicode alternatives for most symbols
lambda keyword: removed (use the lambda operator instead)
- New built-ins:
right reduce: reduce
zip with function: zipwith
tail recursion elimination: recursive
- New constructs: (planned)
operator [re]definition
pattern matching
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for coconut-0.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 58fb0dbcdaa67191e92233b66b3e9f67ba72b28473765dc32c8c27c1958340ab |
|
MD5 | 657d1ea609e1dc1be1496d9d6d74842d |
|
BLAKE2b-256 | 43ecd01244ff30c8a9407bf7c562d923d3b6737bbd79c40ff9a46714fc23769d |