Real World OCaml: Functional programming for the masses
P**Z
Adding libraries and imperative makes this one of a kind
Beginners in OCaml will probably want to peruse Whitington first-- OCaml from the Very Beginning before buying this wonderful text. The format is a fast paced "tutorial" covering all the major, including advanced, functions of OCaml. I'm an old Lisp and current Haskell programmer, and this book really opened my eyes about OCaml beyond academia. Google's using it for systems, big data and domain projects. One of the authors uses it as the main engine for a trading platform. In short, this fascinating hybrid is finding many more applications beyond software engineering education. And like other functionals, its math abilities are awesome.The text has O'reilly's quality and the code, even for a brand new work, is nearly flawless. I was frankly unfamiliar with Core, the largest OCaml library, which is why I have preferred the Haskell community, APIs, libraries and SDKs for a long time. No longer! I'm a functional programmer at heart, but to survive today you have to pick up Java, C#, Python, etc. Amazingly (to me, you probably knew this), OCaml has a very cool "imperative" engine in addition to its native functional design. The authors get right into opening Core first as if you were laying an SDK or IDE foundation with that library-- meaning you don't have to spend hours on the web before trying the hundreds of examples.The "dual nature" or hybrid (imperative and functional) also means you can pick a seminal topic like recursion, for example, and build a loop function just like you would in Haskell. OR, in addition to native functional recursion, you can also use an imperative loop structure such as FOR or WHILE. I compared a FOR imperative with a Sudoku solving functional recursion loop I use all the time (# let rec find _first_stutter list= etc.), and the imperative beat the functional by almost 10 seconds for a very difficult trial. This is amazing not due to my poor functional skills, but due to the fact that my functional skills far outweigh imperative-- OC is a lot more fogiving than I imagined even in imperative!Very honestly if a young student was interested in functional, I'd recommend Haskell due mostly to the online community and many fine and growing libraries. This awesome gem of a text changes my mind about that. In nearly 500 pages, the authors convincingly show real world example after example-- including MANY from standard coding interviews-- that prove OC is all grown up far beyond Domain Specific Language and academic applications. Big data is now trending heavy stats too, and OC makes R unnecessary due to its many native calc abilities. I've also heard that Amazon is using it in new Web x.o apps, and if I click on Amazon Pizza, and my doorbell rings 10 seconds later, OCaml will now be on my suspect list after reading this text.The book is a true triple threat, as a reference, teaching guide/text, and especially as an autodidactic self tutorial even for those with basic beginning skills. OC even has its own parsing generators (akin to lex/yacc/bison etc.) that are smoking even if you don't write compilers, but deal a lot with strings and lists. I've read that big data folk all over the industry (including Facebook and Twitter) are using OC more and more, and this fine text taught me why.I got both the print and Kindle versions and prefer the print. Kindle isn't as badly slaughtered in code examples (real, not just pseudo) as some e readers, but function arguments in this language are more like UNIX than C#, and spacing matters, so consider that if you're planning on using the kindle code as written. Of course O'reilly is renowned for web support and virtually all the examples are online without the onerous "don't ever use this" statements of a lot of publishers. Highly recommended as a second text after Whitington if you're new to functional, or a first text if you're at least intermediate at Haskell or an imperative, and are ready to explore a really cool new alternative.JOB TIP: Since so many tasty companies are getting into this now, I'm thinking you might be able to distinguish yourself as a programming candidate if you learn this language, separating you from the herd! I'm not thinking many folk have figured this out yet, so go for it, and God love you! I'm too old to look through that lens, but hope it helps some of you young geniuses.
N**Y
One of the best
I struggle to express how much I enjoyed this text.Go read the table of contents to get a glimpse of what it promises. Go read the book and it will deliver.You go from "3 + 4" to the runtime system and the compiler in 500 pages and it makes sense the entire way. There is no filler content here, only clear text accompanied by excellent examples. The presentation is refreshing: here's a concept, here's an example, here's a practical problem with this code, here's how the language solves this problem, in practice there is this and that tradeoff. I wish more books were written like this.While I can't think of a better way to learn OCaml and to explore its ecosystem, I suspect that the pace might be overwhelming for a total beginner. However, considering the value per page that I've gotten from this book, I welcome the tradeoff.Buy it!
M**Y
Decent and useful book
This is an advanced book. Even if it starts with adding 3+4. Do not let it fool you.I am an advanced OCaml user, so I do not mind. I have just returned to OCaml after a longer break and I am looking around. I have only been using OCaml with the Standard Library by INRIA.OCaml is one of the best languages around.If you are a beginner, you may like to start with the two easy and short books by Whitington (available on Amazon):- OCaml from the Very Beginning and- More OCaml: Algorithms, Methods, and Diversions.This book introduces OCaml in a fast pace, together with the Core library made by Jane Street. The Core library is an alternative, not an extension of the INRIA Standard Library. I strongly recommend reading at least parts of the book, even if you may not like it. It is relevant. However, whether to adopt the Core library, is a different question. If you do not adopt Core, large parts of the book are useless. It may be worse than that, you might have to develop a feeling what depends on the Core.Positive points:- It DOES deal with the real world stuff, it might be useful.- Many Core library functions greatly improve and expand the INRIA work, they are better.- Mostly readable explanations.- A lot of useful information from practical experience, for example pattern matching is faster than if-then-else.Negative points- No word about compatibility or coexistence with INRIA libraries, or how to go from one to another.- The Core functions are all greatly different. At the first sight, there is no compatibility to INRIA.- Why not improving INRIA's heritage, why starting their (Jane Street's) own thing from scratch?- The Core library and parts of it are currently in low early versions (0.12 or 0.9? -not clear). How reliable is it?- Finding more detailed documentation on Core is not easy - it needs a lot of web searching. The OPAM documentation lists just type signatures of all functions, hardly a word more. But a web page by Jane Street has more information.- Everything in this book is difficult to install, judging from some negative reviews here.- Many of the examples are unnecessary complicated.- Why using the utop interpreter? It is cumbersome to use. The standard interpreter from INRIA deals better with errors. I refer to my OCaml version 4.01.0 on Ubuntu. With this one, you do not have to count the characters. The error position is underlined. It has been so comfortable like this in Ubuntu for years.Some more highlights - good or bad:- Map is different, Comparator is not well explained.- Hash table uses binary trees for the buckets to deal with hash collisions, so it is much faster.- Serialization uses JSON and S-expressions. Marshaling is not even mentioned. It is faster and less safe. It is a compromise.- Parallel programming would be highly useful, but it is not covered in this book, although implemented.- C-interface is greatly improved.- Garbage collection & a lot about system details and compiling.- Command line parsing and error handling.- Weak polymorphism to complement the strong typing.- Functors - getting around of bad support for polymorhism in OCaml, by parametrization.- First class modules - similar to functors.- Objects & classes.This book is OK and the Core library is an amazing achievement. But now it needs more stability, more detailed and up to date documentation, better coexistence with the INRIA Standard library.OCaml is a functional language, faster and a lot more efficient than the bloated and complex Java-based languages Scala and Clojure. OCaml is the only reasonable functional language which has a simple compilation model and compiles your whole application into a small, single binary executable file and it is at the same time well portable between Unix, Linux, Mac and Windows. At the same time, the challenge is the right balance between the polymorphism and strong typing.Still, I have not even tried installing any of the software in this book. I shall probably not touch anything until I hear some good news. I still use only my good old INRIA standard OCaml library, beacause it is a lot easier to use - it comes all packed in and it works. But I am keeping my eye on Jane Street and its products, it is very promising and expanding fast. The second edition of Real World OCaml is in progress. It promotes the Base library as a second alternative to INRIA, besides Core (or Core_kernel?). It still promotes utop as the interpreter #1.So having said all this, I still like the book, I like to come back to it once every now and then. I never read a computer book from cover to cover, I always pick things. In this book, currently I look for the advanced stuff, like the last 4 items in my highlights above. But using it alone is not enough.Advice to you - get this book if you:1. Are serious about functional programming and OCaml2. Need to decide for or against the Jane Street Core library3. Have decided for the Core and use this book as the only available "easy" introduction to it4. Need a high level tutorial on OCaml and do not mind about or perhaps do not even need the Core stuff.I shall appreciate comments by other users and hopefully some more information by Jane Street and INRIA.
N**E
Very helpful.
Not a mathematical book (which cannot be taken for granted in the field of functional programming books). Instead this book is very hands-on. Makes it easy to learn OCAML. As a side note: After learning Haskell, Scala, OCaml and Erlang I concluded that Erlang is the most useful for my application domain (developing highly scalable distributed systems with Rest interface). However, this is just a personal comment not related to the excellent quality of this book.
E**O
Real World OCaml: Functional programming for the masses Yaron Minsky
ottimo libro per capire il paradigma FP. Preferirei la copertina rigida per evitare il deterioramento del libro, anche se in generale non le hanno, in ognicaso consiglio il libro per il suo contenuto.
J**E
Five Stars
Best book in OCaml. Must have.
P**R
L'encyclopédie d'Ocaml
La qualité de son contenu en fait un "must have" pour tous les développeurs en Ocaml qui se doivent de l'avoir dans leur bibliothèque.
キ**ん
基本的な内容から高度な解説までありますAZ-BU680
OCamlを始めたい方はこれを読めば,コンパイラまで作れるようになると思います.オライリー本は,どれもそうだと思うのですが,基本的な内容からかなり高度な内容までしっかり扱ってくれているので,とりあえずこれを読んでおけば日常のコーディングは問題ないと思います.良いです.
Trustpilot
2 days ago
1 day ago