Live data from Hacker News

Homogenization of scientific computing – Python is eating other languages’ lunch

r-bloggers.com

71–80 of 184 posts

Re: Homogenization of scientific computing – Python is eating other languages’ lunch

#71

Earlier quoted context omitted.

Literally every single C programmer in the world is writing x86 or arm machine code. C programmers have this bizarre blind spot where they don't realize that though. Isn't that weird?

You've missed the point. NumPy and friends are a mass of C code with some Python bindings.

Which is completely irrelevant, since the users of it are writing python code.

Re: Homogenization of scientific computing – Python is eating other languages’ lunch

#72

I find Lua more interesting than Python. It has all the simplicity, all of the power, none of the indentation, and is quite a nice portable tool. That said, I do wonder at times what it is about Lua that makes so many people not-interested in it, when .. from my naive point of view .. its an almost perfect language for rapid development. I don't have that feeling about Python, quite so much ..

"That said, I do wonder at times what it is about Lua that makes so many people not-interested in it, when .. from my naive point of view .. its an almost perfect language for rapid development."

Probably because the core language is only a small part of what determines a language's usefulness. Python has heaps of tools and libraries, is used in many software packages as the scripting language, and is generally well-known by scientists. Who cares about syntax, really. It's the ecosystem that makes a language powerful.

Re: Homogenization of scientific computing – Python is eating other languages’ lunch

#73

I know that I use python because of how easy it is to code. I can focus wholly, totally on the logic of my code without ever worrying about if I misplaced a semi-colon or left out some weird punctuation. Python frees me to code and not worry about things that get in the way of coding. That's why it's eating other language's lunches, the freedom is almost intoxicating.

I often forget ending for/while/if statements with a colon.

http://markmail.org/message/ve7mwqxhci4pm6lw

In my opinion they should not be required because they cause more problems than they solve.

Re: Homogenization of scientific computing – Python is eating other languages’ lunch

#74
I do all of my scientific computing in python these days.

However, I think it's interesting to compare popularity using stackoverflow (which isn't a great metric, as most scientists aren't aware that it exists):

  Semi-useless Stackoverflow Popularity Metric
  --------------------------------------------

  Searching for questions tagged "[r]":
    * 45,119 questions

  Searching for questions tagged "[matlab] or [simulink]":
    * 27,044 questions

  Searching for questions tagged "[numpy] or [scipy] or [pandas] or [matplotlib]":
    * 18,745 questions

  Searching for questions tagged "[julia-lang]":
    * 95 questions

  Searching for questions tagged "[python]":
    * 255,603
Sure, python isn't as widely used for scientific computing as R or matlab (as evidenced by the third item above), but there's a lot to be said for using a very widely-used language for scientific computing. This is doubly true once you branch out from the "core" scientific code. Building a deployable desktop application is a lot easier in python than in matlab (Done it, partly through java. Don't want to again.) or R (Never tried. Might be easier than I think.).

Re: Homogenization of scientific computing – Python is eating other languages’ lunch

#75

I do scientific computing, and Python is one language I never actually got around to learning for some reason. However, as a long-time hobby, I do have an interest in programming languages so I like exploring things like Haskell, Clojure, Lisp, etc. One language I'm really excited about for scientific computing though is Julia. From a language-design perspective, it's beautiful. It was actually thought out rather tha…

What are your thoughts on Clojure's suitability as a go-to language for scientific computing (except in lower-level, high-performance scenarios that might recommend Julia)? I think it has serious potential in this field. It's not there yet, but it's getting there, and the core.matrix standardization helps a lot.

Re: Homogenization of scientific computing – Python is eating other languages’ lunch

#76
post #66
post #57

Earlier quoted context omitted.

> If refactor huge chunks of code it's easy to miss one fubar tab and have code subtly broken and introduce weird regressions. That is just one of the many issues that can come up when refactoring large sections of code, and is one reason that people write tests. For people to point it out as the entire reason that they can't use Python seems to be making a mountain out of a mole hill. For example, I don't like that…

I'm not making a mountain out of a molehill but I don't understand why the python crowd refuse to acknowledge that having significant whitespace does cause some issues and the benefits are completely subjective. Sure unit tests will catch the error but in most other languages the error wouldn't have been introduced in the first place . I think in the end the problem is that I've been writing in C-style languages a lo…

> I'm not making a mountain out of a molehill

I'm not saying that you are, just that these arguments/discussions generally are making a mountain out of a mole hill when people go on at length about how much they hate Python (though they've never used it) because of its semantic white space.

> I don't understand why the python crowd refuse to acknowledge that having significant whitespace does cause some issues and the benefits are completely subjective.

All language decisions are trade-offs that come with some downside. I wrote Perl for 4 years, and I would still get tripped up by its break/continue syntax (next/last) on occasion since I learned to program in C/C++.

I currently am working heavily in both JavaScript and Python, and I don't have any indentation issues swapping between the two languages (probably the issue I come across the most of switching between under_scores and camelCase for names). I could probably count on one hand the number of times I've had an indentation error in Python.

> Sure unit tests will catch the error but in most other languages the error wouldn't have been introduced in the first place.

But this is essentially the same argument for static-typing over dynamic-typing, but that doesn't get the same amount of flack as white space in Python.

Re: Homogenization of scientific computing – Python is eating other languages’ lunch

#77

I do scientific computing, and Python is one language I never actually got around to learning for some reason. However, as a long-time hobby, I do have an interest in programming languages so I like exploring things like Haskell, Clojure, Lisp, etc. One language I'm really excited about for scientific computing though is Julia. From a language-design perspective, it's beautiful. It was actually thought out rather tha…

The big question for me is whether Julia will be able to maintain its "purity" as it gains adoption.

R probably started out "beautiful" and "thought out" but has lost that edge with years of community driven development. It's also what make it so damn useful -- you can pretty much find anything on CRAN, often multiple implementations of it.

Re: Homogenization of scientific computing – Python is eating other languages’ lunch

#78

I find Lua more interesting than Python. It has all the simplicity, all of the power, none of the indentation, and is quite a nice portable tool. That said, I do wonder at times what it is about Lua that makes so many people not-interested in it, when .. from my naive point of view .. its an almost perfect language for rapid development. I don't have that feeling about Python, quite so much ..

I have no exposure to Lua. How is the library support for scientific computing?

Re: Homogenization of scientific computing – Python is eating other languages’ lunch

#79
post #70

Earlier quoted context omitted.

Any good editor should be able to figure out the indents when pasting. I'm not an emacs user, but I'd be surprised if there wasn't a plugin with smart python pasting.

My point is that it's not always possible for the editor to know what the indentation is supposed to be because it can't know what the code is supposed to do. Suppose you have code like this: [...] if a: b c [...] And then you paste some snippet you got from somewhere else between b and c: [...] if a: b pasted_snippet c [...] The editor cannot know how to indent that properly. It's not a problem in most other languag…

In that example, a good editor should indent pasted_snippet at least to the first indent level. If you wanted it to be part of the if statement then you could just select the pasted block (both Vim and Emacs should be able to do this with a single command) and indent it by one more.

Python's use of semantic white space is more a function of it's inheritance than anything. It's based off of ABC[1].

[1] http://en.wikipedia.org/wiki/ABC_%28programming_language%29

Re: Homogenization of scientific computing – Python is eating other languages’ lunch

#80
post #68
post #32

Earlier quoted context omitted.

Getting the indentation right should be the least of your worries if you have a good editor (and don't do something like mix spaces and tabs, which I think everyone is in general agreement with across all languages). When was the last time that you manually typed out 4 (or 2, or 8, etc) spaces to indent a line of code vs. just hitting tab and letting the editor handle inserting those spaces (or the editor automatical…

The problem is larger multi-people projects. You need very strict editor/whitespace discipline, and you don't want to commit some sort of re-indent which touches every line of a file. That and the refactor issue is the main issue people have with the whitespace thing.

Which is why we have things like linters, pep8, and pre-commit hooks. :P
Post reply on HN