Since that paper, there's been some convergence in this area. Explicitly typed function parameters and inferred local variables now seem to be the way things are going. Go and Rust take that route. It's been retrofitted to C++, with "auto". Python seems to be headed that way, although the proposal is to have type declarations that are not checked for backwards compatibility reasons, which creates its own problems.
I am definitely biased (being the creator and all), but I like the approach JS Zero[1] is taking. Everything is written in a sound, subset of JavaScript, but you can always use an `assume` tag as an escape hatch, allowing you to write "normal" JavaScript when you really need it.
For example, if you're reading records from a SQL database, you don't have to bother wrestling with the type system – just tell it what your data looks like! :)
let Pet = Object.of({ name: String, happiness: Number })
$assume `fetchPets : (Number) => Promise( Array(Pet) )`
function fetchPets (minHappiness) {
return db('pets').select('*').where('happiness', '>', minHappiness)
}
>there's been some convergence in this area. Explicitly typed function parameters and inferred local variables now seem to be the way things are going. Go and Rust take that route. It's been retrofitted to C++, with "auto".
That feeling when even C++ is less verbose than Java ... another "lambda" feature.
Everything is good and fine, but you cannot have good type inference with dynamic typing and optional static typing. You cannot infer anything about untyped variables, only constants and functions/ops with return types.
You can in stricter languages, where the type of a variable is not allowed to change, but in a dynamic languages type inference is limited to explicitly typed variables.
You can infer a bit with function signatures and esp. with return types of your internal ops, but everything ends with your normal variable.
I also miss the argument that optional static types enable a proper FFI syntax.
[+] [-] Animats|10 years ago|reply
[+] [-] simplify|10 years ago|reply
For example, if you're reading records from a SQL database, you don't have to bother wrestling with the type system – just tell it what your data looks like! :)
[+] [-] moonchrome|10 years ago|reply
That feeling when even C++ is less verbose than Java ... another "lambda" feature.
[+] [-] rurban|10 years ago|reply
I also miss the argument that optional static types enable a proper FFI syntax.
[+] [-] sitkack|10 years ago|reply
[+] [-] koder2016|10 years ago|reply
[deleted]