{"id":23658581,"url":"https://github.com/dok8tavo/cogito","last_synced_at":"2025-07-31T00:02:54.192Z","repository":{"id":267127029,"uuid":"899212732","full_name":"Dok8tavo/cogito","owner":"Dok8tavo","description":"Cogito is a zig module that provides comptime only types for high-level metaprogramming.","archived":false,"fork":false,"pushed_at":"2024-12-27T21:51:16.000Z","size":160,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-27T22:27:07.583Z","etag":null,"topics":["metapr","module","types","zig"],"latest_commit_sha":null,"homepage":"","language":"Zig","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/Dok8tavo.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":"2024-12-05T20:36:21.000Z","updated_at":"2024-12-27T21:51:19.000Z","dependencies_parsed_at":"2024-12-08T19:46:13.457Z","dependency_job_id":null,"html_url":"https://github.com/Dok8tavo/cogito","commit_stats":null,"previous_names":["dok8tavo/cogito"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dok8tavo%2Fcogito","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dok8tavo%2Fcogito/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dok8tavo%2Fcogito/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dok8tavo%2Fcogito/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Dok8tavo","download_url":"https://codeload.github.com/Dok8tavo/cogito/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239644122,"owners_count":19673577,"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":["metapr","module","types","zig"],"created_at":"2024-12-29T00:48:10.320Z","updated_at":"2025-02-19T10:42:25.457Z","avatar_url":"https://github.com/Dok8tavo.png","language":"Zig","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cogito\n\nCogito is a zig module that offers compile-time only types for high-level metaprogramming.\n\nSince zig's `comptime` can compute types as it goes and allocate memory at will, it should be able\nto use the same kind of abstractions as dynamically-typed languages. Cogito implement the \nfollowing types:\n\n- `List`,\n- `Dict`,\n- `String`,\n- `StringSet`,\n- `StructGen`,\n\n## Usage\n\n1. Fetch the package by running `zig fetch git+https://github.com/Dok8tavo/cogito --save=cogito`\nin the folder containing `build.zig.zon`.\n\n2. Get cogito in your `build.zig` script:\n\n```zig\npub fn build(b: *std.Build) !void {\n    ...\n    const cogito = b.dependency(\n        // this must be the name you used in the `--save=` option\n        \"cogito\", .{\n        .target = ...,\n        .optimize = ...,\n    }).module(\n        // this one must be \"cogito\", it's the name of the module from inside\n        // the package\n        \"cogito\"\n    );\n    ...\n}\n```\n\n3. Add the import for your module/executable/library/test:\n\n```zig\npub fn build(b: *std.Build) !void {\n    ...\n    const cogito = ...;\n\n    my_executable_library_or_test.root_module.addImport(\n        // this can be whatever you want, it'll affect your `@import` calls\n        \"cogito\",\n        cogito,\n    );\n\n    my_module.addImport(\n        // same\n        \"cogito\",\n        cogito,\n    );\n    ...\n}\n```\n\n4. Import the module in your source code:\n\n```zig\nconst cogito = @import(\n    // this is the name you used in the `addImport` function in your \n    // `build.zig` script.\n    \"cogito\"\n);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdok8tavo%2Fcogito","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdok8tavo%2Fcogito","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdok8tavo%2Fcogito/lists"}