> With linear algebra the library HMatrix is broken in more than one place, it also requires me to learn a lot of new types just to do simple matrix decomposition.
What was broken about HMatrix? What library has the best API to you? Algebra[0] from Node?
var algebra = require('algebra');
var M = algebra.MatrixSpace;
var R = algebra.Real;
// Create the space of 2x2 real matrices
var R2x2 = new M(R, 2);
// Create two invertible matrices:
//
// | 1 2 | | -1 0 |
// | 3 4 | and | 0 1 |
//
var m1 = new R2x2.Matrix([1, 2,
3, 4]);
var m2 = new R2x2.Matrix([-1, 0,
0, 1]);
// Multiply m1 by m2 at right side
// | 1 2 | * | -1 0 | = | -1 2 |
// | 3 4 | | 0 1 | | -3 4 |
m1.mul(m2);
console.log(m1.data); // [-1, 2, -3, 4]
// Check out m1 determinant, should be 2 = (-1) * 4 - (-3) * 2
console.log(m1.determinant.data); // 2
> Regular expression in haskell requires me to learn a completely new way to do them, I am not under the impression that regular expression is broken in any way in python or javascript that it requires new syntax.
What new syntax? I'm not sure what you mean by "learn a completely new way to do them".
Haskell (pcre-light[1]):
> import Text.Regex.PCRE.Light
> let numberRgx = compile "[0-9]+" []
> match numberRgx "the answer is 42" []
Just ["42"]
Node:
/[0-9]+/g.exec("the answer is 42")[0];
Haskell (regex-tdfa[2]):
> import Text.Regex.TDFA
> "the answer is 42" =~ "[0-9]+" :: String
"42"
Ahh, I think I see what you mean now. You want the familiar /regex/string syntax right? There used to be a QuasiQuoter (template haskell library) that allowed syntax like:
ghci> [$rx|[0-9]+|] "the answer is 42"
Just ["42"]
However it[3] seems to have bitrotted and everyone else is using the "needle" =~ "match" syntax.
EDIT: Found a useful website comparing language implementations, namely regex in perl vs Haskell:
http://langref.org/haskell+perl/pattern-matching
0: http://g14n.info/algebra/examples/quick-start
1: http://hackage.haskell.org/package/pcre-light
2: http://hackage.haskell.org/package/regex-tdfa
3: http://hackage.haskell.org/package/regexqq (bitrotted)