Jump to content

Wikipedia:Reference desk/Archives/Computing/2014 December 6

From Wikipedia, the free encyclopedia
Computing desk
< December 5 << Nov | December | Jan >> December 7 >
Welcome to the Wikipedia Computing Reference Desk Archives
The page you are currently viewing is an archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages.


December 6

[edit]

Haskell why do so much people praise it but so little people use it?

[edit]

Why is there a discrepancy between praise and use? — Preceding unsigned comment added by Noopolo (talkcontribs) 19:27, 6 December 2014 (UTC)[reply]

I presume you are referring to Haskell (programming language) ? --220 of Borg 14:47, 7 December 2014 (UTC)[reply]

@Borg: yes, or is there another thing called Haskell? — Preceding unsigned comment added by Noopolo (talkcontribs) 19:27, 7 December 2014 (UTC)[reply]

This seems to be a common trait among Functional programming languages. Lisp is also strongly praised, but not used very much outside a few niche areas.
I've developed a theory that people tend to be most comfortable in whatever style of programming language they learn first. So people who learn Lisp or HAskell first are constantly frustrated that the rest of the world doesn't use what to them is an "obviously" superior language. So they write long poetic articles, blog posts, or even books about how amazing their chosen language is and how the rest of the world doesn't 'get it'. Since Lisp and Haskell are mostly used in Academia, these articles and such are taken very seriously.
75.69.10.209 (talk) 21:43, 7 December 2014 (UTC)[reply]
It is primarily due to the computer itself. A computer, in the simplest form, is a bank of values. You shuffle the values around and change them as necessary. So, a language that most effectively manages a bank of values is one that is based on assigning values to variables and managing the variables. This is why high-level languages never become dominant. As an anecdote, John Carmack gave a response to a question about which programming language he prefers. To the best of my memory, he responded by saying that he really likes Lisp. He even likes Java (which was very new at the time). But, he programs in C/C++. Then, when he is done and everything is compiled, he goes into the machine code and optimizes it. In the end, when you are writing a 3D engine and trying to get 10 more FPS than the competitor, you must go down to the register level inside the CPU and move the values around by hand. 209.149.114.72 (talk) 13:34, 8 December 2014 (UTC)[reply]
"In theory, there is no difference between theory and practice. But, in practice, there is." [1] Haskell, much like other functional programming languages, has some really great theoretical underpinnings. These make programming languages like Haskell clean, expressive, and powerful. This explains why they're frequently praised. ... However, these theoretically pure underpinnings often are different from how people are used to thinking about problems. Monads are an excellent example - while their theoretical justification may be impeccable, they're a devil for most people to wrap their head around: "I just want to print this number on the screen. Why can't I just print the number to the screen?" The way humans think about the world is muddled, imprecise, ad hoc, and pragmatic, so they tend to prefer languages which match that style. In theory, a clean, expressive, powerful language is ideal for writing programs. In practice, people just want to get things done, so they pick the language which allows them to get things done the fastest. (And this tends to build on itself - it's fastest and easiest just to use what everyone else is using, rather than going for the theoretically ideal solution.) -- 141.39.226.228 (talk) 08:50, 10 December 2014 (UTC)[reply]
Because at the end of the day, most problems involving computers don't involve math, not really. They involve flipping the right switches in the right order to make the right lights light up. Horselover Frost (talk · edits) 19:59, 10 December 2014 (UTC)[reply]
I think any of this really nails it. Performance-wise, outside the realm of real hardware-hacking, modern functional languages are on-par with more conventional languages. Indeed, since they may encourage better algorithms, they can often beat out Java or C++. I think the reasons why people are reluctant to pick them up are partially technical and partially organisational. On the technical level, very few projects start from scratch. More often, you start from some existing code (and hence coding paradigm) and build on it. Also, you may rely on a lot of external libraries that you need to interface with your project. Both these tasks become a lot harder if you mix languages and programming styles - if your library relies on large state and side effects, it will not play nicely with Haskell. Secondly, C++, C#, Java and even C are so similar that it's easy for a programmer who knows one to pick up one of the others at least to the degree than management will believe he fits the hole. Finding programmers to work on projects with such languages is easy (finding good ones isn't, but that distinction is not something management understands, as a rule ;-). The pool of good functional programmers is a lot smaller, and many of these are in academia and do interesting research, not writing the 25th data base adaptor for statistical analysis and data reconfiguration. So even if you gain a lot of productivity by going with Haskell (or OCaml, or even Scheme), you also have a much greater personell risk. --Stephan Schulz (talk) 12:32, 11 December 2014 (UTC)[reply]