Objective Caml is a flexible, expressive programming language, but for manipulating Unix processes, nothing beats the terseness and clarity of Bourne Shell: ls *.docx | wc -l
To achieve the same effect in C requires several more lines of code and, very likely, a glance at the manual page for readdir(). Despite OCaml's excellent Unix module, which provides access to a wide variety of system calls, a task as simple as counting the .docx files in the current directory is hardly easier in OCaml than in C. The code looks largely the same.
Caml-Shcaml addresses this problem by bringing high-level abstractions for Unix systems and shell programming to OCaml. In particular, we take advantage of OCaml's type system to offer statically-checked data pipelines. External Unix processes and internal OCaml stream transducers communicate seamlessly within these pipelines. Shcaml brings other essential systems concepts into the world of typed functional programming as well, including high-level interfaces to Unix facilities for I/O redirection, signal handling, program execution, and subprocess reaping.
[1]
Didier Rémy,et al.
Type inference for records in natural extension of ML
,
1994
.
[2]
John McCarthy,et al.
A basis for a mathematical theory of computation, preliminary report
,
1899,
IRE-AIEE-ACM '61 (Western).
[3]
Alan J. Perlis,et al.
Special Feature: Epigrams on programming
,
1982,
SIGP.
[4]
Alan J. Perlis,et al.
Epigrams on Programming.
,
1982
.
[5]
Didier Rémy,et al.
Objective ML: An Effective Object-Oriented Extension to ML
,
1998,
Theory Pract. Object Syst..
[6]
Riccardo Pucella,et al.
Phantom types and subtyping
,
2002,
Journal of Functional Programming.
[7]
S. R. Bourne.
An Introduction to the UNIX Shell
,
2008
.
[8]
Olin Shivers.
A Scheme shell
,
1994
.
[9]
Mitchell Wand,et al.
Complete Type Inference for Simple Objects
,
1987,
LICS.