A declarative code browser with ixml and XForms
ixml: a declarative language for transforming data representations. stable specification: 2022. The original pilot implementation of ixml, ixampl, was written in the very-high-level programming language, ABC, the forerunner of Python. The implementation is split into two parts: a bootstrap parser, that reads ixml grammars and transforms them into the structure needed for part 2, which is a generic parser that reads any document and transforms it into XML. Part 1 is about 700 lines of code, part two about 780. One of the many possible uses of ixml is to transform any data representation into XML so that it can be used as input to XForms, a Turing-complete declarative programming language that uses XML as its data format. To illustrate this, a code browser was made for the ixampl implementation, in a nicely self-referential way, using a 30 line ixml grammar to transform the ABC code into an XML representation, and use this as input to an XForms application of around 120 lines that enables you to browse and search in the ixampl code. Although the browser is for ABC code, with the exception of the ixml grammar there is little that is specific to ABC, meaning that it would be easy to adapt it for another language. So combining two declarative technologies, we were able to create a useful, functional code browser in only 150 lines of code.
|, , , , ,
|5th edition of Declarative Amsterdam
|Distributed and Interactive Systems
Pemberton, S. (2023). A declarative code browser with ixml and XForms. In Proceedings of Declarative Amsterdam.