{"id":16113251,"url":"https://github.com/teh-cmc/zig-ron","last_synced_at":"2025-06-25T13:04:02.800Z","repository":{"id":80234659,"uuid":"422286087","full_name":"teh-cmc/zig-ron","owner":"teh-cmc","description":"[WIP] A robust, efficient implementation of the Rusty Object Notation (RON) for the Zig programming language.","archived":false,"fork":false,"pushed_at":"2021-10-28T16:56:14.000Z","size":26,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-25T13:03:31.061Z","etag":null,"topics":["parser","ron","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/teh-cmc.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":"2021-10-28T16:54:55.000Z","updated_at":"2023-10-27T21:07:08.000Z","dependencies_parsed_at":null,"dependency_job_id":"4c38ae26-64f1-47a9-9354-0d279908775e","html_url":"https://github.com/teh-cmc/zig-ron","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/teh-cmc/zig-ron","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teh-cmc%2Fzig-ron","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teh-cmc%2Fzig-ron/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teh-cmc%2Fzig-ron/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teh-cmc%2Fzig-ron/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/teh-cmc","download_url":"https://codeload.github.com/teh-cmc/zig-ron/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teh-cmc%2Fzig-ron/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261879271,"owners_count":23223736,"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":["parser","ron","zig"],"created_at":"2024-10-09T20:10:42.060Z","updated_at":"2025-06-25T13:04:02.778Z","avatar_url":"https://github.com/teh-cmc.png","language":"Zig","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Zig-RON\n\n_**wip**_\n\nHopefully: a robust, efficient implementation of the [Rusty Object Notation](https://github.com/ron-rs/ron) for the Zig programming language.\n\nThis is a work in progress: you can and should expect missing docs, miscellaneous bugs, a general lack of polish, etc.\n\nThe deserializer should already be in a pretty usable state though, hence this early release.\nThere simply isn't a serializer yet, that's the easy part though :)\n\nFeel free to reach out either via the issue tracker or on Zig discord (`clem#0498`).\n\n## Usage\n\n\u003c!-- TODO: automate this --\u003e\n\n```zig\nconst std = @import(\"std\");\nconst ron = @import(\"ron\");\n\nconst MyStruct = struct {\n    bool: bool,\n    float: f32,\n    int: i42,\n    string: []const u8,\n    char: ron.Char,\n    unit: ron.Unit,\n\n    array_list: std.ArrayList(u32),\n    slice: []u32,\n\n    string_map: std.StringArrayHashMap([]const u8),\n    map: std.AutoArrayHashMap(bool, []const u8),\n\n    option: ?[]const u8,\n    enums: enum { a, b, c },\n    unions: union(enum) { a: bool, b: []const u8, c: f32 },\n    any: ron.Value, // Generic heterogeneous values\n\n    nested: ?*@This(),\n\n    default: []const u8 = \"some default value\",\n};\n\nconst data =\n    \\\\MyStruct(\n    \\\\  bool: true,\n    \\\\  float: 42.420,\n    \\\\  int: 666,\n    \\\\  string: \"ガタカへようこそ\",\n    \\\\  char: '🚁',\n    \\\\  unit: (),\n    \\\\\n    \\\\  array_list: [1, 2, 3, 4],\n    \\\\  slice: [5, 6, 7, 8],\n    \\\\\n    \\\\  string_map: { \"hello\": \"world\" },\n    \\\\  map: { false: \"is false\", true: \"is not false\" },\n    \\\\\n    \\\\  option: Some(\"\\u{263A}\"),\n    \\\\  enums: b,\n    \\\\  unions: c(666.111),\n    \\\\  any: seq([string(\"hey\"), bool(true), float(42.42)]),\n    \\\\\n    // Tuple to struct coercion!\n    \\\\  nested: Some((\n    \\\\    false, 1.0, 2, \"xxx\", 'X', (),\n    \\\\    [], [], {}, {},\n    \\\\    None, a, b(\"nope!\"), option(None),\n    \\\\    None,\n    \\\\  )),\n    \\\\\n    // This will be silently ignored.\n    \\\\  field_that_doesnt_exist: DoesntExist(\n    \\\\    xxx: 42,\n    \\\\    42: \"xxx\"\n    \\\\  ),\n    \\\\)\n;\n\npub fn main() !void {\n    var allocator = std.heap.page_allocator;\n\n    var deser = ron.Deserializer.init(allocator);\n    // clears internal parser resources\n    defer deser.deinit();\n    // clears data allocated for the end-user (arrays, maps, escaped strings...)\n    defer deser.parseFree();\n\n    var tokens = \u0026ron.Lexer.init(data).token_stream;\n    const res = deser.parse(MyStruct, tokens) catch |err| {\n        try deser.report(std.io.getStdErr().writer());\n        return err;\n    };\n\n    _ = ron.debug_ext.dbg(res);\n}\n```\n\n## License\n\n[MIT](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteh-cmc%2Fzig-ron","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fteh-cmc%2Fzig-ron","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteh-cmc%2Fzig-ron/lists"}