{"id":16301808,"url":"https://github.com/curttilmes/raku-jsonsimd","last_synced_at":"2026-04-21T05:31:52.498Z","repository":{"id":152361138,"uuid":"269131251","full_name":"CurtTilmes/raku-jsonsimd","owner":"CurtTilmes","description":"Raku bindings for simdjson","archived":false,"fork":false,"pushed_at":"2020-06-03T16:05:50.000Z","size":276,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-15T22:28:54.336Z","etag":null,"topics":["json","jsonsimd","raku","rakulang"],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CurtTilmes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2020-06-03T15:53:54.000Z","updated_at":"2022-10-25T19:55:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"710e1f40-4e09-4450-a519-85c5f0de6348","html_url":"https://github.com/CurtTilmes/raku-jsonsimd","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/CurtTilmes/raku-jsonsimd","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CurtTilmes%2Fraku-jsonsimd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CurtTilmes%2Fraku-jsonsimd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CurtTilmes%2Fraku-jsonsimd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CurtTilmes%2Fraku-jsonsimd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CurtTilmes","download_url":"https://codeload.github.com/CurtTilmes/raku-jsonsimd/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CurtTilmes%2Fraku-jsonsimd/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32078760,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-21T02:38:07.213Z","status":"ssl_error","status_checked_at":"2026-04-21T02:38:06.559Z","response_time":128,"last_error":"SSL_read: 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":["json","jsonsimd","raku","rakulang"],"created_at":"2024-10-10T20:55:37.462Z","updated_at":"2026-04-21T05:31:52.455Z","avatar_url":"https://github.com/CurtTilmes.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JSON::simd - Raku bindings for simdjson\n\n## Introduction\n\nA [Raku](https://raku.org/) interface to\n[simdjson](https://simdjson.org/), a library for parsing JSON.\n\nWhile the `simdjson` library itself is blazing fast at parsing JSON,\ntransferring all the data it has parsed into Raku data structures\nisn't actually much faster than parsing with other Raku libraries such\nas [JSON::Fast](https://github.com/timo/json_fast).\n\nIn some situations, especially if you don't need all the data,\n`JSON::simd` can offer some advantages.\n\n## Subroutines\n\nDrop in replacement for `JSON::Fast`:\n\n```\nuse JSON::simd :subs;\n\n$x = from-json '{ \"a\" : \"b\" }';          # Parse a string\n$x = from-json-file 'file.json';         # Read from a file\n```\n\nAs an added bonus, this also imports `to-json` from `JSON::Fast`,\nwhich works exactly as usual.\n\n## Object oriented use\n\n`JSON::simd` also supports object usage.  This allocates the parser\nand its memory buffers only once, reusing for each document parsed.\n\n```\nuse JSON::simd;\n\nmy $json = JSON::simd.new;\n\nmy $x = $json.parse: '{ \"a\" : \"b\" }';     # Parse a string\nmy $x = $json.load: 'file.json';          # Read from a file\n```\n\nThese methods act identically to the above subs.\n\n## Delayed object access\n\nThe `:delay` option performs the entire parse (extremely fast), but\ndoesn't actually pull all the data out of the parser object into Raku.\nInstead it seamlessly replaces Objects and Arrays with placeholder\nobjects.  The placeholder objects act (almost) identically to the\ntraditional ones, and pull in data as it is accessed.  This can slow\nthings down if you walk the entire data structure, causing everything\nto be pulled in, but if you access only portions of the data, it can\nbe dramatically faster.\n\n```\nmy $x = $json.parse: '...json stuff...', :delay;\nsay $x\u003csomekey\u003e[17]\u003canother\u003e;\n```\n\nIf you always want objects delayed, you can use the `:delay` option on\nthe inital object creation:\n\n```\nmy json = JSON::simd.new(:delay);         # Set default parse to delay\n$x = $json.parse(...);                    # This one will get delayed\n$x = $json.parse(..., :!delay);           # This one will not delay\n```\n\n`simdjson` also supports [JSON Pointer](https://tools.ietf.org/html/rfc6901)\n access through both the Object and Array placeholder objects.\n\nInstead of calling `$x\u003csomekey\u003e[17]\u003canother\u003e`, the same result will be\nreturned with `$x\u003csomekey/17/another\u003e` without actually retrieving the\nintermediate objects/arrays in full.\n\n**IMPORTANT -- CAVEAT EMPTOR**\n\nOne drawback of delayed access is that the actual data remains in the\nparser, precluding its further use until all data access is complete.\nIf another JSON document is parsed by the same parser followed by\naccess to the previous placeholder objects, things are likely to\ncrash.\n\n## Multiple\n\nThe simdjson library also supports multithreaded JSON streaming\nthrough a large file containing many smaller JSON documents in either\n[ndjson](http://ndjson.org/) or [JSON lines](http://jsonlines.org/)\nformat. If your JSON documents all contain arrays or objects, they can\nbe concatenated without whitespace. The concatenated file has no size\nrestrictions (including larger than 4GB), though each individual\ndocument must be less than 4GB.\n\nThese are implemented by returning a `Channel`.  As long as JSON\nobjects are successfully parsed, they are sent through the Channel.\nIf parsing encounters an error, a `Failure` is sent through the\nchannel which will be thrown as an `Exception`.\n\n```\nfor $json.parse-many('[1,2,3][4,5,6]').list -\u003e $record {\n   ...Do something with each $record...\n}\n```\n\nThere is also a `.load-many` method, and subs for `from-json-many` and\n`from-json-file-many`.\n\nThere is no delay option for the 'many' parsing.  All objects are\ncompletely received and separate from the parser object.\n\n## Maximum depth of parsing\n\nBy default the maximum depth of JSON data structures is 1024.  This\ncan be set manually with the `:max-depth` option on intial object\ncreation, or with the `.allocate` method.\n\n```\nmy $json = JSON::simd.new(max-depth =\u003e 16);\n$json.allocate(max-depth =\u003e 32);\n```\n\n## Manual capacity allocation\n\nThe simdjson library automatically expands its memory capacity when\nlarger documents are parsed, so that you don't unexpectedly fail. In a\nshort process that reads a bunch of files and then exits, this works\npretty flawlessly.\n\nYou can query the current capacity like this:\n```\nsay $json.capacity;\n```\n\nFor better control of memory in long running processes, the simdjson\nlibrary lets you adjust your allocation strategy to prevent your\nserver from growing without bound.\n\n```\nmy $json = JSON::simd.new(max-capacity =\u003e 1_000_0000);\n```\n\nYou can also manually set the allocation (setting max-capacity to 0\nprevents it from ever auto-expanding):\n\n```\nmy $json = JSON::simd.new(max-capacity =\u003e 0, size =\u003e 1_000_000);\n$json.allocate(size =\u003e 2_000_000);  # Manually reset capacity;\n```\n\nMore information is available at [Server Loops: Long-Running Processes and Memory Capacity](https://github.com/simdjson/simdjson/blob/master/doc/performance.md#server-loops-long-running-processes-and-memory-capacity).\n\n## Implementation\n\n`simdjson` has highly tuned implementations for various processor\ncapabilities.  When first run, they test the processor and choose the\nbest implementation.  If you are curious, you can see which\nimplementation is active:\n\n```\nsay JSON::simd.implmentation-name, JSON::simd.implementation-description;\n```\n\n# Installation\n\nThis library is very dependent on 64-bit architectures and should only\nbe installed on a 64-bit OS.\n\nBuilding the C++ library requires a C++ compiler.  The commands below\nmay or may not help you install one.\n\nFor Windows and MacOS, pre-built libraries are also available as fallbacks\nif the build doesn't find a compiler.\n\nIf you have trouble installing, please file an issue with as many\ndetails about your setup as possible.\n\n* Debian/Ubuntu\n\n```\napt update\napt install -y g++\nzef install JSON::simd\n```\n\nIf you get g++ compiling errors, it may be due to an older compiler.\nYou can try this and then the commands above:\n\n```\necho deb http://ftp.us.debian.org/debian testing main contrib non-free \u003e\u003e /etc/apt/sources.list\n```\n\n* Alpine Linux\n\n```\napt add --update --no-cache g++\nzef install JSON::simd\n```\n\n* CentOS\n\n```\nyum install -y gcc-c++\nzef install JSON::simd\n```\n\n# License\n\nThe original `simdjson` code is available under Apache License 2.0.\n\nThe additional interface code and Raku bindings are Copyright © 2020\nUnited States Government as represented by the Administrator, National\nAeronautics and Space Administration. No Copyright is claimed in the\nUnited States under Title 17, U.S. Code.  All Other Rights Reserved.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcurttilmes%2Fraku-jsonsimd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcurttilmes%2Fraku-jsonsimd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcurttilmes%2Fraku-jsonsimd/lists"}