Ebook: Practical OCaml
Author: Joshua B. Smith (auth.)
- Tags: Programming Techniques
- Year: 2007
- Publisher: Apress
- Edition: 1
- Language: English
- pdf
Objective Caml (OCaml) is an open source programming language that allows you to utilize both functional and object-oriented programming. Sporting features such as a robust object system, type safety, and an expansive standard library, OCaml is a language that encourages pragmatic solutions instead of dogmatic ones. Boasting performance on par with the likes of C/C++, and having compilers available for a variety of platforms, including Windows, Unix, Linux, and Mac OS X, enterprise developers should consider adding this powerful language to their repertoire.
Written for experienced programmers, Practical OCaml teaches OCaml in a code-intensive fashion. Readers are encouraged to follow along with most examples using the OCaml top-level (the interactive interpreter), giving them the opportunity to consider the purpose and syntax of each line. The author's considerable knowledge of the Java, Python, and C++ languages allows him to present the material at a level and perspective that readers hailing from varied programming backgrounds will appreciate.
Language aficionados will be sure to enjoy the occasional digression into tangential topics such as OCaml's impurities from the functional programming perspective, with thoughts about how to overcome them using mutability, references, and classes.
In later chapters, you'll put what you've learned to work, building applications capable of performing complex log-file processing, crawling the Web, filtering spam, and even broadcasting audio over a network using the Shoutcast protocol.
Objective Caml (OCaml) is an open source programming language that allows a programmer to utilize both functional and object oriented programming. A very fast and efficient language, OCaml's speed is on a par with the likes of C/C++. The compiler is available for a variety of platforms, including Windows, Unix, Linux, and Apple. OCaml can be found in a variety of scientific applications and is used as a teaching language in universities.
Practical OCaml teaches Objective Caml in a straightforward manner. All the features of this functional programming language are taught by example. You will learn how to utilize the OCaml language to create a simple database, do reporting, and create a spam filter. You will also learn how to do complex log file scanning, create your own network servers by creating a shoutcast server, and create a web crawler. By this book's conclusion, besides knowing when and why OCaml should be used, you will be well on your way to creating your own applications with OCaml.
Objective Caml (OCaml) is an open source programming language that allows a programmer to utilize both functional and object oriented programming. A very fast and efficient language, OCaml's speed is on a par with the likes of C/C++. The compiler is available for a variety of platforms, including Windows, Unix, Linux, and Apple. OCaml can be found in a variety of scientific applications and is used as a teaching language in universities.
Practical OCaml teaches Objective Caml in a straightforward manner. All the features of this functional programming language are taught by example. You will learn how to utilize the OCaml language to create a simple database, do reporting, and create a spam filter. You will also learn how to do complex log file scanning, create your own network servers by creating a shoutcast server, and create a web crawler. By this book's conclusion, besides knowing when and why OCaml should be used, you will be well on your way to creating your own applications with OCaml.
Content:
Front Matter....Pages i-xxv
Why Objective Caml (OCaml)?....Pages 1-9
Interacting with OCaml: The Toplevel....Pages 11-20
Syntax and Semantics....Pages 21-32
Understanding Functions....Pages 33-50
Practical: Creating a Simple Database....Pages 51-60
Primitive and Composite Types....Pages 61-71
Practical: Simple Database Reports, Exports, and Imports....Pages 73-87
Collections....Pages 89-111
Files and File I/O....Pages 113-122
Exception Handling....Pages 123-134
Practical: A URI Library....Pages 135-144
Using Ocamldoc....Pages 145-154
Modules and Functors....Pages 155-168
Practical: A Spam Filter....Pages 169-178
Practical: A Network-Aware Scoring Function....Pages 179-191
Ocamllex and Ocamlyacc....Pages 193-211
Practical: Complex Log File Parsing....Pages 213-223
The Objective Part of Caml....Pages 225-248
Digression: OCaml Is Not Pure....Pages 249-260
Digression: Functional Programming....Pages 261-272
Practical: Web Programming....Pages 273-291
Practical: A Shoutcast Server....Pages 293-308
Using Threads....Pages 309-327
Practical: A Concurrent Web Crawler....Pages 329-348
Interfacing with OCaml....Pages 349-358
Practical: Time and Logging Libraries....Pages 359-374
Processing Binary Files....Pages 375-399
OCaml Development Tools....Pages 401-410
Camlp4....Pages 411-429
Conclusion....Pages 431-443
Back Matter....Pages 445-456
Objective Caml (OCaml) is an open source programming language that allows a programmer to utilize both functional and object oriented programming. A very fast and efficient language, OCaml's speed is on a par with the likes of C/C++. The compiler is available for a variety of platforms, including Windows, Unix, Linux, and Apple. OCaml can be found in a variety of scientific applications and is used as a teaching language in universities.
Practical OCaml teaches Objective Caml in a straightforward manner. All the features of this functional programming language are taught by example. You will learn how to utilize the OCaml language to create a simple database, do reporting, and create a spam filter. You will also learn how to do complex log file scanning, create your own network servers by creating a shoutcast server, and create a web crawler. By this book's conclusion, besides knowing when and why OCaml should be used, you will be well on your way to creating your own applications with OCaml.
Content:
Front Matter....Pages i-xxv
Why Objective Caml (OCaml)?....Pages 1-9
Interacting with OCaml: The Toplevel....Pages 11-20
Syntax and Semantics....Pages 21-32
Understanding Functions....Pages 33-50
Practical: Creating a Simple Database....Pages 51-60
Primitive and Composite Types....Pages 61-71
Practical: Simple Database Reports, Exports, and Imports....Pages 73-87
Collections....Pages 89-111
Files and File I/O....Pages 113-122
Exception Handling....Pages 123-134
Practical: A URI Library....Pages 135-144
Using Ocamldoc....Pages 145-154
Modules and Functors....Pages 155-168
Practical: A Spam Filter....Pages 169-178
Practical: A Network-Aware Scoring Function....Pages 179-191
Ocamllex and Ocamlyacc....Pages 193-211
Practical: Complex Log File Parsing....Pages 213-223
The Objective Part of Caml....Pages 225-248
Digression: OCaml Is Not Pure....Pages 249-260
Digression: Functional Programming....Pages 261-272
Practical: Web Programming....Pages 273-291
Practical: A Shoutcast Server....Pages 293-308
Using Threads....Pages 309-327
Practical: A Concurrent Web Crawler....Pages 329-348
Interfacing with OCaml....Pages 349-358
Practical: Time and Logging Libraries....Pages 359-374
Processing Binary Files....Pages 375-399
OCaml Development Tools....Pages 401-410
Camlp4....Pages 411-429
Conclusion....Pages 431-443
Back Matter....Pages 445-456
....