Hacker News new | ask | show | jobs
by blt 3822 days ago
I recently had some murky thoughts on my ideal Matlab replacement, and it would have a feature like this. It would be huge for array-oriented programming:

    func train_model(X: [n d], y: [n 1])
So many lines of code are spent verifying that the sizes of two function arguments are compatible.
2 comments

Other example: Fixed size matrix multiplication in https://github.com/SimonDanisch/FixedSizeArrays.jl depends on element type T and dimensions MxN and NxR:

    function *{T, M, N, R}(a::Mat{M, N, T}, b::Mat{N, R, T})
You can do this in Julia now, with many of the affordances you'd expect from Matlab.

    function train_model(X::Array{Float64,d}, y::Array{Float64,1})