{"id":18315343,"url":"https://github.com/lefticus/cons_expr","last_synced_at":"2025-05-02T12:31:09.740Z","repository":{"id":159109440,"uuid":"634367755","full_name":"lefticus/cons_expr","owner":"lefticus","description":null,"archived":false,"fork":false,"pushed_at":"2025-04-22T16:07:04.000Z","size":272,"stargazers_count":63,"open_issues_count":1,"forks_count":1,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-22T17:28:28.140Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lefticus.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,"zenodo":null}},"created_at":"2023-04-29T22:14:47.000Z","updated_at":"2025-04-15T02:02:16.000Z","dependencies_parsed_at":"2023-09-01T10:49:06.329Z","dependency_job_id":"a7d6379a-3dd7-411b-9e13-b36b8e5bb361","html_url":"https://github.com/lefticus/cons_expr","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":"cpp-best-practices/cmake_template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lefticus%2Fcons_expr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lefticus%2Fcons_expr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lefticus%2Fcons_expr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lefticus%2Fcons_expr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lefticus","download_url":"https://codeload.github.com/lefticus/cons_expr/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252038114,"owners_count":21684626,"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":[],"created_at":"2024-11-05T16:39:23.443Z","updated_at":"2025-05-02T12:31:09.374Z","avatar_url":"https://github.com/lefticus.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cons_expr\n\n[![ci](https://github.com/lefticus/cons_expr/actions/workflows/ci.yml/badge.svg)](https://github.com/lefticus/cons_expr/actions/workflows/ci.yml)\n[![codecov](https://codecov.io/gh/lefticus/cons_expr/branch/main/graph/badge.svg)](https://codecov.io/gh/lefticus/cons_expr)\n[![CodeQL](https://github.com/lefticus/cons_expr/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/lefticus/cons_expr/actions/workflows/codeql-analysis.yml)\n\n\n## About cons_expr\n\n**cons_expr** is:\n\n* Scheme-inspired\n   * scheme syntax and features\n   * does *not* support pairs or macros\n   * any value once captured is const\n   * any redefinition of a value shadows the previous value\n* Constexpr-capable\n   * `cons_expr::cons_expr` is `constinit` meaning that it is *always* 0-cost to construct a cons_expr interpreter\n   * Any script can be executed at compile time.\n   * Why execute script at compile time?\n     * I don't know your other use cases\n     * But you can use this feature to set up your entire scripting environment at compile time, then execute scripts at runtime\n* Simple and small\n   * I'm attempting to keep the code as compact as possible. As of now it is \"feature complete.\" Any additional features will go as add-ons in the \"utility\" header\n   * I'm not happy with the `fix_identifiers` family of functions. They need to be simplified and made better.\n   * Compilation of entire engine is just a few seconds, even with optimizations.\n* Easy to use\n   * Include one header and go! See [examples](examples).\n* Embeddable scripting language \n   * Bi-directional support for functions between script and C++.\n   * All supported types must be known at [compile time](https://github.com/lefticus/cons_expr/blob/main/test/tests.cpp#L57C1-L91).\n* For C++23\n   * Currently only known to work with GCC 13.1.\n\n\n## Command Line Inspection Tool\n\n`ccons_expr` can be used to execute scripts and inspect the state of the runtime system live\n\n[![asciicast](https://asciinema.org/a/ZJWpwSjkFqt7Fl750HpeiT3Eg.svg)](https://asciinema.org/a/ZJWpwSjkFqt7Fl750HpeiT3Eg)\n\n\n## Important Notes\n\n* Objects are never destroyed, but because they are treated as immutable, they are reused as much as possible.\n* All types contained in the script are required to be `trivial`\n* If you expand beyond the statically allocated storage, dynamic storage is utilized. If you maintain dynamic storage from compile-time to run-time, you will get a compile time error.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flefticus%2Fcons_expr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flefticus%2Fcons_expr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flefticus%2Fcons_expr/lists"}