Hacker News new | ask | show | jobs
by enriquto 1137 days ago
> It really could replace anything R, Python, Perl, Ruby etc is used for today.

There is an (admittedly niche) use-case where Julia would be almost incapable to work, as compared to other interpreted languages like for example Lua or Perl. Making a "busybox" style executable that replaces all coreutils (cat, ls, head, tail, wc, sort, uniq, tr, cp, df, echo, printf, ...) with simple Julia implementations. The slow startup-time for each Julia instance would make most shell scripts unbearably sluggish.

I agree that Python would be an equally bad choice for that, but at least it should be slightly faster.

Regarding "serious" uses of Julia, especially in numerical mathematics, I find some basic things still lacking. For example a complete base package for sparse matrices, including kronecker products etc. Octave/Matlab have the "kron" function in the base language. In Julia, should I use things with dubious names like LuxurySparse or what?

1 comments

> Making a "busybox" style executable that replaces all coreutils

I wonder if DaemonMode (https://github.com/dmolina/DaemonMode.jl) is the right approach for this, having each of those tools' functionality loaded in the server process, and calling out to them from a client when a tool is invoked.

> a complete base package for sparse matrices, including kronecker products etc.

SparseArrays is a standard library package for sparse matrices and arrays. kron is in the LinearAlgebra standard library. So you can just do

    using LinearAlgebra
    using SparseArrays
and then do any kron product you want, whether sparse matrices with other sparse matrices, or dense ones, or any other array type.
> and then do any kron product you want, whether sparse matrices with other sparse matrices

Thanks! Will try it with the new release. Last time I tried, apparently it converted the sparse matrix to dense before calling kron, and (expectedly) it failed due to memory error. For example, try to compute the adjacency matrix of a grid graph of size 1000x1000. It is the kronecker product of two tridiagonal matrices of that size. It only has four million non-zero entries, which are instantaneous to compute, but if you want to store all the zeros you'll need a few terabites of RAM.

that definitely sounds like a bug. if it still is like that, please file an issue :)