ACM Home Page
Please provide us with feedback. Feedback
Caml-Shcaml: an ocaml library for unix shell programming
Full text PdfPdf (256 KB)
Source
International Conference on Functional Programming archive
Proceedings of the 2008 ACM SIGPLAN workshop on ML table of contents
Victoria, BC, Canada
SESSION: Session 3 table of contents
Pages 79-90  
Year of Publication: 2008
ISBN:978-1-60558-062-3
Authors
Alec Heller  Northeastern University, Boston, MA, USA
Jesse A. Tov  Northeastern University, Boston, MA, USA
Sponsors
SIGPLAN: ACM Special Interest Group on Programming Languages
ACM: Association for Computing Machinery
Publisher
ACM  New York, NY, USA
Bibliometrics
Downloads (6 Weeks): 6,   Downloads (12 Months): 43,   Citation Count: 0
Additional Information:

abstract   references   index terms   collaborative colleagues  

Tools and Actions: Request Permissions Request Permissions    Review this Article  
DOI Bookmark: Use this link to bookmark this Article: http://doi.acm.org/10.1145/1411304.1411316
What is a DOI?

ABSTRACT

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.


REFERENCES

Note: OCR errors may be found in this Reference List extracted from the full text article. ACM has opted to expose the complete List rather than only correct and linked references.

 
1
Standard for information technology - portable operating system interface (POSIX). shell and utilities. IEEE Std 1003.1, 2004 Edition. The Open Group Technical Standard. Base Specifications, Issue 6. Includes IEEE Std 1003.1-2001, IEEE Std 1003.1-2001/Cor 1-2002 and IEEE Std 1003.1-2001/Cor 2-2004. Shell and Utilities, 2004.
 
2
S. R. Bourne. An introduction to the UNIX shell. Bell System Technical Journal, 57(6):1971--1990, 1978.
 
3
 
4
J. McCarthy. A basis for a mathematical theory of computation. Computer Programming and Formal Systems, pages 33--70, 1963.
5
 
6
 
7
 
8
Rootless Root: The Unix Koans of Master Foo. In E. S. Raymond. The Art of Unix Programming. Addison-Wesley, 2004.
 
9
O. Shivers. A Scheme shell. Technical report, Massachusetts Institute of Technology, 1994.
 
10
J. Snover. Monad manifesto. Technical report, Microsoft, August 2002.
 
11
B. Verlyck. Cash, the Caml Shell. INRIA, 2002. URL http://pauillac.inria.fr/cash/.
 
12
C. G. Walters. Hotwire shell, 2007. URL http://hotwire-shell.org/.
 
13
M. Wand. Complete type inference for simple objects. In Proc. 2nd Annual IEEE Symposium on Logic in Computer Science (LICS'87), pages 37--44, 1987.

Collaborative Colleagues:
Alec Heller: colleagues
Jesse A. Tov: colleagues