Caml-get 0.7 review
DownloadCaml-get project is a tool to distribute and get Objective-Caml code in a way similar to the apt-get utility. We all have various
|
|
Caml-get project is a tool to distribute and get Objective-Caml code in a way similar to the apt-get utility.
We all have various functions, types, or even whole modules that we use in many different programs or libraries, but that somehow we don't put in a separate library. I see two reasons for this:
- we don't have or take the time to extract this code and create a separate library, with a Makefile, a README, a configure script, etc..., and of course all the code should be consistent in term of parameter names and order, usage of labels, ..., which takes a lot of time, too.
- the functions, types, ..., we use this way don't necessarily have anything in common: functions can manipulate strings, as well as trees, files, ....
Moreover, even if we took the time to isolate groups of consistent elements or put together elements doing the same kind of treatments, we would not, because it would make the programs or libraries we distribute depend on these small libraries. These dependencies can make the installation of the final software a real pain, especially when it is distributed in source only.
So, in the hope that more people try and use the final software, we keep the "little functions" inside, in various Misc and Stuff modules. Worse, we sometimes find a bug in one of these functions (or we improve them), and must think about fixing them in all the places we copy-pasted the code.
So the idea behind Caml-get is to make copy-paste easier, and keep track of it, to automatically change it when the original source code is modified. As an extension, it can be used to distribute this code so that other developers can use what would never have been put in a distributed library anyway.
It is possible with a language like OCaml, because writing polymorphic and/or general usage code is very easy and comes naturally.
Caml-get comes with a Cameleon2 plug-in to perform operations on the repositories, and browse available elements.
How it works:
An element can be an OCaml value, a type, a module, or an exception. An implementation code and an interface code are associated to each element.
Each element has a name, which can be different from the real name in the OCaml code, in order to organize distributed elements in a different way from the files they come from.
There are two different activites: distributing code, and using distributed code. The distributed code is put in a Caml-get archive, on a web server (by now, supported protocols are "HTTP://" and "file://"), (usually) by the author of the code. This archive contains the functions, types, modules and exceptions, along with their name, version number, comment (? la ocamldoc), and of course interface and implementation code. To create an archive, see distributing code. The archive can be seen as the server side.
Using the distributed code can be seen as the client side. The repository is the file containing the available elements and sources. By default it is ~/.camlget_repository. This repository will be filled by retrieving the content of Caml-get archives. Then, some Caml-get commands can be used to extract code of elements from the repository and put it in your own source code files, or to upgrade the code of elements (in your code) with a newer version found in the repository
Requirements:
OCaml version 3.09.0 (or later)
Cameleon 1.9.13 (or later)
Caml-get 0.7 search tags