3 ms·
As a physicist, having spent eight years in academia, Python did not win by beating Fortran. Nor did it beat C++. It didn't really compete with Ruby or Lisp, al
by scythe 5y ago
As a physicist, having spent eight years in academia, Python did not win by beating Fortran. Nor did it beat C++. It didn't really compete with Ruby or Lisp, although Lua (Torch) was a briefly serious competitor before everyone realized that a language developed by four people, one of whom doesn't get along with the others, couldn't be responsive to users' needs.
Python defeated Matlab. I know because I cheered it on. I was there. I watched my roommates and friends struggle with introductory scientific computing in Matlab and I joined the chorus that was practically begging for Python, even though I didn't really like it. I can't even begin to explain how awful it is to try to teach programming concepts in Matlab. But something like Python or Matlab had to be the choice because the schools wanted to teach programming through a language where you could just call "graph" and the computer would display a graph.
Python's team, unlike Lua's, aggressively courted educational institutions by offering scientific, numerical and graphical libraries within a programming language that works like a programming language, not a glorified computer algebra system. They even added a dedicated operator for matrix multiplication. It's a great example of finding a niche and filling it: I still don't like using Python, but I can't dispute that no other language/ecosystem comes close to offering what we need to teach programming to physics students.
You want to beat Python? Build a type system that can capture dimensional analysis. Warning: it won't be easy.
- rsfern 5y ago> You want to beat Python? Build a type system that can capture dimensional analysis. Warning: it won't be easy. Curious about your thoughts on pint and Unitful.jl — pint doesn’t really go all the way to a full type system, and Unitful.jl doesn’t work with everything (autograd is a problem still I think). But Unitful.jl is super cool. https://pint.readthedocs.io/en/stable/wrapping.html#checking-dimensionality https://pint.readthedocs.io/en/stable/wrapping.html#checking... https://painterqubits.github.io/Unitful.jl/stable/ https://painterqubits.github.io/Unitful.jl/stable/
- _aavaa_ 5y agoOh god, the atrocities I have seen colleagues do with MATLAB scripts…
- analog31 5y agoI think a factor in Python vs Matlab is that Python grew into areas where Matlab was not entrenched. Also, students with an aptitude for programming and an eye for the market want to learn languages that are used by software developers. Very few engineers actually want to program in Matlab. If they can program, then they want to market themselves as programmers. A benefit of Matlab remains that it all comes from one place, with one installer, meaning that you can get a classroom full of students up and running almost instantly. And it offers some relief for students who will never grasp programming, through its collection of pre-written apps.
- poleguy 5y agoI'm in engineeering at a major engineering company historically using simulink and matlab. Python took over here in large part because matlab licensing caused so much friction, and we wanted to scale the simulink and matlab models up to run on a cluster of machines. We wanted to give scripts to people without matlab licenses quickly. etc. It was not the cost per-se, but the red tape. We also ditched simulink because it is very difficult to version control and collaborate with a graphical interface. Matlab is pushed heavily in the schools so all the engineers knew it and were comfortable with it. Matplotlib and numpy mimicing matlab very closely allowed the transition to be easy. We're not looking back. Only a handful of people still use matlab for their individual work because the python camp hit critical mass and the transition is not hard. Matlab working to control serial ports, ethernet, visa/gpib instruments, all without the friction of getting extra licenses was icing on the cake. Matlab has a buy the cadillac model: the wheels, doors, hood, gas cap, mirrors are all optional add-ons. Each point causes friction, as only a few people had the whole tool, and therefore nobody could reliably share code.
- BeetleB 5y ago> Python defeated Matlab. This is the answer. Scientific Python was originally an alternative to MATLAB. When I was in grad school, I did most of my research in MATLAB. Then we had a visiting student who was doing very similar computations in SciPy, and he assured me performance was not a problem. I migrated my MATLAB scripts to Python and never looked back. It was only after being a viable alternative to MATLAB did people decide it can be used for much more than what you typically get with MATLAB.
- dboreham 5y agoAlways nice to hear an authentic telling of history from someone who was there and had the necessary insight to interpret events and motivations. So much of what we read is "the victors' written revision".
- adw 5y agoAs a physicist who spent a decade in academia, including a PhD where all the new work was done in Python, it absolutely won in some fields by beating - or rather, by conveniently wrapping - Fortran. (In particular, that’s how things have gone in the materials physics/solid-state/quantum chemistry field. It absolutely beat out Matlab in other fields. One of the underrated benefits was being a lingua franca across more of physics!)
- da39a3ee 5y ago> where you could just call "graph" and the computer would display a graph. Hang on! In what world can you just call "graph" in Python and it would display a graph? In matplotlib on MacOS at least you try that and you get some bizarre shit about how Python isn't a framework, and you google it and find you have to do some obscure import and the import has to be in a particular order relative to other imports (totally unpythonic). https://stackoverflow.com/a/34583958/583763 https://stackoverflow.com/a/34583958/583763 Jupyter notebook... don't get me started! You do one thing and it starts a "server", and then you use that to start a "kernel" (and if my CS is dodgy and I don't really know wth these things are then I'm not having a great time already). Then this kernel thing is running Python. But oh, what version? And is it using my virtualenv? And then you google some matplotlib imports. And finally, yes you call "graph" and an ugly matplotlib png is displayed rather small in your web browser. R however. There you just call "graph".