Lisper's first look at Haskell
tourdelisp.blogspot.com
tourdelisp.blogspot.com
If working in Haskell reminded him of C (and the post is full of rubbish like this [1]), I'd imagine he didn't understand Haskell at all. This is on the order ranting about how lisp is sucky because of "all those parantheses".
"And don't even dare to mention Emacs, a lot of people don't like it.It's 2008 and creating a simple Haskell editor is not an rocket science"
A supposed "lisper" saying this is hilarious. Many lisps (CLisp, CMUCL, Clojure) reccomend Emacs + slime as "their" editor (and take a lot of heat from uninformed ranters for not having an Eclipse like IDE!) .
To top it all he claims Lisp was "divinely inspired" whereas the lowly Haskell is "unblessed". (The basis fr his weird analogy, the linked martial arts "ryu" vs "do" article is an interesting read though)
I quote "Haskell is one of those 'unblessed ', modern do languages sharing company with c++, java, c#, OCaml, F# etc"
He didn't program anything significant in Haskell, didn't "get" it any way and yet is sure of its inferior nature.
This reminds me of an old HN post of a similar rant by a Clojure fanboi titled "Clojure VS Python". He had gems like "A man with a thousand knives...of which none are sharp. It's a chinese proverb ..(which) can also be used to describe Python. ". I wonder if it is the same guy? [EDIT. No it isn't)
[EDIT here it is http://news.ycombinator.com/item?id=881642].
Contrast with what an ultra competent lisper said about Haskell (Rich Hickey, dismissing another uninformed anti Haskell rant on the Clojure mailing list [ http://groups.google.com/group/clojure/msg/32b11b22ec104d4d]
"Everyone, please refrain from language wars. Haskell is a tremendously ambitious and inspiring language, for which I have the highest respect. There is zero point in bashing it (or its users) in this forum. "
The post itself is nothing more than uninformed fanboi ranting, but on HN, even dumb posts result in high quality discussion (as is already happening - silentbicycle's comments on unification for e.g), but it would have been really awesome to get an intelligent and well thought out post on "A (competent) Lisper's reaction to Haskell"
[1] another sample: "Case sensitive - why does types has to start with uppercase and functions with lowercase. "
There is a very simple explanation for that ? ;-)
Its type checks can be incredibly useful for finding code needing updates during refactoring, automatically verifying things that would otherwise require writing reams of tedious tests, etc. It's a trade-off, though - you're deliberately structuring your code so that your assumptions can be mechanically checked. This is very much a matter of taste, and I understand having strong opinions either way. (I go back and forth on it.)
Stupid type systems suck hard, though - smart static typing (ML and Haskell) and full dynamic typing (possibly with optional static annotations) both work well, but in between lies pain and misery.
Also, look at the follow-up: (http://tourdelisp.blogspot.com/2008/03/farewell-haskell.html) I feel like he barely tried.
Also, static polymorphic types are a superior substitute for many uses of dynamic typing.
While I feel vaguely anti-intellectual saying this: I grok the H-M type inference used by ML* , and the simplest mechanical application of it probably covers 95% of the things I'd use it for. It simplifies things immensely, yet it's easy to reason about. I'm not sure that more advanced types are useful enough to justify the added complexity, personally. (Though if I added one thing to ML, it would be typeclasses.)
However, I'm sure that, with sufficient experience, they probably also become second nature. I just prefer languages with relatively small semantics.
* If I had understood unification when I was learning OCaml (I learned Prolog/unification later), though, it would have seemed practically obvious. "It's trying to unify the types, based on actual usage...oh! And it infers when they're parametric!" (with a few special cases so that e.g. functions keep their more specific types in recursive calls.)
(And yes, I know you can hide symbols and such, but with raw H-M you still get these rigid concrete types. An XML parsing library that emits only XML datatypes defined in that one library and every function you write then has to know about these datatypes, and you can forget about changing that library ever again without entirely rewriting every line of code that touches it. Theoretically "every line that touches it" should be in some interface that converts it to your internal concepts, but in practice I am not completely wrapping every damn library I use so I still end up with some concrete types from libraries throughout. Mathematically this makes perfect sense, as a developer it makes my laugh derisively. Fortunately the situation isn't as bad as all that, though I'm still not 100% convinced that I'm not still at least chuckling derisively. I've been fiddling with Haskell for nearly a year now and I'm still completely undecided whether this is the future or an amusing but futile diversion from the ivory tower. I've never been this undecided about a language for so long. The awesome is so awesome, then I stumble into some unbelievably poky briar patch that I could have at least hacked around in any other language.... it's very odd.)
data MyRec = MkMyRec { op1 :: Int -> (MkMyRec, Int); op2 :: MkMyRec }
Existential types just give you direct access to all methods in an existing typeclass, which may or may not be helpful.
Btw., OCaml is on my list of "things to do" right below "create something with more than 200 lines in Haskell" (which is hard because Haskell is so dense). ;-)
You might succeed by translating USSM http://www.loup-vaillant.fr/projects/ussm The system is written in about 300 lines of Ocaml, and should be easy to translate. Plus, you can rewrite it piece by piece, and still have a system that works.
Usually when writing a program in F# I usually write out the types of the functions I need first, before worrying about how the functions work. Because the type system is so descriptive I can validate that a plan to solve a problem is going to work before I start writing code.
Because the type system is powerful, when I need to make a change, it is simple to determine where my assumptions are broken and make the correct fixes.
And that kind of things can give rise to such wonderful tools as hoogle (a type-based Haskell search engine, specify the type you need and it'll find the matching functions, whose types are often quite good insight as to their purpose)
Every language has its zealots, Lisp is no exception.
Can we stop doing this, please? This is just a really cheap way of driving traffic to a blog. All you have to do is tinker with something for a few days and write an inflammatory post. I'd rather read the analysis of someone who's written a decent-sized program in it.
The more I read about Haskell, the more I become convinced that the set of people solving decently sized real programs in the language numbers somewhere in the double digits.
I like macros, but, as a scientific programmer, I know the type of everything in my program (double-precision floating point numbers and aggregations thereof), and I don't want to play some guessing game where I figure out which types I have to declare to get something to run fast. Same with garbage collection (what! the GC might move this while LAPACK bashes on it? I need to explicitly tell it not to? Fuck!).
emacs + paredit is also the best structured editing tool I have used in any language.
I don't much like the macro system, though.
I might check out typed racket. I don't care too much about lazy evaluation one way or the other, long as all my doubles get multiplied, added, and divided, and it happens fast.
(Although it seems like clang does something special here, as I don't see many double-to-float conversions in its output.)
I much prefer unification.
FWIW, I'm working on a pattern-matching library for Lua. (tamale: http://github.com/silentbicycle/tamale) It uses linear search and backtracking rather than compiled decision trees at the moment, though I have the latter mostly done - there are a few failing tests for variable corner cases, though. (Maybe I'll get to them this weekend.) It allows repeating variables in patterns, too.
I have a problem switching thinking between Prolog clauses as logic relations and thinking of them as a problem solving process. The towers of Hanoi problem mystifies me, for example. I also have trouble seeing how to use logic programming in a larger system, to get more than example problems done. Can you recommend a good resource?
Chcek out _Clause and Effect_ by Clocksin and _The Art of Prolog_ by Sterling and Shapiro. CAE is sort of like _The Little Schemer_ for Prolog, but has a couple larger case studies as well. TAoP is one of my absolute favorite programming books - it's got as much substance as SICP. The newer edition (1994) is more expensive (though $35 used on Amazon ATM, which is a steal; it's usually more like $85-100), but adds quite a bit of new material.
_The Craft of Prolog_ by O'Keefe is also good, though disorganized. (I think it was written as commentary on something else, and without that, its structure seems a bit arbitrary.)
I mostly use Prolog for prototyping and exploratory programming. It would probably be more generally useful as an embedded language library, like Lua (another favorite of mine). It's a bit awkward as a fully standalone language, since things like IO don't always mix with backtracking. It's great as a rule engine, though, and would probably also be brilliant as a query language for a document-oriented database.
Fully agree. I'm learning prolog too, and it's really fantastic for the types of problems it was designed (e.g. resolving constraints and expressing relations), but I didn't enjoy doing IO in Prolog. My solution is to use lisp as my primary language and use an implementation of prolog-in-lisp (e.g. racketlog for racket). This way I have the best of both worlds.
http://www.reddit.com/r/lisp/comments/cs94g/on_preferring_li...
Most programmers who achieve mastery in a fringe language find themselves having to justify their choice of tool to others. I think that poster did a good job in that regard.
Btw, Lisp vs Haskell debates can either lead to intellectually stimulating discussions, or they can devolve into a bum-fight. The decision that leads to the choice of either language over something more "popular" is the same: a quest for beauty and profound insight.
I love lispers. I always learn something from their writings, and generally admire their prose. There seems to be some correlation between deftness of expression in fingernail-clipping languages and deftness of expression in English.
I don't quote the above part as an example of that, but rather because I find the contrast to be damned funny. Somewhere in the deep, misty recesses of history there was a divinely-inspired Ryu for some natural language that was an ascestor to English, and that Ryu said that sentences were simple - subject, verb, and an optional direct object: "Thag hunt beast", or "Narg die".
Yet those who want an obscenely simple syntactic kernel to build everything on seem to be adroit with compound-complex sentences, replete with gerunds, prepositional and participle phrases, appositives, interjections, and modifiers galore.
Just once I'd like to see a critique of a syntactically complex functional language like haskell that's written entirely in caveman. It would sound more honest.
() For those interested my favorite languages are lisp dialects (cl,scheme and clojure), array languages (j & q), Prolog, Erlang and concatenative languages (Factor, Cat & Joy)