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.
They clutter up the assembly file
e.g.: type TableEntry<S, T> = Option<Pair<S, T>>
This is currently illegal:
for _ in range(1, 10)
print $ "Hello"
Currently use a linear, unsorted array. A better approach would be a sorted array or a binary tree. Could be built at run time
e.g.: Some(Pair(k, v))
If omitted, it should refer to the parent type
If capitalized, must be a parameter-less constructor call. If lowercase, must be a variable.
Multiline looks better and is idiomatic
Currently no way to disambiguate. Should look like either
x := read<Int>()
or
x := read::<Int>()
(C++ versus Rust)
The current situation really screws up gdb and makes debugging difficult
Also move some functions out of prelude.spl into List.spl
Should catch errors sooner and provide better error messages. Should catch mismatches in resolveTypeName.
The former automatically zeros the top 32 bits of the destination, and the latter is illegal
Allow an abbreviated one-line syntax for defining functions:
def lcm(a, b) = (a * b) / gcd(a, b)
It doesn't need to be visited
Can eliminate spills or enable other optimizations
Now that we have a lightweight Range type, this is unnecessary:
for i = a to b
becomes
for i in range(a, b)
It should look exactly like a regular function
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
How should it behave? Definitely not just the textual inclusion that is currently used
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
.
Like python's syntax:
assert x >= 0, "Index cannot be negative"
e.g.: self.cmpFn(lhs, rhs)
. This may be a little difficult.
Would allow the idiomatic style to be more like Python and Rust
Allow "if" to act like a ternary expression:
return a if b == 0 else gcd(b, a mod b)
Reuse stack locations corresponding to temporaries that are no longer live
Example:
result = result.insert $ s.slice(start, len)
In general, I don't like nested parentheses and would like to avoid them wherever possible.
Steps:
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.
Demote all of them to local variables of the function splmain
Currently something like -x
actually appears as 0 - x
in the AST.
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
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
Would get rid of current hacky mechanism of passing function symbols to the code generator
Just a cleaner implementation
Arrays currently don't know their size. Include that information, and add bounds checks to each access.
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.
So that we don't have to keep copying them around when instantiating constructed types.
This would allow something like this:
print show(4)
instead of
print $ show(4)
which would make the syntax more python 2.7-like
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)
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.