{"id":16345463,"url":"https://github.com/unclechu/cpp-parser-experiment","last_synced_at":"2025-10-11T20:32:23.555Z","repository":{"id":66006966,"uuid":"386159903","full_name":"unclechu/cpp-parser-experiment","owner":"unclechu","description":"My own experiment of implementing Haskell-like parsers in C++","archived":false,"fork":false,"pushed_at":"2021-08-14T14:33:26.000Z","size":209,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-24T19:46:12.026Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/unclechu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2021-07-15T04:15:37.000Z","updated_at":"2021-08-14T14:33:29.000Z","dependencies_parsed_at":"2023-02-28T23:30:23.599Z","dependency_job_id":null,"html_url":"https://github.com/unclechu/cpp-parser-experiment","commit_stats":{"total_commits":79,"total_committers":1,"mean_commits":79.0,"dds":0.0,"last_synced_commit":"4b291c4ba8fe93bafae91b79a4336bf665a5a837"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/unclechu/cpp-parser-experiment","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unclechu%2Fcpp-parser-experiment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unclechu%2Fcpp-parser-experiment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unclechu%2Fcpp-parser-experiment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unclechu%2Fcpp-parser-experiment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/unclechu","download_url":"https://codeload.github.com/unclechu/cpp-parser-experiment/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unclechu%2Fcpp-parser-experiment/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279008618,"owners_count":26084480,"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","status":"online","status_checked_at":"2025-10-11T02:00:06.511Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-10-11T00:31:55.307Z","updated_at":"2025-10-11T20:32:23.528Z","avatar_url":"https://github.com/unclechu.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"My own experiment of implementing Haskell-like parsers in C++.\n\n**WIP:** See [TODO.md](TODO.md) for details.\n\n## Disclaimer\n\nThis solution wasn’t intended to be super fast or to have a small footprint in\nmemory. I didn’t care to pay much attention for optimization and/or to add some\nsort of a benchmark (but you can make some merge request(s) if you’d like to\nthat would fill these gaps). I only created this as a Proof of Concept and for\nfun. Nice API that would be as close as possible to Haskell was the goal.\n\nAlso I didn’t plan to fully cover the whole set of JSON features. At least JSON\nstring parser is not complete. It does not understand escaped unicode characters\nand stuff. This can be improved later but parsing simple JSON file is enough as\nan example for this Proof of Concept.\n\n## Motivation\n\n**TODO:** Add a description of what this solution introduces.\n\n## How to build and run\n\nYou can just run `make` but providing dependencies is on you.\nI recommend to use [Nix](https://nixos.org/download.html#nix-quick-install) so\nthat all the dependencies will be provided for you automatically and with exact\nsame version I used when developing this stuff.\n\n### Using Nix\n\nBy default the program reads raw JSON from stdin and parses it printing the\nserialized JSON back to stdout.\n\n``` sh\nnix-shell --run 'cpp-parsing \u003c example.json'\n```\n\nOr build and run it separately:\n\n``` sh\nnix build\nresult/bin/cpp-parsing \u003c example.json\n```\n\n#### Development shell\n\nIf you’re going to manually (re-)build the app using `make` or/and `g++`\ndirectly you can omit building the app when entering a nix-shell by setting the\n`build-the-program` argument to `false` like this:\n\n``` sh\nnix-shell --arg build-the-program false\n```\n\nDuring the build of Nix derivation it ensures that all unit tests are passing.\nIf you for instance want to enter a nix-shell with broken state use this\nargument:\n\n``` sh\nnix-shell --arg test-the-program false\n```\n\n#### GNU/Make commands\n\nYou can also use `make` command inside a nix-shell.\nHere are some examples:\n\n``` sh\nnix-shell --arg build-the-program false --run 'make test'\nnix-shell --arg build-the-program false --run 'make run'\n```\n\nSee [Makefile](Makefile) for all available commands.\n\n#### Clang support\n\nGCC is used by default. But you can use Clang instead by setting `use-clang`\nNix argument to `true` like this:\n\n``` sh\nnix-shell --arg use-clang true --run 'cpp-parsing --pretty \u003c example.json'\n```\n\nOr:\n\n``` sh\nnix build --arg use-clang true\n```\n\n##### Overriding compiler for GNU/Make\n\nIf you want/need to use Clang with `make` directly here is an example of how you\ncan do it:\n\n``` sh\nnix-shell --arg build-the-program false --arg use-clang true --run 'make test CXX=clang++'\n```\n\n## Author\n\nViacheslav Lotsmanov\n\n## Citation\n\n[example.json](example.json) was taken as a reference for testing the\nimplementation from this Wikipedia page:\nhttps://en.wikipedia.org/wiki/JSON#Syntax\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funclechu%2Fcpp-parser-experiment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funclechu%2Fcpp-parser-experiment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funclechu%2Fcpp-parser-experiment/lists"}