{"id":18314344,"url":"https://github.com/iamrecursion/absol","last_synced_at":"2025-04-05T19:34:33.424Z","repository":{"id":162143691,"uuid":"63400230","full_name":"iamrecursion/absol","owner":"iamrecursion","description":"Formally correct DSLs","archived":false,"fork":false,"pushed_at":"2017-06-05T11:46:27.000Z","size":5212,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-03T21:33:55.329Z","etag":null,"topics":["dissertation","domain-specific-language","dsl","formal-semantics","formal-verification","haskell","metacompiler","metalanguage"],"latest_commit_sha":null,"homepage":null,"language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iamrecursion.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-07-15T07:13:27.000Z","updated_at":"2022-10-18T06:18:56.000Z","dependencies_parsed_at":"2024-04-28T01:01:42.110Z","dependency_job_id":null,"html_url":"https://github.com/iamrecursion/absol","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamrecursion%2Fabsol","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamrecursion%2Fabsol/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamrecursion%2Fabsol/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamrecursion%2Fabsol/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iamrecursion","download_url":"https://codeload.github.com/iamrecursion/absol/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247393334,"owners_count":20931806,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dissertation","domain-specific-language","dsl","formal-semantics","formal-verification","haskell","metacompiler","metalanguage"],"created_at":"2024-11-05T16:32:04.258Z","updated_at":"2025-04-05T19:34:33.418Z","avatar_url":"https://github.com/iamrecursion.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ABSOL\nThis project provides a system for the creation of formally correct\nDomain-Specific Languages (DSLs).\nIt is the **A**utomatic **B**uilder for **S**emantically **O**riented\n**L**anguages.\n\n## About ABSOL\nABSOL is a metalanguage (Metaspec) and metacompiler (ABSOL) system used for the \ncreation of formally verified and correct DSLs.\nIt allows the user to fully specify both the syntax and semantics of their DSL,\nbefore verifying the DSL correctness and generating a compiler for that new \nlanguage. \n\nThe system provides a powerful set of features for DSL creation, with a focus \non DSL execution semantics, but does not provide for Turing-Complete languages,\nas without this restriction the proof engine would not function. \nThese languages can be tailored to the domain at hand, and interfaced with via\nthe host language's Foreign-Function Interface (FFI). \n\nThe project was conceived as the topic of my dissertation at the University of\nBath. \n\n### Proving Semantic Correctness\nIn order to allow the proof of semantic correctness for ABSOL-based DSLs, \nMetaspec places restrictions on the kinds of semantic operations that the user \ncan use in their DSL.\nTo this end, semantics are restricted to those which are structurally recursive.\nThis means that all of the terms composing the semantics must consist of\nstructural sub-terms.\n\nWhile this would be an onerous restriction in the context of General-Purpose \nprogramming languages, the restricted feature-set of most DSLs means that this\nis not really an issue. \n\nWhile one may be concerned that such a restriction greatly compromises the power\nof the DSLs that could be created, the language augments this proof mechanism\nwith additional features that have been manually proven to terminate in all\ncases. \nThese include:\n\n- **Environments:** Environment access to allow for stateful computation, the\ndefinition of functions and other useful features.\n- **Function Calls:** Systems for defining and calling functions in the DSL.\n- **Semantic Typing:** The typing discipline of any defined DSL is enforced by\nthe way the DSL semantics are defined, freeing the DSL makers from needing to \nmess with typing themselves. \n- **Flexible Semantic Syntax:** Allowing restricting semantic evaluations on the\nresults of sub-evaluations, and clear syntax for defining how the semantic\nresults are produced. \n- **Direct Syntax Access:** The semantics can address portions of the syntactic\nlanguage grammar, allowing for intuitive definitions of structural semantics.\n- **Flexible Data Types:** A multitude of useful data types, including maps, \narrays, linked-lists and matrices, as well as simple raw types. \n- **Data-Traversal Functionality:** Methods for working with the included \ndata-types. \n\n## Using ABSOL\nThis repository contains all the information that you need to get started with \nABSOL. \n\n1. The metacompiler can be built from the stack project.\n2. The ABSOL libraries can be found in the `/src` directory, and accompanying\nhaddock documentation can be built.\n3. The syntax and semantics of Metaspec can be found in the dissertation \ndocument itself. \n\n### Defining a Language\nThe user must specify the syntax of their DSL using the EBNF-variant syntax \nprovided as part of metaspec.\nAn example follows:\n\n```\n\u003cfunction-call\u003e ::= \u003cidentifier\u003e \"(\" \u003cparam-list\u003e \")\" \";\"\n```\n\nThe user then specifies the semantics associated with each portion of the\nsyntax, using the metaspec semantic-definition syntax.\nAn example follows:\n\n```\n\u003cfunction-call\u003e ::= \u003cidentifier\u003e \"(\" \u003cparam-list\u003e \")\" \";\" --\u003e {\n    any n : {n = n1}() : {\n        any n1 \u003c= funcall(\n            e.\u003cidentifier\u003e[0].\u003cstatement\u003e[0],\n            \u003cparam-list\u003e[0],\n            e.\u003cidentifier\u003e[0].\u003cparam-decl-list\u003e[0]\n            )\n    } \n};\n```\n\nAnother, full example:\n\n```\n\u003cifthen\u003e ::= \n    \"if\" \u003ccondition\u003e \"then\" \u003cstatement\u003e \"else\" \u003cstatement\u003e --\u003e {\n        any n : {n = n2}(n1 == true) : \n            {bool n1 \u003c= \u003ccondition\u003e[0]}, \n            {any n2 \u003c= \u003cstatement\u003e[0]} |\n        any n : {n = n2}(n1 == false) : \n            {bool n1 \u003c= \u003ccondition\u003e[0]}, \n            {any n2 \u003c= \u003cstatement\u003e[1]}\n    };\n```\n\n## FAQs\n\n**Q: Are ABSOL DSLs Turing-Complete?**  \nNo. This restriction is in place to make the task of proving semantic \ncorrectness possible. If ABSOL allowed for Turing-Complete programming language\ncreation, it would be impossible in general to show that all programs in these\nlanguages terminate. \n\n**Q: Is ABSOL named after a Pokémon?**  \nA: Yes, definitely. The repository was sitting around for a while, unused, so\nI created a backronym for it to fit with the project. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiamrecursion%2Fabsol","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiamrecursion%2Fabsol","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiamrecursion%2Fabsol/lists"}