Git Product home page Git Product logo

enceladus's People

Contributors

evanpw avatar

Stargazers

 avatar

Watchers

 avatar  avatar

enceladus's Issues

Add a feature like Haskell's newtype

Current type alias behaves like a literal alias: inherits all behavior. Would be nice to be able to inherit a representation but nothing else (e.g., Char as an integer)

Allow '$' operator in method calls

Example:

result = result.insert $ s.slice(start, len)

In general, I don't like nested parentheses and would like to avoid them wherever possible.

Allow multiple constructor matches in switch statements

Pipe-delimited. Something like this:

for x in xs
    match x.cmp(pivot)
        Less
            lhs = lhs.insert(x)
        Greater | Equal
            rhs = rhs.insert(x)

What to do with constructors that have arguments? At best, the assignments in each case should be the same and have the same type. May be best to just disallow to start with.

Make String an alias for Array<UInt8>

Steps:

  1. Make unsafeMakeArray, unsafeArrayAt, and unsafeArraySet built-ins
  2. Make Array correctly-sized (i.e., make the elements byte-aligned instead of qword-aligned)
  3. Make the switch, and convert existing code.

Relax the method overlap check

Allow two methods to overlap as long as one is (or would be) a strict subtype of the other:

impl<T: Num> T
    def nothing(self: T) -> Unit
        pass

impl Int
    def nothing(self: Int) -> Unit
        pass

Make type errors more informative

Example: "Error: testing/wrongReturnType.spl:2:5: cannot unify types String and Int"

At least say which is expected, and which is inferred from elsewhere

Keep track of array size

Arrays currently don't know their size. Include that information, and add bounds checks to each access.

Kill NullaryNode

If capitalized, must be a parameter-less constructor call. If lowercase, must be a variable.

Make if an expression

Allow "if" to act like a ternary expression:

return a if b == 0 else gcd(b, a mod b)

Make 'print' a statement

This would allow something like this:

print show(4)

instead of

print $ show(4)

which would make the syntax more python 2.7-like

Allow more complicated function calls

Currently, the lhs of a function call must be an identifier. It would be nice to use member variables, the return value of a function, etc. directly.

Explicit returns

Remove the ability to use an implicit return, and add a semantic-analysis pass to make sure that every path through a function returns a value

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.