ijt
Re:Why Systems Programmers Still Use C (2006)
on Monday March 19, 2012 @02:55AM (#3722731)
The difference is not only due to identifier length. Haskell's sort is a function in the mathematical sense. By looking at its type, I can see the input and output at a glance and understand how to use it. It's not immediately obvious from the signature of the C++ sort procedure that the "first" and "last" arguments are being used for both input and output. When you abbreviate the identifiers for STL sort it's even less obvious what's going on.
Re:Why Systems Programmers Still Use C (2006)
on Monday March 19, 2012 @12:00AM (#3722219)
I was surprised that the author thinks the syntax of Haskell is no better than that of C++. Let's look at a typical example. In Haskell, the signature for sort is
sort :: Ord a => [a] -> [a]
which just says that it takes a list of comparable things and returns another list of the same type. Here's the type signature for sort in C++:
template <class RandomAccessIterator, class Compare> void sort ( RandomAccessIterator first, RandomAccessIterator last, Compare comp );
The difference in terseness and clarity is a big reason why I use Haskell when I have a choice.
Hammock-driven Development
Backus Turing Lecture: Can Programming be Liberated from the Von Neumann Style?
Re:Ask HN: How to 100% turn off Google personalization for search?
on Friday October 07, 2011 @06:29PM (#3086263)
Have you tried http://disconnect.me/?
Re:Emscripten, an LLVM-to-JavaScript compiler
on Sunday October 02, 2011 @12:20AM (#3062055)
GHC 7 can use LLVM as a backend. That might allow generation of JavaScript code from Haskell. There's already ghcjs (https://github.com/sviperll/ghcjs), but the output from that is quite verbose from what I've seen so far.
Update: For OS X you need GHC 7.2 to use the LLVM backend. Otherwise GHC just ignores the -fllvm flag. The Haskell Platform only uses version 7.0.4.
Iteratee IO safe, practical, declarative input processing
Quantum Theory From Five Reasonable Axioms
Re:Step one is admitting you have a problem
on Tuesday December 08, 2009 @02:06PM (#984344)
Here's the same table sorted by hours for easier reading:
hours count percent
0-4 7 3
5-20 14 5
20-30 11 4
30-40 42 16
40-50 66 25
50-60 52 20
60-70 35 13
70-80 16 6
80+ 21 8
Re:Ask HN: P=NP, what do you do?
on Monday June 01, 2009 @08:42PM (#637132)
Test driven development would take on a new meaning, with the programmer a writing collection of tests and letting the computer find the shortest program that makes them pass.