News for hackers. Stuff that matters.
Re:A comparison of programming languages in economics by bradfordarner on Wednesday July 02, 2014 @03:24PM (#7979077)
It is unfortunate that the authors of this paper didn't reach out to experts in each programming language in order to write high-quality code against which they could have run the analysis. This seems like the perfect use-case for open-source: academic study, subject-matter experts in one area who are stepping outside their areas of expertise and an interesting subject matter.

They should have crowd-sourced the code for this study with a Top Coder-like contest.

Re:A comparison of programming languages in economics by k2enemy on Wednesday July 02, 2014 @03:36PM (#7979154)
From the paper...

Second, to make the comparison as unbiased as possible, we coded the same algorithm in each language without adapting it to the peculiarities of each language (which could reflect more about our knowledge of each language than of its objective virtues).

They have invited others to fork the code on github and write the fastest possible for each language.

Re:A comparison of programming languages in economics by igouy on Thursday July 03, 2014 @01:23PM (#7984413)
This is not "as unbiased as possible" -- it is biased towards the initial form of algorithm description.

To make the comparison "as unbiased as possible" would be to code the same algorithm but adapt it to the peculiarities of each language implementation.

Re:A comparison of programming languages in economics by bradfordarner on Wednesday July 02, 2014 @03:39PM (#7979178)
Thank you for the note. I hadn't visited the github yet.

I will be interested to see whether people can whittle down the respective benchmarks.

Re:A comparison of programming languages in economics by Alupis on Wednesday July 02, 2014 @09:13PM (#7980902)
^^ This is not "unbiased"... in their attempt to make it unbiased, they introduced a huge amount of bias.

They wrote the code for each language based on prior knowledge about each language, and/or from likely googling how-to's... far from performant code with any language.

A mild understanding of each language could yield dramatic performance improvements over not understanding it at all.

Re:A comparison of programming languages in economics by ViralBShah on Wednesday July 02, 2014 @03:28PM (#7979099)
I don't know about other languages, but the authors did reach out to us to sort out performance issues with the Julia code.
Re:A comparison of programming languages in economics by bradfordarner on Wednesday July 02, 2014 @03:37PM (#7979166)
That is very good to know. That reassures me a little.

I was really impressed with the speed difference they noted between Python and R and the fact that Numba wasn't too much slower than C++ implementations. However, given the state of the R code I became wary of accepting the benchmarks at face value.

I haven't made the jump from R to Python for statistical applications yet. So, this article gave me something to think about. In terms of programmer happiness, I'm willing to live with a little slower performance in Python and not have to spend hours in C++.

Re:A comparison of programming languages in economics by Fede_V on Thursday July 03, 2014 @03:55PM (#7985348)
I've used Numba to speed up some tight numerical computations written on NumPy arrays and it's incredibly good - about as fast as rewriting it from scratch in Cython, but much, much faster.

The flipside is that it only really results in a speed up for pure numerical code - if you have to use any Python objects, then you lose everything.

Re:A comparison of programming languages in economics by rwallace on Thursday July 03, 2014 @08:42AM (#7982674)
That would answer the interesting question 'which language gives the fastest programs in the hands of someone who is an expert in that language?'

In fairness to the authors, though, it seems to me they were asking the equally interesting and rather different question 'which language gives the fastest programs in the hands of someone who is an expert in something other than programming?'

Re:A comparison of programming languages in economics by igouy on Thursday July 03, 2014 @01:02PM (#7984250)
Re:A comparison of programming languages in economics by igouy on Friday July 04, 2014 @02:11PM (#7989698)
Wouldn't that make the results arbitrary - nothing more than a reflection of the ignorance of the participants?
Re:A comparison of programming languages in economics by chuto on Wednesday July 02, 2014 @06:38PM (#7980272)
It is also unfortunate that several of the language developers and related dev communities have come out against compilers (python and jython in particular). This is the (religious) downside to open source fundamentalism.
Re:A comparison of programming languages in economics by nine_k on Wednesday July 02, 2014 @11:33PM (#7981301)
PyPy is a counterexample: it's a JIT compiler for Python, pretty efficient.

Compiling dynamic languages is not easy: their semantics of having everything dynamic and changeable at runtime resists it. Python is internally compiled into a pretty compact bytecode, but something like a method call is much more involved business in Python than even in C++, and is many times slower.

WRT fundamentalism: most sane open source communities are pretty pragmatic; Python's in particular.