Ok, I am a Java programmer without any functional programming knowledge.
Now I have been currently learning OCaml for 2 weeks, and I don't get even a clue about OCaml.
There are several tutorials and books suggested here:
https://stackoverflow.com/questions/2073436/ocaml-resources
but none of them seems friendly. Really, I mean it.
None of the tutorials or books at least gives me a Hello World
quick start. after two weeks, I even don't know what is the program entrance
of Ocaml (such like a main()
).
I even have no idea of how to really write OCaml codes into a file, and somehow let OCaml compile it.
Ok, complaints are finished.
I have to learn it and do it well. So, could you please give me some suggestions of learning it? I feel OCaml is very obscurity and hard to understand. Please enlighten my road.
Problems. We have observed that OCaml is really hard for beginners to learn without help. The main cause is the terribly poor reporting of static and dynamic errors. We describe a few striking examples below.
The only problem with OCaml is that not many people know how to code in it, and therefore not many people use it.
ML-derived languages like OCaml are "mostly pure". They allow side-effects through things like references and arrays, but by and large most of the code you'll write will be pure functional because they encourage this thinking.
The main advantages of OCaml are its functional nature, readability (it reads almost as nicely as a dynamic language like Python), reliability, but mostly speed. OCaml is much, much faster than most people believe - it's C fast (actually slightly slower than C, but many, many times quicker than dynamic languages).
Did you try TryOCaml website ? It can be a good start.
I first met OCaml 4 years ago and I needed to add some little features to existing student's project at the University. I started from OCaml tutorial and I understood how awesome this language is. Then I tried to write more or less big programs in OCaml and started to ask the community questions. From my experience I think you need the same thing. Pick up a favourite area of programming (web, unix tools, graphics & games, desktop applications), take a project which is not too big or complicated for your first application. I think the OCaml community can help you to decide. You can reach them in maillist but I prefer Freenode IRC server more. And then just write some code and if something is strange ask!
Best wishes, Kakadu
P.S. I hope OCaml will be your next big love as it has become for many of us.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With