4 ms·
> If a type system can be easily escaped, does it really offer you much? Yes, see http://julialang.org http://julialang.org for a dynamic language with a rich
by ioddly 11y ago
> If a type system can be easily escaped, does it really offer you much?
Yes, see http://julialang.org http://julialang.org for a dynamic language with a rich type system.
In many cases, the compiler can indeed optimize and catch errors at compile-time using provided type information. And Julia's methods are a great improvement over most dynamically typed languages reliance on object orientation, IMO.
But I would be hesitant to call it "optional static typing," since, as you say, it cannot offer the guarantees of static typing.
- yummyfajitas 11y agoNo, it can actually offer the guarantees of static typing within statically typed functions. function match_books(bids::Array{Bid,1}, asks::Array{Ask,1}) ... end I have static guarantees on the type of bids, asks, and anything else inside `match_books`. Outside, you might attempt to pass nonsense in and get a runtime error. But inside, I can rely on static guarantees and so can the compiler (this is why Julia is fast).