evanpw / enceladus Goto Github PK
View Code? Open in Web Editor NEWA statically-typed language for lazy people.
A statically-typed language for lazy people.
It should look exactly like a regular function
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)
They clutter up the assembly file
Example:
result = result.insert $ s.slice(start, len)
In general, I don't like nested parentheses and would like to avoid them wherever possible.
e.g.: type TableEntry<S, T> = Option<Pair<S, T>>
Currently use a linear, unsorted array. A better approach would be a sorted array or a binary tree. Could be built at run time
Now that we have a lightweight Range type, this is unnecessary:
for i = a to b
becomes
for i in range(a, b)
Can eliminate spills or enable other optimizations
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.
Multiline looks better and is idiomatic
Steps:
Reuse stack locations corresponding to temporaries that are no longer live
Just a cleaner implementation
So that we don't have to keep copying them around when instantiating constructed types.
e.g.: Some(Pair(k, v))
How should it behave? Definitely not just the textual inclusion that is currently used
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
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
It doesn't need to be visited
The current situation really screws up gdb and makes debugging difficult
Arrays currently don't know their size. Include that information, and add bounds checks to each access.
If omitted, it should refer to the parent type
This is currently illegal:
for _ in range(1, 10)
print $ "Hello"
If capitalized, must be a parameter-less constructor call. If lowercase, must be a variable.
The former automatically zeros the top 32 bits of the destination, and the latter is illegal
This would allow us to be more accurate in applying the coherence rules, so that e.g. impl<T: Num> Trait for T
and impl Trait for String
don't overlap if String
is not an instance of Num
.
Would allow the idiomatic style to be more like Python and Rust
Currently no way to disambiguate. Should look like either
x := read<Int>()
or
x := read::<Int>()
(C++ versus Rust)
Like python's syntax:
assert x >= 0, "Index cannot be negative"
Allow an abbreviated one-line syntax for defining functions:
def lcm(a, b) = (a * b) / gcd(a, b)
Also move some functions out of prelude.spl into List.spl
Currently something like -x
actually appears as 0 - x
in the AST.
Allow "if" to act like a ternary expression:
return a if b == 0 else gcd(b, a mod b)
This would allow something like this:
print show(4)
instead of
print $ show(4)
which would make the syntax more python 2.7-like
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.
Would get rid of current hacky mechanism of passing function symbols to the code generator
e.g.: self.cmpFn(lhs, rhs)
. This may be a little difficult.
Demote all of them to local variables of the function splmain
Should catch errors sooner and provide better error messages. Should catch mismatches in resolveTypeName.
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.