We use it in our backend to tie everything together. It serves an http/json api to our client apps (Web/JavaScript, Android/Java; iOS/Objective-C coming soon). We're handling the same data types in JavaScript, Java and OCaml.
What is clear is that we spend a lot of time fixing type errors in JavaScript due to the lack of basic type checking. Java does not have this problem and for Android programming it is a breeze since really the mobile app is just a GUI which doesn't have to do anything clever with the data.
Now the backend is in charge of serving correct data to the client apps. I could explain that OCaml is fast and lets us implement any CPU-intensive algorithm without having to switch to C, but the truth is most of our code is not much about algorithms but very much about data modeling and data management. Anything we store needs to be stored correctly if we don't want to accumulate broken data resulting in bugs that are costly to fix. Untyped languages such as JavaScript let you store anything without checking their conformance to a type definition, this is awful. Java for example would be perfectly acceptable if it wasn't so verbose. We want to write JSON-like records and arrays like in JSON or JavaScript. OCaml provides this, Java doesn't.
Now, we don't want half of our code to consist in annotating each variable with a type. The compiler should infer that 123 is an int. How hard is that? You tell me. JavaScript doesn't check anything. Java or C++ force you to declare that 123 is an int. How clever is that? I don't know. OCaml, Haskell just figure out that 123 is an int. That's called type inference. That makes code readable like JavaScript or Python, with the safety of Java and the performance of C++.
It's not clear to me why you'd choose OCaml over Haskell. I understand that OCaml isn't lazily evaluated like Haskell and has a simpler to understand compiler which gives a better understanding how the code will perform at runtime. But why as someone new why would I choose OCaml over Haskell?
From my perspective it seems like there is more activity and research going on in Haskell.
> I understand that OCaml isn't lazily evaluated like Haskell and has a simpler to understand compiler which gives a better understanding how the code will perform at runtime. But why as someone new why would I choose OCaml over Haskell?
Haskell comes with a very big community, and a lot of ways to start with the languages. I think about the http://learnyouahaskell.com/ and others.
Real World OCaml is that, without totally being it. The authors wrote it with the idea in mind that only people with a good background about functionnal world can read it.
I'd add that lazyness can be a good thing and that the type-system of Haskell is better than the OCaml one.
As I'm aware, finance industry now prefers F#. Regarding Haskell - one of its biggest user (Standard Chartered I think) uses in-house dialect of it, miu, which is strict. Basically, it just syntactically resembles Haskell... i.e. you can't just use some random Haskell library with it.
Where did you hear about this? Googling around for "miu", "miu haskell", "miu haskell standard chartered", "miu haskell standard chartered strict", etc hasn't given me anything.
For our web app we've been sticking with JavaScript so far. It's a conservative choice with a lot of problems due primarily to the absence of typing. The absence of typechecking is a problem for our moderately complex app (> 10K lines).
Alternatives that we've been considering include js_of_ocaml and TypeScript.
For the kind of Android app we're developing we wanted a native look-and-feel. That means using the Android SDK, and I don't know how going through OCaml would make that any easier.
What is clear is that we spend a lot of time fixing type errors in JavaScript due to the lack of basic type checking. Java does not have this problem and for Android programming it is a breeze since really the mobile app is just a GUI which doesn't have to do anything clever with the data.
Now the backend is in charge of serving correct data to the client apps. I could explain that OCaml is fast and lets us implement any CPU-intensive algorithm without having to switch to C, but the truth is most of our code is not much about algorithms but very much about data modeling and data management. Anything we store needs to be stored correctly if we don't want to accumulate broken data resulting in bugs that are costly to fix. Untyped languages such as JavaScript let you store anything without checking their conformance to a type definition, this is awful. Java for example would be perfectly acceptable if it wasn't so verbose. We want to write JSON-like records and arrays like in JSON or JavaScript. OCaml provides this, Java doesn't.
Now, we don't want half of our code to consist in annotating each variable with a type. The compiler should infer that 123 is an int. How hard is that? You tell me. JavaScript doesn't check anything. Java or C++ force you to declare that 123 is an int. How clever is that? I don't know. OCaml, Haskell just figure out that 123 is an int. That's called type inference. That makes code readable like JavaScript or Python, with the safety of Java and the performance of C++.