Live data from Hacker News

Real World Ocaml announced

realworldocaml.org

31–40 of 58 posts

Re: Real World Ocaml announced

#31
post #4
post #2

Oh.. I thought that this was going to be an actual version of Ocaml that was practical in the real world, rather than a book.

So what's impractical about Ocaml? I just looked at it and it looks cool, but I haven't tried it for anything. If they actually have event driven programming that seems like a big step over most functional languages, where I/O is kind of an afterthought. Steve Yegge wrote some points about Ocaml quite awhile ago. http://sites.google.com/site/steveyegge2/ocaml He says it is quite fast and I've seen that in other place…

I've tried OCaml a few times over the years, and I think its biggest problems are chicken/egg problems. It's impractical for "real world" use because not many people are using it in the real world.

My biggest complaints:

* Poor libraries - This is getting better, but it used to be a real pain to do stuff like make an HTTP request, parse JSON or XML, or connect to a database. They definitely weren't in the stdlib, and it was even pretty hard to find good third party libraries for it.

* Awkward library interfaces - Even the libraries that are included are awkward to use, like the Set and Map.

* Poor documentation - There's nothing (or was nothing) like http://perldoc.perl.org/ or http://docs.python.org/

And, off-hand, one language nitpick:

* Poorly handled strong typing - For example '+' is used to add integers while '+.' is used to add floats. The underlying reason makes sense, but there's awkward stuff like that all over. Haskell handles it better, IMO.

Re: Real World Ocaml announced

#32

Earlier quoted context omitted.

I think this is going to turn out to be a killer feature of Ocaml once people get used to the fact that using 8 cores at once isn't that great of a goal when on-demand computing platforms let you scale much much larger. I think this point isn't made often enough. There certainly are times when scaling within a single machine is useful but, as is more often the case, if you have to scale beyond a single physical insta…

Certainly, but there are circumstances - say high-performance math & data heavy stuff - that benefits greatly from a shared memory implementation. And the ease of use of multi-process architectures needs to be improved as well.

The common case of parallelism is usually fine with process/message passing work IMO.

For the other 20% of the time... threads are awesome. :)

Re: Real World Ocaml announced

#33
post #23
post #10

Discussions of whether OCaml is "practical" or useful or good aside, this book really, really needed to be written. It may be the case that there are truly excellent resources for learning OCaml, but I know the language, and I've never heard of them. There's Jason Hickey's tutorial, an introduction or two scattered around the internet, and some book that was fan-translated from French, sure, but OCaml lacks the hacke…

Are OCaml or Haskell taught in CS51 these days? That would be wonderful. Neither language was used on the general (non-PL theory, except a bit in the compilers/languages area) CS track in the 90s. Also, OCaml is spelled "F#" in English.

Looks like OCaml is:

http://cs51.seas.harvard.edu/docs/CS51Syllabus.pdf

Re: Real World Ocaml announced

#35
post #11
post #6

Earlier quoted context omitted.

> So what's impractical about Ocaml? The biggest issue Ocaml has is that its GC is single-threaded which basically removes the ability to do parallel programming inside a single executable. You have to resort to message passing between multiple processes. For what it's worth, I think I heard rumors there's work on an improved GC.

As annoying as that is, it could be turned into a design feature of your programs - only doing message passing. Hoare's CSP pretty much takes this approach, and for my money, I think that sort of approach makes the common case of parallel programming easier.

look at Ocamlnet and netmulticore

http://projects.camlcity.org/projects/ocamlnet.html

http://rwmj.wordpress.com/2012/02/24/whenjobs-job-lists-canc...

Re: Real World Ocaml announced

#36
post #6
post #4

Earlier quoted context omitted.

So what's impractical about Ocaml? I just looked at it and it looks cool, but I haven't tried it for anything. If they actually have event driven programming that seems like a big step over most functional languages, where I/O is kind of an afterthought. Steve Yegge wrote some points about Ocaml quite awhile ago. http://sites.google.com/site/steveyegge2/ocaml He says it is quite fast and I've seen that in other place…

> So what's impractical about Ocaml? The biggest issue Ocaml has is that its GC is single-threaded which basically removes the ability to do parallel programming inside a single executable. You have to resort to message passing between multiple processes. For what it's worth, I think I heard rumors there's work on an improved GC.

I'd add that Unicode support is also a problem. latin-1 isn't even good for French. My brother's name is Jérôme and the first thing I try with any language to check strings is this:

    # print_endline (String.uppercase "Jérôme");;
    JéRôME
Oops, two characters didn't get properly uppercased.

I really like OCaml, it's probably my favorite language, and I hope that RWO will increase its popularity and that this will in turn help improve the language. I'm reading a lot about Haskell these because of the times when I want to do some multi-programming with unicode text.

Re: Real World Ocaml announced

#37
post #22

Earlier quoted context omitted.

The biggest differences are that Haskell defaults to lazy evaluation and OCaml defaults to strict and that OCaml allows you to mix in imperative code without explicitly using constructs like monads.

The monad in question: http://en.wikipedia.org/wiki/Haskell_features#ST_monad

Sort of. It is more like every function in OCaml is in IO. There is just no purity guarantee anywhere.

Re: Real World Ocaml announced

#38
post #5
post #4

Earlier quoted context omitted.

So what's impractical about Ocaml? I just looked at it and it looks cool, but I haven't tried it for anything. If they actually have event driven programming that seems like a big step over most functional languages, where I/O is kind of an afterthought. Steve Yegge wrote some points about Ocaml quite awhile ago. http://sites.google.com/site/steveyegge2/ocaml He says it is quite fast and I've seen that in other place…

OCaml isn't actually a pure functional language: it has side-effects and mutation. In fact, you can code that looks an awful lot like C if you want, except with automatic type inference. But then you can also lift up your level of abstraction in the same codebase to use a purely functional idiom where it's appropriate, or use an object-oriented style for something else. All of those styles are supported as consistent…

Very cool, thank you. I watched the openmirage talk since I'm interested in distributed computing -- this is great work. I like anything that gets rid of excessive layers, and the typical cloud stack is really suffering from this.

I have been meaning to give OCaml a try for awhile but it's bumped on my list now. (Though it seems that the thing that people keep complaining about is lack of a polymorphic print...)

Re: Real World Ocaml announced

#39
post #7
post #3

I'm curious. How many folks here have used OCaml for production work? I'd just like to get an idea of the numbers. Edit: By 'production work' I meant built things that are being used by other people.

You might find this interesting: https://ocaml.janestreet.com/?q=node/61 TL;DR: Jane Street is a quantitative trading firm whose language of choice is OCaml and has several people programming in it full-time. Besides experiencing the commonly-cited advantages of FP (productivity, expressiveness, local reasoning), they also found it highly performant, useful for rapid prototyping and resilient to changing requirements…

Simcorp is another OCaml financial software shop.

Re: Real World Ocaml announced

#40
post #4

Earlier quoted context omitted.

So what's impractical about Ocaml? I just looked at it and it looks cool, but I haven't tried it for anything. If they actually have event driven programming that seems like a big step over most functional languages, where I/O is kind of an afterthought. Steve Yegge wrote some points about Ocaml quite awhile ago. http://sites.google.com/site/steveyegge2/ocaml He says it is quite fast and I've seen that in other place…

I've tried OCaml a few times over the years, and I think its biggest problems are chicken/egg problems. It's impractical for "real world" use because not many people are using it in the real world. My biggest complaints: * Poor libraries - This is getting better, but it used to be a real pain to do stuff like make an HTTP request, parse JSON or XML, or connect to a database. They definitely weren't in the stdlib, and…

The first three are indeed a big irritation, and a big motivation during writing this book. There is a lot of work going on to improve all of these at the moment, notably through Core from Jane Street providing a well-maintained accessible standard library, and a convergence of packaging systems. The good folks at OCamlPro are also working hard to better editor and documentation support, so I except there will exist a documentation/package repository before this book is released.
Post reply on HN