Live data from Hacker News

Why We Use OCaml

tech.esper.com

41–50 of 144 posts

Re: Why We Use OCaml

#41

> OCaml includes many features that are not available in the more mainstream programming languages ... and we believe this gives us a competitive advantage. ... The purpose of this post is to explain the benefits of OCaml and compare it to other languages. We hope to convince readers, especially other developers, to consider adopting OCaml for their projects as well. The authors did a great job explaining the benefit…

I often hear how using how using less mainstream and more difficult to learn (as in requires some mind warping if coming from more mainstream language) languages acts as a filter that will leave more capable programmers to choose from, even if there are less of them.

Does anyone know if there have been studies to back this up? Or studies that back up the above comment.

My experience is that programmers who enjoy warping their minds with something different tend to be more capable, or at the very least, up for a challenge. Would be nice to see something else than anecdotes.

Re: Why We Use OCaml

#42

A bit surprised F# was not even mentioned. I guess they are hardcore meta-programming users?

F# is an ML without any of the things which make ML good (modularity). It's a breath of fresh air if you're on a Microsoft platform, but if you can use OCaml, it is superior.

Hey Jon, being an F# user who is not very familiar with OCAML, I'd love to know a little more about what specifically F# lacks that makes OCAML superior. I want to know what I'm missing out on.

Re: Why We Use OCaml

#43

> OCaml includes many features that are not available in the more mainstream programming languages ... and we believe this gives us a competitive advantage. ... The purpose of this post is to explain the benefits of OCaml and compare it to other languages. We hope to convince readers, especially other developers, to consider adopting OCaml for their projects as well. The authors did a great job explaining the benefit…

But there is a strong community behind OCaml. A lot of undergraduate programs use a dialect of ML for their core classes. While most OCaml implementations have poor standard libraries, Jane Street Capital has released several open source libraries that make it easy to implement high quality, performant applications.

> But there is a strong community behind OCaml. A lot of undergraduate programs use a dialect of ML for their core classes

I don't understand your response. Are you saying the OCaml community primarily consists of undergraduates?

> While most OCaml implementations have poor standard libraries

That right there should tell you something.

Re: Why We Use OCaml

#45
post #21

Earlier quoted context omitted.

Of course, you can build your own closure: void do_stuff_with_file(struct relevant_data *, FILE *); ... { struct relevant_data data = { ... } with_open_file_for_writing(do_stuff_with_file, data, filename); } IMO, the biggest downside there being how far it typically pushes the definition of that function from the call site. Small functions - a good practice anyway - ameliorates that a bit.

you can, but it's sufficiently clunky that it simply doesn't feel like a natural thing to do in the language. good language design is a lot more about the things it makes easy and natural than the things it makes possible.

"you can, but it's sufficiently clunky that it simply doesn't feel like a natural thing to do in the language."

It does to me, but I've done enough functional programming that I easily reach for concepts from that space.

"good language design is a lot more about the things it makes easy and natural than the things it makes possible."

Of course. I don't know where you got the idea I was saying closures aren't a good thing to have language support for. I said precisely the opposite.

Re: Why We Use OCaml

#46
post #20

Earlier quoted context omitted.

Haskell uses lazy evaluation by default, which makes it hard to reason about the space usage (or termination) of a particular program. OCaml on the other hand is not lazy by default (but supports it if you need it). At least that is one of the reasons why I chose to learn more OCaml than Haskell.

Why do you think termination is easier to reason about in eager languages? I think it's quite the opposite: in lazy languages functions compose, in strict ones they don't necessarily. For example, you cannot compose a "take ten values" and "square all elements" function in a strict language if the argument you apply their composition to has infinite length (e.g. is cyclic).

It doesn't necessarily have to be that way.

You can have both composable functions and non-wasteful semantics without turning the whole language into a lazy mess.

Note that this approach will also allow you to abstract over different data sources more easily.

Re: Why We Use OCaml

#47

> OCaml includes many features that are not available in the more mainstream programming languages ... and we believe this gives us a competitive advantage. ... The purpose of this post is to explain the benefits of OCaml and compare it to other languages. We hope to convince readers, especially other developers, to consider adopting OCaml for their projects as well. The authors did a great job explaining the benefit…

> There is not a strong community behind OCaml. You can't take advantage of the numerous libraries and references created by the community like you can with Ruby, Python, Javascript, Java, or any of the other mainstream languages.

There certainly seems to be a strong community behind OCaml. There may be languages with stronger communities (but doesn't distinguish, particularly in individual domains, OCaml from the other languages you list.)

> OCaml is hard (and so are most functional programming languages).

Functional programming languages may be initially hard, compared to unfamiliar imperative languages, for people who have deep imperative programming experience. I don't see any reason to believe they are objectively hard, and plenty of people learn functional programming (even if not in a pure functional language) early on in their programming education and are familiar with it to a degree that functional programming languages aren't categorically difficult.

> OCaml is not popular. You will have to pay an additional premium for OCaml developers due to the lack of experienced talent.

This assumes that "not popular" means "low current supply" but not also "low current demand". If the benefits are underrecognized among firms, then the current supply of OCaml developers could well be underpriced compared to value.

> OCaml is a risk. If you're starting a consumer-oriented service, you need to prove there is a market for it. Will OCaml help you get to market faster?

Faster than what?

> I don't know. Will Ruby-on-Rails? Yes.

In the Ruby-on-Rails case, do you really know, are you just following accepted wisdom? What's the comparison "faster" against in the first place?

> I'd pick RoR any day just to eliminate the risk of getting to market late.

If RoR really could eliminate that risk, and had no other costs for doing it, that would be a no brainer. However, I don't see the basis for the concluding that that is genuinely and universally the case.

Re: Why We Use OCaml

#48
post #44

They mention they use Ocaml for server-side tasks. Is there a popular solution in OCaml for writing web pages or rest apis?

I don't know about the current popularity, and I'm sure other stuff has come along since I've been familiar with what's going on in OCamlland, but there's certainly http://en.wikipedia.org/wiki/Ocsigen

Re: Why We Use OCaml

#49

> OCaml includes many features that are not available in the more mainstream programming languages ... and we believe this gives us a competitive advantage. ... The purpose of this post is to explain the benefits of OCaml and compare it to other languages. We hope to convince readers, especially other developers, to consider adopting OCaml for their projects as well. The authors did a great job explaining the benefit…

The fact that OCaml is not an easy language might be a good way to find great developers.

Re: Why We Use OCaml

#50

> OCaml includes many features that are not available in the more mainstream programming languages ... and we believe this gives us a competitive advantage. ... The purpose of this post is to explain the benefits of OCaml and compare it to other languages. We hope to convince readers, especially other developers, to consider adopting OCaml for their projects as well. The authors did a great job explaining the benefit…

I was trying to write an eloquent reply but I remembered that PG did a better job than I could.

http://www.paulgraham.com/avg.html

Post reply on HN