Focus is on programmer ergonomics. Should be as easy to use as python and as fast as Java.
- Heavy type inference; type inference of variables, and also of function parameters and return type; interfaces are made for every individual method, and also for every method combination that is inferred. Classes don't inherit from other classes, instead they inherit from interfaces, and the implementation is copied over.
- Python syntax
- Compile-time errors are reported but only stop execution if they're on a potential runtime path.
- Error-reporting can be turned on and off again at will
- Casts are inserted whenever necessary, but emit a warning.
- Class meta-types
- Match statements; supports match on class of object
- Generators, coroutines, asyncio, all supported
- implicit return of None
- Shadowing is not allowed, except accross function boundaries
- Variables are implicitly initialized to
None
- If, Else, etc. do not produce a new scope.
- No recursive imports; statically checked.
- Types cannot be reassigned.
def function():
pass
print("Hello, world!")
class A()<In, Out>:
pass
Should translate to the following java code:
public class Script {
public class Function0 {
public Object call() {
return null;
}
}
public class A<In, Out> {}
public static Function0 function;
public static Class<? extends Object> classA;
public static void main() {
function = new Function0();
System.out.println("Hello, world!");
classA = A.class;
}
}