Live data from Hacker News

Why We Use OCaml

tech.esper.com

101–110 of 144 posts

Re: Why We Use OCaml

#101

> 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…

Having substantial experience running a startup on Scala (Not OCaml, but many of the same aspects apply) I'm going to throw my 2c in.

> 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.

You'd be surprised how good the community is around FP languages.

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

I'm going to strongly disagree on this one. FP is different to what you're used to. Once you've learned it I actually think FP is substantially easier, especially when maintaining large codebases. The amount of cognitive effort required to write code in an FP style is substantially lower.

> You will always need exceptionally talented developers to work on your code base and that will get expensive

I work with Scala, not OCaml personally, but I've been able to train Junior Java devs up on Scala (In a pure-fp style) with minimal effort. In addition, I find there's a very large talent pool of excellent developers wanting to work with FP in a commercial environment, and are willing to work for less for the opportunity.

Hiring has actually been substantially easier since I switched to Scala, and I'm getting better developers for less.

> 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? I don't know. Will Ruby-on-Rails? Yes. I'd pick RoR any day just to eliminate the risk of getting to market late.

I'm sure people were saying the same thing about PHP vs RoR back on the day.

Any new technology is a risk if you're new to it.

For those that have taken the 'risk' of using an FP language, the payoff has been worth it. From my experience with FP Scala, the go to market time has been substantially quicker than with any other platform I'd used previously. The defect rate has been 90%(!) lower, productivity is higher, the codebase is easier to work on, an it's easier to find top-tier developers.

Mind you I can understand not wanting to bet the farm on it from day one - this is why Scala was an easier choice for us, because we could fall back to Java if we have problems (We didn't).

Re: Why We Use OCaml

#102
post #67
post #41

Earlier quoted context omitted.

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 warp…

I would agree that in my personal experience, those people do tend to be quite intelligent. However, I have not found them to be more productive (and in some cases, they seem to be less productive, because they spend so much time fiddling and tweaking instead of just finishing things).

But is that short or long term?

That is, is their fiddling and tweaking just code masturbation, or is it actually leading to a better product? Do they produce less in a given amount of time, but that product is more solid, robust, extensible and maintainable than their peers? That may be a worthwhile tradeoff to many businesses.

Re: Why We Use OCaml

#104

> 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…

Having substantial experience running a startup on Scala (Not OCaml, but many of the same aspects apply) I'm going to throw my 2c in. > 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. You'd be surprised how good the community is around FP…

I think the issue is expressive power, since FP languages have more power people find them daunting, like calculus, however, like calculus once you understand it many formerly complex problems are quite simple.

Re: Why We Use OCaml

#105
post #95
post #63

Hey HNers, I'm the CEO of Esper - there's been a lot of questions regarding the business case for OCaml and I think it'd be helpful to write here: 1) It's practical - for our team, we had developed in it before and had deployed a large system in it - we could get to where we wanted quickly. 2) we think it's a competitive advantage (see OP and PG's Beating the Averages essay) - additionally, since we deal with large a…

How do you feel about the fact that OCaml has no capacity for "real" multithreading? It seems that such capability will only become more important in the future.

Is it obvious that you need threads instead of CSP ?

Re: Why We Use OCaml

#106
post #93
post #87

Earlier quoted context omitted.

by joining the Caml Consortium (very cheap), we got access to the core developers and a yearly face-to-face. We're talking about Xavier Leroy and Damien Doligez here. Do you get that with Java? What do you find most useful about talking to core OCaml devs? If you were developing in Java, do you think you would see a similar benefit from talking to core Java devs? How do you find the OCaml standard library compares to…

> What do you find most useful about talking to core OCaml devs? If you were developing in Java, do you think you would see a similar benefit from talking to core Java devs? OCaml (and Java, and Python, and any other "old" language) evolves in small steps to avoid breaking existing code. A forum like this allows language developers making those design decisions to check them with big users, as well as to gather the q…

Java has JCP.

Re: Why We Use OCaml

#107
post #69

Earlier quoted context omitted.

While your mileage will vary depending on the nature of your startup, I can point you to a paper we wrote summarising our experiences using OCaml to build the XenServer toolstack in a startup environment [1]. You should bear in mind that OCaml represents almost twenty years of continuous development (see the history chapter in Real World OCaml [2]), with a community steeped in some of the most cutting edge technology…

> I find it amusing that so-called "risk-averse" startup managers discount a 20-year old language with legendary stability in favour of relatively new languages. While I mostly agree with your post, the four languages mentioned as opposed to OCaml in the grandparent post (Ruby, Python, Javascript, and Java) are all older than OCaml (which is 18 years old) -- Java, JavaScript, and Ruby are all 19 years old, and Python…

20 years for language X do not bring the same amount of benefits as 20 years for language Y, as can be clearly seen if we compare Javascript and OCaml.

Re: Why We Use OCaml

#108
post #95
post #63

Hey HNers, I'm the CEO of Esper - there's been a lot of questions regarding the business case for OCaml and I think it'd be helpful to write here: 1) It's practical - for our team, we had developed in it before and had deployed a large system in it - we could get to where we wanted quickly. 2) we think it's a competitive advantage (see OP and PG's Beating the Averages essay) - additionally, since we deal with large a…

How do you feel about the fact that OCaml has no capacity for "real" multithreading? It seems that such capability will only become more important in the future.

Because there are no libraries for concurrency...

Not built in does not mean not possible or available...

Re: Why We Use OCaml

#109
For a more in-depth list of reasons to use OCaml, I recommend “OCaml: What You Gain” at http://roscidus.com/blog/blog/2014/02/13/ocaml-what-you-gain....

It is part of the series of posts linked in “Python to OCaml: Retrospective” at http://roscidus.com/blog/blog/2014/06/06/python-to-ocaml-ret... (HN story: https://news.ycombinator.com/item?id=7858276). I learned a lot about OCaml from that series of posts.

For more comparisons between OCaml and other langages, see the first two posts in the series. In the first post, http://roscidus.com/blog/blog/2013/06/09/choosing-a-python-r..., the author compares OCaml to many languages, including Python, Go, and Haskell. The second post http://roscidus.com/blog/blog/2013/06/20/replacing-python-ro... summarizes his conclusions about the languages – he decided that either Haskell or OCaml would meet his needs best. (He chose OCaml after that, obviously.)

Re: Why We Use OCaml

#110
post #83

Earlier quoted context omitted.

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.

Jon mentioned modularity, so what I imagine he's talking about is functors. They have a scary name (and no relation to Haskell functors) so you might rather call them parametric signatures and they allow one signature to depend upon a previously defined one. Ultimately that means that you can decompose signatures into constituent, reusable parts which is nifty sounding but transformative in how you express APIs

How is it that they have no relation to Haskell functors?

> Functors are, roughly speaking, functions from modules to modules (https://realworldocaml.org/v1/en/html/functors.html)

Functors in haskell have functions (fmap) that take a value (a function) from one category into another.

Are they not at least the same Functor as in Category Theory?

Post reply on HN