Files are a single segment of data. However, some file formats break that segment into smaller pieces to store various types of data. These divisions can further divide into smaller and smaller pieces, which makes for some potentially complex patterns. This is essentially what a fragment assembler is designed to work with: assembling fragments of data to create a single whole file.
What is a Typed Fragment Assembler?
Types can be used for two primary purposes:
verifying desirable properties of a program
making informed decisions about what routine to apply in what context
These two applications of types are very relevant to fragment assembly. It is valuable to be able to guarantee that the output data will be well formed according to some file format. Type-sensitive code switches are also helpful to keep code short and easy to read.
Is It Time for a New Assembler?
Type theory has advanced significantly since early assemblers were designed. It may in fact be possible now to create an efficient, correct, and powerful assembler that avoids some of the shortcomings of early assembler technology. λ☶ is a project that aims to provide some basic assembler functionality for a variety of applications (not just machine code generation). We’ll see if it can succeed in this attempt.