{"id":39960663,"url":"https://github.com/mikomikotaishi/stdlibx","last_synced_at":"2026-01-18T21:07:03.506Z","repository":{"id":313588104,"uuid":"1051939305","full_name":"mikomikotaishi/stdlibx","owner":"mikomikotaishi","description":"Experimental repackaging of the C++ standard library as modules","archived":false,"fork":false,"pushed_at":"2025-12-26T02:28:54.000Z","size":2199,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-26T22:55:58.193Z","etag":null,"topics":["cpp23","libcxx","libstdcxx","rust-std-lib","standard-library","stdlib"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mikomikotaishi.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-07T03:39:58.000Z","updated_at":"2025-12-26T02:28:59.000Z","dependencies_parsed_at":"2025-09-07T06:06:46.195Z","dependency_job_id":"0a38230b-3015-4298-a18c-9b74784a15b4","html_url":"https://github.com/mikomikotaishi/stdlibx","commit_stats":null,"previous_names":["mikomikotaishi/stdlib","mikomikotaishi/stdlibx"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mikomikotaishi/stdlibx","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikomikotaishi%2Fstdlibx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikomikotaishi%2Fstdlibx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikomikotaishi%2Fstdlibx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikomikotaishi%2Fstdlibx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mikomikotaishi","download_url":"https://codeload.github.com/mikomikotaishi/stdlibx/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikomikotaishi%2Fstdlibx/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28550571,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T20:59:07.572Z","status":"ssl_error","status_checked_at":"2026-01-18T20:59:02.799Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["cpp23","libcxx","libstdcxx","rust-std-lib","standard-library","stdlib"],"created_at":"2026-01-18T21:07:00.955Z","updated_at":"2026-01-18T21:07:03.499Z","avatar_url":"https://github.com/mikomikotaishi.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `stdlibx`\n\n\u003e **WARNING:** As this library is still under development, many features do not yet work, or requires inelegant workarounds or even inclusion of headers to resolve. These issues will only be resolved as development continues.\n\n\u003e **WARNING:** This library has only been tested for Clang, and may not work with GCC or MSVC. \n\u003e Recent tests with GCC caused compiler crashes, likely due to poor module support. As such we only recommend using Clang.\n\n## Overview\nThis is a project that re-exports the entire C++ standard library as modules. The motivation for creating this was that at the time, support for `import std;` was very poor, a personal dislike of ISO C++'s usage of snake_case for class names, and a dislike of the flat `std::` namespace.\n\nThe main features of this repackaging of the standard library are:\n- Symbols follow Rust naming conventions (object type names in PascalCase, constants in UPPER_SNAKE_CASE, variables and methods in snake_case)\n    - While I personally would have preferred methods to be in camelCase (like in Java), this would have been too much work to rename existing functions and methods, for very little gain\n- Splitting the standard library into sub-namespaces (in constrast to the ISO C++ `std::` namespace which is largely flat). \n    - The divisions try to follow the Rust standard library modules, but also take inspiration from the Java standard library.\n- Option to toggle between using `std::*` or `stdlib::*` names for symbols/modules (disabled by default as `std` is a reserved name by ISO C++ and library implementations)\n- Option to use only `core` and `alloc` modules instead of the full standard library, similar to Rust\n- Standard library extensions - features that (in my opinion) ought to be part of the C++ standard library, but are not. Currently largely unimplemented.\n\nRequires a minimum of C++23. \n\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\n## Libraries\nThe `stdlibx` library offers the following namespaces/modules:\n\n### Core library (module `core`, namespace `core::*`)\nCore modules of the standard library, not requiring any memory allocation. Provides the most fundamental and low-level features of the C++ standard library. \n\n### Allocation library (module `alloc`, namespace `alloc::*`)\nAllocation modules of the standard library, providing heap allocation and non-trivial data structures.\n\nDisabled when `STDLIB_NO_ALLOC` is enabled.\n\n### Standard library (module `std`, namespace `std::*`)\nThe full C++ standard library, containing everything provided by `core` and `alloc`, as well as additional functionality depending on operating system and runtime.\n\nIf `STDLIBX_USE_RESERVED_STD_IDENTIFIERS` is disabled, `std` is `stdlib` and `std::*` is `stdlib::*`. `STDLIBX_USE_RESERVED_STD_IDENTIFIERS` can further be more finely-controlled using `STDLIBX_NO_RESERVED_STD_MODULE` (modules) and `STDLIBX_NO_RESERVED_STD_NAMESPACE` (namespaces).\n\nDisabled when `STDLIBX_NO_STD` (or `STDLIBX_NO_ALLOC`) are enabled.\n\n### Extensions library (module `stdx`, namespace `stdx::*`)\nTechnically not \"standard library\" in the sense of the ISO C++ standard library, but contains features that (in my opinion) ought to be part of the C++ standard library, and are offered by standard libraries of other languages.\n\nIf `STDLIBX_USE_RESERVED_STD_IDENTIFIERS` is disabled, `stdx` is `stdlibx` and `stdx::*` is `stdlibx::*`. `STDLIBX_USE_RESERVED_STD_IDENTIFIERS` can further be more finely-controlled using `STDLIBX_NO_RESERVED_STD_MODULE` (modules) and `STDLIBX_NO_RESERVED_STD_NAMESPACE` (namespaces).\n\nDisabled by default - enabled when `STDLIBX_EXTENSIONS` is enabled. \n\n\u003e **NOTE:** Some parts of this library may be third-party or re-exports of existing libraries, and thus not entirely original code. Code that originates from third party will be adequately attributed, but if there are any issues or concerns, please do not hesitate to contact me.\n\nSome third-party libraries used here include:\n- TinyXML-2\n- [p-ranav/glob](https://github.com/p-ranav/glob)\n\n## Example\n```cpp\nimport std;\nimport stdx;\n\nusing std::collections::Vector;\nusing std::fs::Begin;\nusing std::fs::DirectoryEntry;\nusing std::fs::DirectoryIterator;\nusing std::fs::End;\nusing std::fs::Path;\nusing stdx::linq::Query;\n\nint main(int argc, char* argv[]) {\n    Path dir = std::fs::current_path();\n\n    Vector\u003cDirectoryEntry\u003e files{\n        Begin(DirectoryIterator(dir)),\n        End(DirectoryIterator(dir)),\n        [](const DirectoryEntry\u0026 entry) -\u003e bool { return std::fs::is_regular_file(entry); }\n    };\n\n    // Use LINQ-style query to find the largest .txt file\n    DirectoryEntry result = Query\u003cVector\u003cDirectoryEntry\u003e\u003e::from(files)\n        .where([](const DirectoryEntry\u0026 entry) -\u003e bool { return entry.path().extension() == \".txt\"; })\n        .order_by([](const DirectoryEntry\u0026 entry) -\u003e i64 { return -std::fs::file_size(entry); })\n        .select([](const DirectoryEntry\u0026 entry) -\u003e Tuple\u003cPath, u64\u003e { return Tuple{entry.path(), std::fs::file_size(entry)}; })\n        .first_or_default();\n\n    if (result) {\n        const auto\u0026 [path, size] = *result;\n        std::io::println(\"Largest .txt file: {} ({} bytes)\", path.string(), size);\n    } else {\n        std::io::println(\"No .txt files found in directory: {}\", dir.string());\n    }\n}\n```\n\n## Build\nThis supports building using CMake and XMake.\n\nMake (calls CMake):\n```sh\nmake\n```\n\nCMake:\n```sh\ncmake -S . -B build -G Ninja\ncmake --build build\n```\n\nXMake:\n```sh\nxmake\n```\n\n## Known issues\nMost of these issues are believed to be possible to resolve using header units, however at the current time header units are not supported by CMake.\n\n- The library is known to fail when trying to use foreach loops with containers such as `Vector`. It is not known why this happens. It can only be solved by including `\u003cvector\u003e`.\n```cpp\n#include \u003cvector\u003e // necessary (for some reason?)\n\nimport std;\n\nusing std::collections::Vector;\n\n// ...\nVector\u003ci32\u003e v{1, 2, 3, 4, 5};\nfor (int i: v) {\n    std::io::println(\"{}\", i);\n}\n```\n- A problem with `std::core::String` requiring inclusion of `\u003cstring\u003e`\n- A problem with `std::fs::DirectoryIterator` requiring inclusion of `\u003cfilesystem\u003e`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikomikotaishi%2Fstdlibx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmikomikotaishi%2Fstdlibx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikomikotaishi%2Fstdlibx/lists"}