Ultimately, I think both OCaml and Haskell have a much nicer feel than Blub, but when I need to get something done, I reach for Common Lisp before anything else.
Ask Hackers: Opinions on OCaml?
11–20 of 42 posts
Re: Ask Hackers: Opinions on OCaml?
#12http://www.storytotell.org/articles/2006/11/22/the-quicksort...
Re: Ask Hackers: Opinions on OCaml?
#13If your problem can be presented as advanced data structures, it's really the right tool for the job. Unless if your problem is purely functional, then maybe in Haskell would do better, but we're talking about a pretty narrow niche.
When you design an application, you can generally shift complexity from the algorithm to the structuring of data, and vice versa. It's better to put complexity into data, as they're easier to debug, and that's even much truer in OCaml.
There's one very cool feature in Haskell that ought to make it into OCaml, though: classes (which are almost unrelated to the homonym OO concept).
Re: Ask Hackers: Opinions on OCaml?
#14Re: Ask Hackers: Opinions on OCaml?
#15I don't know why OCaml gets so little attention (and such bitter hatred from a few people), but maybe it's because its merits are mundane: it focuses on doing things right, rather than superficial coolness (Python) or lofty idealism (Haskell, Scheme). The result is a language that's very nice to use.
Re: Ask Hackers: Opinions on OCaml?
#16Having said that, there are a lot of constraints around real world use. Libraries, the ability to collaborate with other (blub) programmers, etc. I've used it exactly once in anger -- not on a learning/hobby project -- and although it was a resounding success, I had to go out of my way a bit even then to bring O'Caml to bear.
I'd highly recommend it if you're out to learn, and particularly so if you've never used a modern statically typed functional language before. It also makes sense to deliberately choose learning projects that play to the languages' strengths. I myself set out writing a L-System interpreter & functional image composer, which is good for learning because you can see your bugs...
Re: Ask Hackers: Opinions on OCaml?
#17Re: Ask Hackers: Opinions on OCaml?
#18Steingold pretty much seems to be saying "OCaml sucks because it isn't Lisp". I think languages like OCaml and Haskell would work nicely in situations where you have a pretty good idea of how your program is going to work before you write any code. I've never worked on a non-trivial project where that was the case. Ultimately, I think both OCaml and Haskell have a much nicer feel than Blub, but when I need to get som…
I've found the code is easy to change. Type inference lets me swap out datatypes without changing any code. If i need to add or remove arguments, the compiler tells me everything i need to update.
I've run into two situations where i don't know what to do next. Both times, I've been able to figure out what i need, without figuring out exactly how to do it. That gave me enough of an edge to write a quickcheck test or two. Then i fooled around with various implementations until i found something that met quickcheck's requirements.
It's been very nice.
That said, i've picked up haskell 4 or 5 times, worked on something for 1-3 months, become frustrated, and quit. I feel like i'm finally proficient enough to actually solve problems.
I don't know if it's worth it. I've come to appreciate all the compiler can tell me. In CL, you can use very abstract data structure access like elt. + is overloaded to work on everything. Haskell gives typeclasses. Haskell macros are disgusting, where lisp macros are very pretty. Since haskell is lazy, a lot of the control flow macros aren't as useful.
I like haskell. I'd like it to be my default language. Lisp lets me make lisp look like they way i think, so i can write big fancy programs. Haskell frees me up from thinking about the rest of the program so i can write nice modules.
Re: Ask Hackers: Opinions on OCaml?
#19Looked into it in college. I liked it a lot - it's fast, clean, safe, and has some cool features. Also was easier to learn than Haskell. I left it behind because it was easier to learn than Haskell. I use these languages (Ocaml, Haskell, Erlang, Scheme) because they're mind-expanding. For practical programs, I'd rather use something practical, like Python. Haskell was more mind-expanding than Ocaml, and so was better…
Interesting, I had thought OCaml and Haskell were pretty equivalent in regards to functional programming. OCaml's plus is the ability to break out of the functional mindset when you really need it, mainly for speed (can beat c++ when used properly): http://www.cs.ubc.ca/~murphyk/Software/Ocaml/why_ocaml.html I think that is cool, because in my mind functional and imperative programming each have their distinct niche'…
Having said that, it was remarkably civil!
Re: Ask Hackers: Opinions on OCaml?
#20I'm thinking of making my next project straight html with Javascript hitting an OCaml server(s) on the backend using JSON. I believe if done correctly you should be able to do all sorts of cool stuff, like continuations across the http barrier. I don't know if any of you have looked at the F# web toolkit (open source I believe), but it allows using OCaml in one script file and tagging your methods to either run on the server or client or both places at once. So you have one module file that exists anywhere you like it to -- very cool stuff indeed.
So count me in!