Giter Club home page Giter Club logo

coconut's People

Contributors

arnebachmann avatar artemisart avatar auscompgeek avatar baryluk avatar benji-york avatar bkc avatar boscillator avatar eindiran avatar evhub avatar exphp avatar fabianhjr avatar gareth001 avatar gdmcbain avatar inventshah avatar jcruz avatar jonathanslenders avatar kbaskett248 avatar kxmh42 avatar lazyprop avatar m-burst avatar masasin avatar moigagoo avatar nlipsyc avatar questofiranon avatar seekingmeaning avatar starwort avatar studentiks avatar timgates42 avatar wuthefwasthat avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

coconut's Issues

Improve test coverage across Python versions

All the different targets should be tested with all the different --target parameters that they are supposed to support, and in cases such as for Python 3 where special syntax is supported, that should be tested.

Document match statements

Features to Include:

  • Constants
  • Captures
    • with a variable
    • with =
    • multi-capture
  • Type checks
  • Data types
  • Tuples
    • to deconstruct
    • to split a tuple
    • to split an iterator
  • Lists
    • to deconstruct
    • to split a list
    • to split an iterator
  • Dicts
  • Sets

Add pattern-matching to assignment

Just like sequences can be unpacked using simple assignment, most pattern-matching constructs should work as well, like dictionary unpacking.

Only recompile modified files

All compiled files should store a hash of the coconut code and coconut version that were used in compiling the file as a comment after the hashbang and encoding declaration. Then, when compiling files, the compiler should check if the file is already there with the same hash, and if it is, not recompile. A new flag -f or --force should be added to override this behavior and always recompile files.

Add more pipe operators

Multiple pipe operator:

(1, 2) |*> func

Reverse pipe operator (and multiple reverse):

func <| 5

Add a meta statement

Syntax should be

meta <lhs>:
    <body>
    <return rhs>

which should have its <body> run and then compiled to

parse(lhs + " = " + ascii(rhs))

Compile tail recursion optimization

Instead of providing a recursive decorator, recursive should be made a keyword allowed before def that compiles the function in a tail-recursively-optimized style.

Add case / match blocks

Proposed syntax:

case to_match:
    match (x, y):
        print("tuple of "+str(x)+" and "+str(y))
    match (x, x) if x:
        print("tuple of double true value "+str(x))

Enforce use of def in mathematical function definition

Enforcing the use of

def f(x) = x

over the use of

f(x) = x

would help disambiguate with

point(x, y) = p

which right now would need to be

match point(x, y) = p

as well as help solve the problem of match function definition such as

f(x is int) = x

being parsed like

point(x is int, y is int) = p

Add a way to define partial application functions

Proposed Syntax:

def func$(x,y):
    return x + y
def func$(x, y) = x + y
func = $(x, y) -> x + y

Should translate to:

def func(x):
    def _coconut_curried(y):
        return x + y
    return _coconut_curried
func = lambda x: lambda y: x + y

Add in-line conditionals

Proposed syntax:

x = (a if c else b)
x = (a if c)

Compiles to:

if c:
    coconut_if = a
else:
    coconut_if = b
x = coconut_if
if c:
    coconut_if = a
else:
    coconut_if = None
x = coconut_if

Add a flag to optimize compiled code

If -o or --optimize is specified, optimizations should be applied that could potentially invalidate code, such as not supporting index-by-slice and removing assert statements.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.