{"id":15888224,"url":"https://github.com/kampfkarren/unicode-ident-luau","last_synced_at":"2026-02-04T21:35:23.569Z","repository":{"id":239303516,"uuid":"799159848","full_name":"Kampfkarren/unicode-ident-luau","owner":"Kampfkarren","description":"A port of dtolnay's unicode-ident crate to Luau. Check if a codepoint is XID_Start/XID_Continue","archived":false,"fork":false,"pushed_at":"2024-05-11T10:35:34.000Z","size":51,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-19T23:58:24.385Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","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/Kampfkarren.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","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-11T10:34:48.000Z","updated_at":"2024-05-17T07:26:34.000Z","dependencies_parsed_at":"2024-05-11T11:45:09.396Z","dependency_job_id":null,"html_url":"https://github.com/Kampfkarren/unicode-ident-luau","commit_stats":null,"previous_names":["kampfkarren/unicode-ident-luau"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Kampfkarren/unicode-ident-luau","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kampfkarren%2Funicode-ident-luau","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kampfkarren%2Funicode-ident-luau/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kampfkarren%2Funicode-ident-luau/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kampfkarren%2Funicode-ident-luau/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Kampfkarren","download_url":"https://codeload.github.com/Kampfkarren/unicode-ident-luau/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kampfkarren%2Funicode-ident-luau/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29096410,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-04T21:05:08.033Z","status":"ssl_error","status_checked_at":"2026-02-04T21:04:53.031Z","response_time":62,"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":[],"created_at":"2024-10-06T06:06:48.434Z","updated_at":"2026-02-04T21:35:23.551Z","avatar_url":"https://github.com/Kampfkarren.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# unicode-ident-luau\n\nImplementation of [Unicode Standard Annex #31](https://www.unicode.org/reports/tr31/) for detecting \"general-purpose identifiers, immutable identifiers, hashtag identifiers, and in pattern-based syntax\". Tested on Unicode 15.0.0.\n\nPort of [https://github.com/dtolnay/unicode-ident](dtolnay/unicode-ident).\n\n## Usage\n\nunicode-ident-luau exposes the following functions that take codepoints (such as those from [utf8.codes](https://luau-lang.org/library#utf8-library)).\n\n```\nunicodeIdent.isXidStart(codepoint: number): boolean\nunicodeIdent.isXidContinue(codepoint: number): boolean\n```\n\n### Installation\n\nunicode-ident-luau is on wally.\n\n```toml\nunicodeIdent = \"kampfkarren/unicode-ident@1.0.0\"\n```\n\n## Performance\n\n### TL;DR\n\n- 18.8 nanoseconds per call for ASCII\n- 37.6 nanoseconds per call for non-ASCII\n- 12.7 KB of memory.\n- My CPU is extremely good. YMMV.\n\n### Details\n\nunicode-ident-luau is extremely fast.\n\nThe following benchmarks consistently give the following benchmarks:\n\n```lua\n{\n\t[\"ASCII (totalling nearly FFFF times)\"] = function(Profiler)\n\t\tfor _ = 1, 0xFFFF / 128 do\n\t\t\tfor c = 0, 127 do\n\t\t\t\tlocal _ = unicodeIdent.isXidStart(c)\n\t\t\t\tlocal _ = unicodeIdent.isXidContinue(c)\n\t\t\tend\n\t\tend\n\tend,\n\n\t[\"0 to 0xFFFF\"] = function()\n\t\tfor c = 1, 0xffff do\n\t\t\tlocal _ = unicodeIdent.isXidStart(c)\n\t\t\tlocal _ = unicodeIdent.isXidContinue(c)\n\t\tend\n\tend,\n}\n```\n\n#![Benchmarking data. 0 to 0xFFFF is 7.950ms P50, and ASCII (totalling nearly FFFF times) is 2.459ms P50](docs/bench1.png)\n\nDividing these by the number of iterations, we get the following metrics for both isXidStart and isXidContinue. Because they are implemented nearly identically, we will divide by 50% for the price of either.\n\n**ASCII**: 2.459ms / 65,408 runs == 37.6 nanoseconds for both / **18.8 nanoseconds** for either.\n\n**Non-ASCII**: 7.950ms / 65,535 runs == 121.3 nanoseconds for both / **60.65 nanoseconds** for either.\n\nNote that these benchmarks (and similar ones performed outside of Benchmarker) don't seem to improve with `--!native`.\n\nThe necessary tables are stored in an extremely compressed manner. The Luau heap manager reports the tables as being 10.4 KB, but in a game the cost of the script bytecode is an additional 2,359 bytes, so about 12.7 KB.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkampfkarren%2Funicode-ident-luau","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkampfkarren%2Funicode-ident-luau","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkampfkarren%2Funicode-ident-luau/lists"}