{"id":16613353,"url":"https://github.com/yallop/ocaml-asp","last_synced_at":"2025-09-28T16:30:49.915Z","repository":{"id":54554379,"uuid":"147545198","full_name":"yallop/ocaml-asp","owner":"yallop","description":"Algebraic, staged parsing for OCaml: typed, compositional, and faster than yacc","archived":false,"fork":false,"pushed_at":"2023-07-01T08:13:01.000Z","size":18713,"stargazers_count":100,"open_issues_count":0,"forks_count":1,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-01-11T18:47:05.120Z","etag":null,"topics":["functional-programming","high-performance","metaocaml","ocaml","parser-combinators","parsing"],"latest_commit_sha":null,"homepage":"","language":"OCaml","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yallop.png","metadata":{"files":{"readme":"README.md","changelog":"Changes","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-09-05T16:06:38.000Z","updated_at":"2024-11-26T21:19:37.000Z","dependencies_parsed_at":"2022-08-13T19:31:04.887Z","dependency_job_id":null,"html_url":"https://github.com/yallop/ocaml-asp","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yallop%2Focaml-asp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yallop%2Focaml-asp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yallop%2Focaml-asp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yallop%2Focaml-asp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yallop","download_url":"https://codeload.github.com/yallop/ocaml-asp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234537865,"owners_count":18848955,"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":["functional-programming","high-performance","metaocaml","ocaml","parser-combinators","parsing"],"created_at":"2024-10-12T01:46:52.919Z","updated_at":"2025-09-28T16:30:47.382Z","avatar_url":"https://github.com/yallop.png","language":"OCaml","funding_links":[],"categories":[],"sub_categories":[],"readme":"## asp: algebraic, staged parsing\n\n`asp` is a typed, algebraic parser combinator library with some unusual features:\n\n  * `asp` parsers are checked using an internal type system before they are\n    run to ensure that the grammars they describe are unambiguous and\n    free from left-recursion.\n\n    These constraints ensure that the input can be parsed in linear\n    time without backtracking and with a single token of lookahead.\n\n  * `asp` uses multi-stage programming to achieve much higher\n    performance than most combinator libraries.  Parsers constructed\n    with `asp` can be compiled at runtime to efficient code that\n    typically outperforms parsers written with the standard OCaml\n    parser-generator `ocamlyacc`\n    \nThe following paper has many more details:\n\n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;A typed, algebraic approach to parsing ([pdf][paper])  \n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;Neelakantan R. Krishnaswami and Jeremy Yallop  \n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;PLDI 2019  \n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;(received Distinguished Paper Award \u0026amp; Distinguished Artifact Award)\n\n## Trying out asp\n\nThe [pldi-artifact](pldi-artifact) directory contains instructions for running the artifact, which can be used to try out the library and reproduce the benchmarks without installing the software.\n\n## Installation\n\n1. Install the [BER MetaOCaml][ber-metaocaml] compiler using [OPAM][opam]:\n\n   ```\n   opam switch 4.11.1+BER\n   eval $(opam env)\n   ```\n\n2. Add the [metaocaml-opam][metaocaml-opam] repository:\n\n   ```\n   opam remote add metaocaml git+https://github.com/metaocaml/metaocaml-opam.git\n   ```\n\n3. Install the `asp` package:\n\n   ```\n   opam install asp\n   ```\n\n\n## Running the benchmarks\n\nClone the repository and type `make bench`.\n\n[paper]: https://www.cl.cam.ac.uk/~jdy22/papers/a-typed-algebraic-approach-to-parsing.pdf\n[opam]: https://opam.ocaml.org/\n[letrec]: https://github.com/yallop/metaocaml-letrec\n[ber-metaocaml]: http://okmij.org/ftp/ML/MetaOCaml.html\n[metaocaml-opam]: https://github.com/metaocaml/metaocaml-opam/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyallop%2Focaml-asp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyallop%2Focaml-asp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyallop%2Focaml-asp/lists"}