4 ms·
>. R, Matlab, and Stata won't do web servers. Not unless they're pushed to, like Python was. >A critical thing is Python does numerics very, very well. That'
by DeathArrow 5y ago
>. R, Matlab, and Stata won't do web servers.
Not unless they're pushed to, like Python was.
>A critical thing is Python does numerics very, very well.
That's not Python doing numerical stuff. That's C code, called from Python.
- mrtranscendence 5y ago> That's not Python doing numerical stuff. That's C code, called from Python. That's sort of a distinction without a difference, isn't it? Python can be good for numeric code in many instances because someone has gone through the effort of implementing wrappers atop C and Fortran code. But I'd rather be using the Python wrappers than C or especially Fortran directly, so it makes at least a little sense to say that Python "does numerics [...] well". > Not unless they're pushed to, like Python was. R and Matlab, maybe. A web server in Stata would be a horrible beast to behold. I can't imagine what that would look like. Stata is a terrible general purpose language, excelling only at canned econometrics routines and plotting. I had to write nontrivial Stata code in grad school and it was a painful experience I'd just as soon forget.
- disgruntledphd2 5y agoYou can do web stuff in R, but it's a lot harder than it needs to be. R sucks for string interpolation, and a lot of web related stuff is string interpolation.
- mrtranscendence 5y agoYeah, I'm not surprised by that. The extent of my web experience in R is calling rcurl occasionally, so I've never tried and failed to do anything complicated.
- blagie 5y agoIt's not C code. It calls into a mixture of C, CUDA, Fortran, and a slew of other things. Someone did the work of finding the best library for me, and integrating them. As for me, I write: A * B It multiplies two matrices. C can't do that. In C, I'd have some unreadable matrix64_multiply(a, b). Readability is a big deal. Math should look more-or-less like math. I can handle 2^4, or 2**4, but if you have mpow(2, 4) in the middle of a complex equation, the number of bugs goes way up. I'd also need to allocate and free memory. Data wrangling is also a disaster in C. Format strings were a really good idea in the seventies, and were a huge step up from BASIC or Python. For 2022? And for that A * B? If I change data types, things just work. This means I can make large algorithmic changes painlessly. Oh, and I can develop interactively. ipython and jupyter are great calculators. Once the math is right, I can copy it into my program. I won't even get started on things like help strings and documentation. Or closures. Closures and modern functional programming are huge. Even in the days of C and C++, I'd rather do math in a Lisp (usually, Scheme). I used to do numerics in C++, and in C before that. It's at least a 10x difference in programmer productivity stepping up to Python. Your comment sounds like someone who has never done numerical stuff before, or at least not serious numerical stuff.
- tomrod 5y agoYet, Python (and most of her programmers including data scientists, of which I am one) stumble with typing. if 0.1 + 0.2 == 0.3: print('Data is handled as expected.') else: print('Ruh roh.') This fails on Python 3.10 because floats are not decimals, even if we really want them to be. So most folks ignore the complexity (due to naivety or convenience) or architect appropriately after seeing weird bugs. But the "Python is easiest and gets it right" notion that I'm often guilty of has some clear edge cases.
- dullcrisp 5y agoWhy would you want decimals for numeric computations though? Rationals might be useful for algebraic computations, but that’d be pretty niche. I’d think decimals would only be useful for presentation and maybe accountancy.
- tomrod 5y agoWell, for starters folks tend to code expecting 0.1+0.2=0.3, rather than abs(0.3-0.2-0.1) < tolerance_value Raw floats don't get you there unfortunately.
- gjm11 5y agoThey also expect 1/3 + 1/3 + 1/3 == 1. Decimals won't help with that.
- kbenson 5y agoThat's slightly different in that most programmers won't read 1/3 as "one third" but instead "one divided by three", and interpret that as three divisions added together, and the expectations are different. Seeing a constant written as a decimal invites people to think of them as decimals, rather than the actual internal representation, which is often "the float that most closely represents or approximates that decimal".
- 5y ago
- fractalb 5y ago> Not unless they're pushed to, like Python was. Readability of code and ease of use is a big thing. It's just not about pushing hard till we make it. edit: formating
- jonnycomputer 5y agoI wouldn't want to do a web-server in MATLAB. I like MATLAB, but no, not that.
- brainz456 5y agoOr in some cases, FORTRAN code called from Python iirc.