News for hackers. Stuff that matters.
Re:Nim – Python-like statically-typed compiled language by adamnemecek on Sunday August 16, 2020 @01:14PM (#24179417)
I don't care about proving anything. You are looking at absolute numbers as opposed to things like growth or experience of people who switched.

Even something like inverting a random 4x4 matrix is just so much simpler. In julia it's just "inv(rand(4,4))". In python, you'll have to install numpy first and then writing it out is like 4 times as many characters.

Re:Nim – Python-like statically-typed compiled language by orf on Sunday August 16, 2020 @01:20PM (#24179467)
In Python it's also literally "inv(rand(4,4))".

And yeah, you need to install numpy first. But if you're doing this work you of course already got it installed.

Re:Nim – Python-like statically-typed compiled language by adamnemecek on Sunday August 16, 2020 @01:22PM (#24179480)
No, it's

import numpy as np np.linalg.inv(np.random.rand(4,4))

And you have to write it like this, because of lack of dynamic dispatch.

Re:Nim – Python-like statically-typed compiled language by orf on Sunday August 16, 2020 @01:29PM (#24179543)
> import numpy as np

> np.linalg.inv(np.random.rand(4,4))

Which of course is nothing to do with python, and is trivially reduced to the aformentioned `inv(rand(4, 4))` with imports.

> And you have to write it like this, because of lack of dynamic dispatch.

Not at all.

Re:Nim – Python-like statically-typed compiled language by adamnemecek on Sunday August 16, 2020 @01:31PM (#24179556)
But you shouldn't be doing the imports and no one does it like it. You shouldn't import it into the global namespace because you can't dispatch on the type so you need to refer to it by the full name.
Re:Nim – Python-like statically-typed compiled language by orf on Sunday August 16, 2020 @01:40PM (#24179622)
Well, not really, no. You shouldn't import into the global namespace for clarity - "from numpy import *" is very unclear. But importing specific objects is fine and is done all the time. And if you're in a notebook setting and value "less typing" over everything else it's certainly encouraged.

Dynamic dispatch would help if you also defined a "rand" function in scope, but that's a way more general argument and IMO you'd lose more than you gain with it.

Re:Nim – Python-like statically-typed compiled language by adamnemecek on Sunday August 16, 2020 @01:49PM (#24179679)
OK but the imports don't same much typing.