Metadata-Version: 2.0
Name: coconut
Version: 0.1.1
Summary: The Coconut Programming Language.
Home-page: https://github.com/evhub/coconut
Author: Evan Hubinger
Author-email: evanjhub@gmail.com
License: UNKNOWN
Keywords: functional programming language
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: Topic :: Software Development :: Code Generators
Classifier: Topic :: Software Development :: Compilers
Classifier: Topic :: Software Development :: Interpreters
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Utilities
Classifier: Environment :: Console
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.6
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.0
Classifier: Programming Language :: Python :: 3.1
Classifier: Programming Language :: Python :: 3.2
Classifier: Programming Language :: Python :: 3.3
Classifier: Programming Language :: Python :: 3.4
Classifier: Operating System :: OS Independent
Requires-Dist: pyparsing

Coconut
=======

Coconut_ is a simple, modern, developer-friendly scripting language that compiles to Python, built for functional programming.

.. _Coconut: https://github.com/evhub/coconut

.. image:: https://travis-ci.org/evhub/coconut.svg?branch=master

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:
    - lambda: ``->``
    - compose: ``..`` (in-place: ``..=``)
    - pipeline: ``|>`` (in-place: ``|>=``)
    - chain: ``::`` (in-place: ``::=``)
    - partial/islice: ``$``
- 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
- New blocks:
    - immutable named tuples: ``data``
- Changed syntax:
    - unicode symbols: supports unicode alternatives for most symbols
    - lambda keyword: removed (use the lambda operator instead)
- New built-ins:
    - right reduce: ``reduce``
    - iterator take while: ``takewhile``
    - tail recursion elimination: ``recursive``
- New constructs: (planned)
    - operator [re]definition
    - pattern matching


