{"id":15099905,"url":"https://github.com/pblischak/zig-ndarray","last_synced_at":"2026-02-06T11:13:49.345Z","repository":{"id":240836783,"uuid":"803580192","full_name":"pblischak/zig-ndarray","owner":"pblischak","description":"N-Dimensional Arrays in Zig","archived":false,"fork":false,"pushed_at":"2025-09-20T20:31:38.000Z","size":19,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-20T22:16:00.797Z","etag":null,"topics":["data-science","ndarray","statistics","ziglang"],"latest_commit_sha":null,"homepage":"https://pblischak.github.io/zig-ndarray/","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/pblischak.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-05-21T02:07:54.000Z","updated_at":"2025-09-20T20:31:42.000Z","dependencies_parsed_at":"2024-05-22T03:43:46.728Z","dependency_job_id":null,"html_url":"https://github.com/pblischak/zig-ndarray","commit_stats":null,"previous_names":["pblischak/zig-ndarray"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pblischak/zig-ndarray","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pblischak%2Fzig-ndarray","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pblischak%2Fzig-ndarray/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pblischak%2Fzig-ndarray/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pblischak%2Fzig-ndarray/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pblischak","download_url":"https://codeload.github.com/pblischak/zig-ndarray/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pblischak%2Fzig-ndarray/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29158767,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-06T07:18:23.844Z","status":"ssl_error","status_checked_at":"2026-02-06T07:13:32.659Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["data-science","ndarray","statistics","ziglang"],"created_at":"2024-09-25T17:40:37.376Z","updated_at":"2026-02-06T11:13:49.324Z","avatar_url":"https://github.com/pblischak.png","language":"Zig","funding_links":[],"categories":[],"sub_categories":[],"readme":"# N-Dimensional Arrays in Zig\n\n\n\n## Installation\n\n```zon\n.{\n    .name = \"my_project\",\n    .version = \"0.1.0\",\n    .paths = .{\n        \"build.zig\",\n        \"build.zig.zon\",\n        \"README.md\",\n        \"LICENSE\",\n        \"src\",\n    },\n    .dependencies = .{\n        // This will link to tagged v0.1.0 release.\n        // Change the url and hash to link to a specific commit.\n        .ndarray = {\n            .url = \"\",\n            .hash = \"\",\n        }\n    },\n}\n```\n\nThen, in the `build.zig` file, add the following lines within the `build` function to include\n`ndarray` as a module:\n\n```zig\npub fn build(b: *std.Build) void {\n    // exe setup...\n\n    const ndarray_dep = b.dependency(\"ndarray\", .{\n            .target = target,\n            .optimize = optimize,\n    });\n\n    const ndarray_module = ndarray_dep.module(\"ndarray\");\n    exe.root_module.addImport(\"ndarray\", ndarray_module);\n\n    // additional build steps...\n}\n```\n\nCheck out the build files in the [examples/](https://github.com/pblischak/ndarray/tree/main/examples)\nfolder for some demos of complete sample code projects.\n\n## Getting Started\n\n```zig\nconst std = @import(\"std\");\nconst NDArray = @import(\"ndarray\").NDArray;\nconst Allocator = std.mem.allocator;\n\npub fn main() !void {\n    var gpa = std.heap.GeneralPurposeAllocator(.{}){};\n    const allocator = gpa.allocator();\n    defer {\n        const status = gpa.deinit();\n        std.testing.expect(status == .ok) catch {\n            @panic(\"Memory leak!\");\n        };\n    }\n\n    const arr = try NDArray(f32, 3).init(.{10, 10, 2}, allocator);\n    defer arr.deinit();\n}\n```\n\n### Acknowledgements\n\nThe `ndarray` module modifies the code from [this gist](https://gist.github.com/AssortedFantasy/f57ebe9c2b5c71081db345a7372d6a38)\nby AssortedFantasy by adding within-struct allocation and by making things more compatible with the\nZig package management system. Many thanks to AssortedFantasy for the initial implementation of a\nmultidimensional array structure in Zig.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpblischak%2Fzig-ndarray","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpblischak%2Fzig-ndarray","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpblischak%2Fzig-ndarray/lists"}