A question about Ocaml

Some good books are listed here: OCaml Books

It doesn’t sound like you are a beginner at programming, but if you are, maybe OCaml from the Very Beginning would be a good start.

If you have been programming, but are completely unfamiliar with functional programming, you’ll need to learn to think about programming in a new way–but it is a fun and useful new way! That is probably the biggest challenge for some people with OCaml. (Also, the syntax is unusual these days, but if you wanted to do web programming, you could try ReasonML, which is OCaml with a more familiar kind of syntax.) Anyway, you might want to try Real World OCaml. If it seems too difficult because the way of thinking seems strange, you might want to temporarily switch to an easier book on functional programming such as OCaml from the Very Beginning or (my personal favorite) The Little Schemer by Friedman and Felleisen. Real World OCaml is a few years old, but there is a beta or alpha version of a new edition with updated tools and libraries: Real World OCaml

Other good sites to check are OCamlverse and the main OCaml language site.

Here is one way in which OCaml is easier than other statically typed languages such as Java: In OCaml, you don’t have to write type information all over your code, so your code is more informative and less noisy. Type information goes in a separate file from the main source code. However, you don’t even have to provide any type information, usually, if you don’t want to do that. I love this feature. OCaml does type inference, so the compiler will almost always figure out the types of all of your variables and functions, and tell you if you are using something incorrectly, and you will usually learn quickly if the compiler can’t figure it out. Most people document their types by writing type statements in a separate file, though.

Also, if you’re interested, OCaml has an excellent library Owl for linear algebra, statistics, and other numerical programming work that is still under development but that is pretty mature in many areas.