2 research outputs found

    Embedding programming languages: Prolog in Haskell

    Get PDF
    This thesis focuses on combining the two most important and wide spread declarative programming paradigms, functional and logic programming. The proposed approach aims at adding logic programming features which are native to Prolog onto Haskell. We develop extensions which replicate the target language by utilizing advanced features of the host language for an efficient implementation. The thesis aims to provide insights into merging two declarative languages namely, Haskell and Prolog by embedding the latter into the former and analyzing the results of doing so as the two languages have conflicting characteristics. The finished products will be something similar to a haskellised Prolog which has logic programming-like capabilities. --Leaf ii.The original print copy of this thesis may be available here: http://wizard.unbc.ca/record=b214135

    TreeGen: a monotonically impure functional language

    Get PDF
    We present TreeGen, an impure functional language designed to express, consume, and validate JSON-like documents, as well as generate text files. The language aims to provide a more reliable and flexible way to create customised Interface Definition Languages, since the current state of the art is implemented via monolithic, ad-hoc codebases, which cannot easily be modified. TreeGen's principal contribution, aside from being tailored to the domain of manipulating documents and generating text, is the concept of monotonic mutability: despite being an impure scripting language, its execution remains deterministic under arbitrary reordering of operations, making it robust to many common classes of programmer error possible in languages that allow unchecked mutability. We prove this by basing TreeGen's unordered constraint-based formal semantics on a partially-ordered model of TreeGen's heap, then showing that the execution of any TreeGen expression's constraint set is deterministic under chaotic iteration. We also give notes on our experience implementing the language. These notes include a model for execution tracing and error reporting, necessary data structures to practically implement the formal semantics, related performance issues, and comments on potential mitigations of those performance issues
    corecore