Você está na página 1de 1

writeup.txt 2013-11-18 Oy. So the idea behind an exegesis is to examine a complex code file or set of files and pic!

them apart line by line. "his is an exercise in re#erse literate programming - the idea is that you$ll end up with a coherent article or wi!i that %1& explains the thought behind and implications of the code and %2& generates the code from the bits and pieces that are explained. Our starting point is a directory or file elsewhere than in the wor!ing directory. 'n this case ' ha#e a need to pull apart (in32))O*+ and ' really only care about O*+.xs. So here '$ll be wor!ing with that file only. 'deally we want some !ind of small core definition file to set things up. "hat can ,ust be a simple -./* file and we can call it exeg.defn. 't contains a reference to the file or directory to be examined. Our first step is normally ,ust to open the file in a text editor and loo! at its o#erall structure. 'f it can profitably be bro!en into sections so much the better. 'n this case all 0S files brea! down into the 12133 code setup and the 0S definitions so that much we can do right off the bat and strip off the header at the same time. "his initial part is really ,ust !ind of naming parts of the file so they can be arranged hierarchically later. . #ery natural thing to do here is naturally to brea! things into function definitions which we can naturally do with a parser. 'n this case '$m ,ust going to go line by line and define chun!s. 4ublication of the current state of the exegesis creates a set of articles2wi!i entries that contain code chun!s and commentary about them. "angling of the exegesis creates target files that are compared with the original5 any discrepancies are highlighted as errors. "he exegesis consists of two parts really) one is the actual exegetical articles and the other is a !ind of less formal series of plans and hints that should reflect the author$s growing understanding of the code. "he structure being constructed should be thought of as a coarse-grained semantic reflection of the underlying syntax5 ultimately it will turn into a true understanding of the code that can be used to port it to other languages or systems update it and so on. 2013-11-21 .t the entire-pro,ect le#el %646& we$ll abstract out entire portions of files and file structures. 7or example the build system can be functionally split out from the remainder of the 646 pro,ect. Of course this can be done for 4erl as well except that the build system is pretty simple and for (in32))O*+ there$s nothing to understand 8but8 the 0S file.... 4age 1

Você também pode gostar