175 karma · joined February 12, 2014
The question was about difficulty, not a subjective idea of what idiomatic code looks like. Are you seriously claiming that the average haskell example there is more difficult to write than the average ocaml example? If so, just say that. Trying to redirect the discussion back to your subjective preferences is not productive.
I think you are writing what I would call imperative code that uses some functional constructs where it is shorter. No doubt that is shorter than sticking entirely to imperative code, but it is a far cry from writing a program in functional style which requires that you not use imperative constructs.
Yes, he did. Try talking to him.
>That measures ridiculous highly tuned implementations of the benchmarks
So, fast code. Which is what is at question.
>It contains absolutely no evidence of how hard it is to write fast programs in a language.
There is both lines of code, and actually looking at the code itself. Both of which make it appear that writing fast code is no more difficult in haskell than in ocaml.
>I'm pretty sure citing the language shoot-out is an automatic disqualification in any argument about language speed.
I'm pretty sure the language shoot-out is of greater value as evidence than personal anecdote is.
No he didn't. He took the time to learn ocaml.
>Obviously you can write fast code in Haskell, but that is not the same as it being easy.
The closest thing to evidence I can find suggests that it is no more difficult to write fast code in haskell:
http://benchmarksgame.alioth.debian.org/u64/benchmark.php?te...
There is no internal ambiguous type. It is not a concrete type, it is a type variable. But it is inferred just fine. It is (Read a => a).
>which would lead many people to say that (show . read) is not "inferred just fine."
Even if you were to erroneously say that, it isn't type classes that is the problem.
Ok, but your anecodes + my anecdotes = still just anecdotes. To support the claim that it is easier to write fast code in ocaml, we need to find evidence.
>Writing the equivalent Haskell code is much more work
I have not experienced anything like that, despite having much more experience with ocaml than with haskell. You are imposing limitations on yourself when using haskell and then saying haskell is imposing them. Every ocaml function is in IO, it just doesn't provide type information to tell you that. So doing the same thing in haskell is doing it in IO, which requires no special effort at all. Even if you choose to add a purity restriction on yourself, adding "runST $" does not seem like a lot of work to me.
> :t read . show
read . show :: (Read c, Show a) => a -> cYou pose two questions, one of which is effectively irrelevant, and the other I believe is based on an incorrect assumption. Maybe 5% of code the evaluation strategy matters. It makes no difference whether you are adding strictness for 2% of your code or adding laziness for 2% of your code.
The performance question I think is a misconception. Do you have any evidence to suggest it is easier to write fast code in ocaml? I've never found a person who has used both languages and felt that was the case. I've only found people without haskell experience believing that via second (or third, or fiftieth) hand rumors.
Ocaml offers two things over haskell. One, imperative constructs. This matters for people making a transition to functional programming, but not for people who've finished that transition. Second, the compiler is fast. I don't mean generates fast code, ghc does that too. I mean it generates code quickly. This is an annoyance with ghc, no question.
Haskell offers a lot over ocaml. A useful standard library. Cabal and hackage. Parallelism done right, out of the box (super cheap green threads multiplexed over a pool of OS threads). Tons of libraries that don't exist in ocaml, everywhere from attoparsec and aeson, to binary and lenses, pipes-concurrency and STM. A community that is ten times the size of ocaml's.
There are good reasons it has gone from ocaml having the larger community to haskell dwarfing ocaml in community size, language usage, library availability, etc. in the last decade.
> :t (+ 5)
(+ 5) :: Num a => a -> aHalf of it never was as it is just "ocaml isn't lisp and I can't handle that".
Second, ocaml is a multiparadigm language for real, and with a focus of functional first. Python, ruby, perl, etc are procedural/OO languages that have map and filter. It is a huge pain and tons of extra code to write a program in functional style in python, it is lacking basically everything. It is normal to write a program in a functional style in ocaml.
If you learn haskell first, ocaml will serve no purpose for you. But for someone coming from imperative land, learning ocaml can be a helpful half-way house on the way to haskell.
>Every time I look at Android phone or TV or a router I regret that BSD/MIT/Apache is so popular
Android is built on the linux kernel, which is GPL. You are proving yourself wrong with that example.
> And users can't do anything about that.
Of course they can. If they do not want that, they can choose not to purchase it. It isn't rocket science. You are simply upset because actual users are proving you wrong, and showing that they don't give a shit about things being GPL. Your "but think of the users" histrionics are so transparently fake it is insulting everyone's intelligence to continue repeating it.
Proprietary software would still exist without free software. People who write software can do whatever they like with it, and it is incredibly self-absorbed and arrogant to suggest that giving away something they made is a problem because it violates your arbitrary belief system.
Watching another group from the outside is not experience. But what makes you say he even had that? He's pretty consistently suggested he has no time to pay any attention to any of the BSD projects going right back to 1993.
I don't know anything about webkits, but how are "the BSDs" relevant?