Live data from Hacker News

The Mathematical Hacker

evanmiller.org

1–10 of 135 posts

Re: The Mathematical Hacker

#2
I think this article raises a great point overall, but the Fibonacci example is a bit weak and smacks of a strawman. Functional programming tutorials that teach you to write a recursive Fibonacci or factorial calculator are not doing so with the purpose of teaching a useful function, or even a workable one - in fact, more often than not this is called out by showing its performance for moderately large N. They only use those examples because they're simple, abstract problems that can be used to elegantly demonstrate recursion in a relatable way.

If we're going to talk about real world, practical applications, then it might be more relevant to bring up a problem for which there isn't a trivial O(1) solution. A dynamic programming problem, perhaps? It's glossed over with a terse dismissal:

> “Advanced” discussions might consider engineering considerations such as tail-call behavior, or the possibility of memoizing results.

... But this is exactly why a functional programming language might be better than an imperative for certain applied mathematics problems. Note, I'm not saying that it is better, just that it's not such a simple argument. With a different set of examples, this article could have been written in favor of Lisp just as easily. I still think it's a good article overall, just that the point it tries to sneak in about Lisp and functional programming is a little shaky.

Re: The Mathematical Hacker

#3
The article casually confounds what it is programs do and how programs are written. Programs operate on data, and said operations can be more or less mathematical in nature.

Writing programs now, that's not mathematical in nature at all. There are an infinite number of programs that compute the same result. A program is good because it meets a number of criteria, among which efficiency and math soundness are not always the most important. Many of the criteria have to do with how the human mind works and how it intuits.

Re: The Mathematical Hacker

#4
You don't need to be good to program. You need to be exceptional to do math. Most programmers aren't that good at what they do, and I think they should focus on their craft. I struggle to explain to my colleagues who make 100k that they need to do memory tiling: or that their loop doesn't vectorized. Changing a float from a double in a BFGS is 2 days of work for these people. Let the chosen few do math.

Re: The Mathematical Hacker

#5
As a programmer you may not need to use algebra or analysis on a daily basis, but as a rule I've been noticing that the solutions that are more mathematically elegant also tend to be more pragmatic.

Re: The Mathematical Hacker

#6
I find it disturbing that this article has been written in 2012. While I was reading it I really thought that it was at least 10 years old.

Computer science researchers are doing actual mathematics, and they are clearly more in what the article calls "Lisp school" than the "Fortran school". Research in functional programming is mostly mathematics. Lambda calculi (which was originally not developed to be a programming language at all), types, logic, category theory… Most of the tools used in programming languages research are mathematical tools, and they always have been.

The article is great and I mostly agree with its conclusion, but it seems to miss a lot about what is actually going on in computer science. I understand that it mainly talks about programmers and not computer scientists, but it's less and less true that programmers are not interested in what is happening in computer science research. Lisp invented a lot of the stuff that are now in almost every languages (conditionals, garbage collector, first class function, everything is an expression, recursion…) and it took many years to arrive here. But nowadays I see a lot of interests from the programmer community for what is happening in the programming languages research around Haskell, Scala, OCaml, and even stuff like Coq, Isabelle… ! In order to understand even a little what is actually going on with these research project one have to study (even if indirectly) mathematics.

Now that I have written this comment, I'm thinking that may be I have a skewed/distorded vision and that I'm not really talking about the same people as the article does. I don't know.

Re: The Mathematical Hacker

#8
I don't really see the point of this article. You don't need Fortran or C to implement the calculations of the Fibonacci as described in the article.

On top of that the article is missing the point that some elements functional programming (map, lambda) are actually making a numerical implementation neater.

It is not an accident that the original authors of R were themselves lispers and admitted having been inspired by lisp when creating R.

I think among others, those links will illustrate the previous point: http://cran.r-project.org/doc/html/interface98-paper/paper.h... http://www.stat.auckland.ac.nz/~ihaka/downloads/Compstat-200...

Re: The Mathematical Hacker

#9
They seem to agree on one thing: from a workaday perspective, math is essentially useless.

I would love it if someone had resources on how mathematics could actually be used as a tool by programmers.

What kind of problems would mathematics as a tool help me solve better/faster/more efficiently than the other tools in my programmer toolbox?

Re: The Mathematical Hacker

#10
Algebra is required all the time for me for pretty much any non trivial problem that isn't CRUD (most apps seem to have no functional complexity past CRUD).

The only time I had to delve into deep mathematics was implementing CORDIC algorithm for microcontroller powered floating point ops (sin/cos/ln) on a 68HC11 because we couldn't buy an implementation in that had source code so we could verify it. Even then it wasn't all that hard. Took about a week to wrap my head round the maths involved.

I do find that mathematical literature is all theory and no application, even with my engineering background. If we had some applications, people would use it more and take it seriously as well and therefore there would be more mathematical programmers.

Post reply on HN