by pklausler · 10y ago · 0 comments
addendum: read 'static' for 'strong', please
julia> xs = ["foo", "bar"]
2-element Array{String,1}:
"foo"
"bar"
julia> push!(xs, 42)
ERROR: MethodError: Cannot `convert` an object of type Int64 to an object of type String
This may have arisen from a call to the constructor String(...),
since type constructors fall back to convert methods.
in push!(::Array{String,1}, ::Int64) at ./array.jl:479
julia> xs = Any["foo", "bar"]
2-element Array{Any,1}:
"foo"
"bar"
julia> push!(xs, 42)
3-element Array{Any,1}:
"foo"
"bar"
42
If what you are looking for is a statically typed language, then Rust has a very similar approach to data, types and polymorphism but with much more emphasis on catching errors at compile-time, at the cost of poor interactive development.As for being functional, strictly speaking it is not, but still has some features like closures and higher order functions, immutable variables, the usual suspects (map, filter, ...) can be inlined with zero overhead, side effect tracking and so on (in addition to a very good macro system)
Although I'm not sure if it's dead or just pining for the fjords