next up previous print clean
Next: Reproducible documents on the Up: Automatic document generation Previous: Jake: a Java implementation

No more make

Makefiles are based on rules or logical programming, which can be difficult to write and debug. Before the dawn of the makefile, programmers used simple scripts that stored a sequence of complex commands. These shell scripts execute all commands when invoked independent of the files up-to-dateness.

How about an object-oriented replacement of the makefile concept? A Java interface Target contains the state of up-to-dateness, the list of dependencies (targets the list depends on), and the method to up-date itself (build rule). Possibly, a method to free all intermediate resources (such as files) the target creates when rebuilding itself (clean rule). As mentioned before, Java source and class files field such an up-to-date mechanism that allows the Java interpreter when invoked with the check-source flag to ensure up-to-dateness of the Java class file.

By the way, I believe that for Internet applications the traditional make concept of a target as a file should be generalized to include anything that can implement the described Target interface. For example, URLs, sockets, or processes might implement the interface.

In the case of reproducible documents, the result file would need to implement an interface that extends the target interface. A build method would simply invoke the up-date method of the target. A view method would represent the result file graphically. Which graphics method is used would depend on the target's environment (Do I have a customized view method? Can I invoke a default display?). A clean method would invoke the clean method of the target and its dependencies. Interestingly, an object-oriented reproducible document implementation would not include a burn rule: the result target is the natural object to up-date itself. Once removed the rules to recreate it would be removed as well. Finally, an reproducible result object could include an info method that informs the reader about such mundane things as the result's author or the ease of reproducibility.

Given such target objects we could create standard makefiles and applets to offer access to reproducible results through the traditional command line or through the Internet. To create a makefile, the script would simply query the target about its dependencies and formulate them as a rule. To create an applet, the script would implement buttons for view, build, and clean that invoke the result target's corresponding methods.


next up previous print clean
Next: Reproducible documents on the Up: Automatic document generation Previous: Jake: a Java implementation
Stanford Exploration Project
3/8/1999