170 points · by okket · 8y ago · 71 comments
Sometimes I wonder where Mathematica would be if it were open sourced lets say in 2010. It had such a head start over Python.
Interestingly, Mathematica interop with Python is basically non-existent today, even worse than it was in the past. Short term moat building destroying long term viability.
It's really fun reading through "code golf" challenges where other languages take 10-15 lines for something that Mathematica has a built in for.
Then you will love these. I own like 10 copies, which I give to people for their birthdays: http://adereth.github.io/blog/2017/11/02/playing-with-wolfra...
Much later I realized that it's actually a more or less full-fledged programming language as well, but, I never got into that.
Romer also published notebooks and PDFs without issue previously: https://assets.aeaweb.org/assets/production/articles-attachm...
Something about his story is odd. Given his shady past at the World Bank, who knows what's actually true.
[1] A fancy expression to say "using programming to solve economic models"
https://juliacomputing.com/case-studies/thomas-sargent.html
EDIT to add: I should say that Thomas Sargent is one of the founders of QuantEcon (cited by OP), that's why I'm bringing this up here.
Another resource on Julia in Computational Economics:
That fancy expression existed well before the birth of programming.
Given that Git is already secure, I'd say all the researcher needs to know is basic usage of Git. Version controlling the notebook satisfies all the requirements you mentioned: prevents accidental distortion, is verifiable, restorable, etc.
Versioning that it's still a major problem in the ecosystem.
The article’s title is misleading. Doesn’t sound like he is a Python convert. Sounds like he is an open source tool convert.
For example, this seems to set up most of the article:
"Economics involves a lot of math and statistics. The most commonly used tools to crunch numbers are the spreadsheet software Microsoft Excel and programming languages Stata and Mathematica."
Is this really true? Mathematica and Stata seem like established but niche products to me at this point. I wouldn't say either of them are "the most commonly used tools to crunch numbers."
If you asked me to predict what a quantitative economist would be using, it would be Python, followed by R, and maybe followed by Java or C, or something like that.
This was an interesting article in the sense I like learning these sorts of things about people, but the premise seemed off to me.
But I'm not an economist so maybe this is something about economics per se.
I too was looking for good data. It’s hard to measure this as practical application doesn’t line up with publication.
I was surprised when I started working in health 10 years ago that the predominant tool was Excel, and then SAS. Even 5 years ago in health grad school, they only taught SAS.
This is slowly changing to R and python, but general data analysis skills is less than basic engineering stuff 20 years ago.
No, this is just a case of historical contingency, or the founder effect, depending on your preferred metaphor. Stata and Mathematica are suitable tools (and were suitable early on) that happened to be adopted by a few economists, whose choice was then spread and perpetuated via various organizations and institutions, word of mouth and curricula.
I've never heard of an economist using Java, and very few using C. Fortran is still quite popular in some areas.
Stata is extremely popular in some areas. GAUSS and Matlab in others (though GAUSS is declining for sure). R is quite popular, particularly since RStudio came along.
Stata seems to be really popular in economics. Certainly when I was getting my degree all the statistics, modelling and econometric courses at the economics department used either Excel or Stata. A few 'weird' kids used matlab, but the words "Python" or "R" where never mentioned.
In the blog post
https://paulromer.net/jupyter-mathematica-and-the-future-of-...
he says:
"Which reminds me. If you are a Julia enthusiast, how do you suppose the investors in this new language plan to make their big score?"
Also there's this:
https://twitter.com/paulmromer/status/985507319114096640
It doesn't seem like he's followed up on his threat/promise to write a blog post about why he's not a Julia enthusiast, however.
This is a shame because economics is already a computational discipline and increasingly so. It can be of interest to the HN crowd.
There is an awful lot of programming done by people that are not professional programmers. As an economist myself, I think code have become so central to our profession that we can no longer afford to ignore software engineering best practices. Conversely, there may be quite a few topics in computational economics that interest programmers.
For instance, an awful lot of macroeconomics - including to an extent Romer's sub-field, endogenous growth theory - is essentially programming in Dynare [0] and doing computer simulations.
Nordhaus got the prize for developing (quite basic, actually) simulation models that integrate the economic systems and environmental systems. See for instance there [1].
Micro-simulation is of course a big area where programming and economics meet - you can follow development on github [2, 3]. This is code that has an enormous impact on society, as it is used as a basis to evaluate the effects of policies.
Econometrics, aka statistics for economics, is also a big area where programmers could contribute to economic research. There is a big push to adapt ML techniques to solve economists' problems, eg Athey's research [4].
[1] https://sites.google.com/site/williamdnordhaus/dice-rice
[2] https://github.com/openfisca
I believe the NY Fed has open source economic models in Julia, too.
Please post more meaningful comments. Sure it doesn't have static typing or performance of C, but it has a stable framework in every conceivable application (Web Dev, machine learning, CLI, you name it) and works as a top notch scripting language. This is not "stupidity", it was by design to make it batteries included and easy to use with a tradeoff with the above things.
Personally, I use Python a lot for anything related to data science. No language is perfect, but I'd say Python has a lot less deficiencies and warts than most other mainstream languages, and it's extremely well suited for tasks in data science and related fields such as machine learning.
The main issue with Python is that its default platform (CPython) isn't very efficient. That's not a problem in the language itself; in fact, it's partly caused by all the benefits of a high-level language: you simply don't have the same facilities to optimize your resource consumption as you do in, say, Rust.
The upside is of course that the code is far more concise and readable.
So most of the heavy lifting is not done by python itself.
If you are using Numpy correctly (even with little understanding of Python itself and its C-API) then virtually all your hot loops are executed in optimal C code.
def a(arg = []):
return arg
a([1]) #==> [1]
arr = a() #==> []
arr.append(1)
a() #==> [1]The obvious alternative in this case would be to reconstruct the default value. This doesn't work very well with the language's evaluation model - since the function definition is only evaluated once, and it's very inefficient and in fact surprising to perform later re-evaluations.
Furthermore, this behavior can be useful. If you don't want it, you just use `None` as the default and then assign in the function body. However, if you do want it, there would be no other way to get it, and no similarly easy workaround.
Finally, had there been a consensus of it being a wart, it would have been removed in Python 3.x. It wasn't.
1. Does 3/2 == 1 or 1.5 ? Either answer would be logical and OK, provided you stick to it. The utterly daft answer that Python gives is "it depends on what version of the language you are using, and/or whether you do "from __future__ import division""
2. Generalising 1, a painful set of breaking changes between 2 and 3 that could have largely been avoided by aliasing names or introducing new names for changed concepts / methods; eg make xrange = range; add a new function rather that redefine what 'print' is (and yes, failing to make 'print' a function in the first place was a shockingly bad decision). Read about the insane amout of effort that Dropbox put into migrating their codebase to see what a ballsup this all is - polite languages respect backwards compatibility.
3. The object system is a mess: type(some_obj_i_made) is <type 'instance'> - wat? - unless you explicitly inherit your class from object when it suddenly does something sensible; constructor inheritance is a confusing bog. Yes yes old style vs new style objects, but that's the problem. This stuff shouldn't be hard; see eg Ruby.
4. edit: scoping - oy vey
Look, it's OK. It works. The ecosystem makes up for an awful lot of this rubbish. But don't be so devoted to a technology that you're blind to its faults.
There's fewer stupidities than languages like javascript or perl and it ends up being more practical than languages like haskell or ocaml.
One of it's unappreciated facets is that it's good at language interop. Instead of trying to be all things to all people (e.g. like go) it just makes it easy to interop with C where you need speed and focuses on being a good high level language.
I think the surprise surrounding its popularity is indicative of the fact that few people really understand what makes a great language.