{"id":18560917,"url":"https://github.com/artichoke/strudel","last_synced_at":"2026-03-09T19:12:20.796Z","repository":{"id":38992356,"uuid":"277938135","full_name":"artichoke/strudel","owner":"artichoke","description":"🥐 🥮 Rust port and drop-in replacement for the `st_hash` C hash table library","archived":false,"fork":false,"pushed_at":"2025-11-03T01:40:20.000Z","size":5018,"stargazers_count":6,"open_issues_count":4,"forks_count":0,"subscribers_count":2,"default_branch":"trunk","last_synced_at":"2025-11-03T03:23:32.494Z","etag":null,"topics":["artichoke","c","ffi","hashmap","ruby","rust","rust-crate"],"latest_commit_sha":null,"homepage":"https://artichoke.github.io/strudel/strudel/","language":"Rust","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/artichoke.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-07-07T22:51:03.000Z","updated_at":"2025-11-03T01:39:19.000Z","dependencies_parsed_at":"2023-02-13T05:30:53.158Z","dependency_job_id":"b10c90c0-672f-4040-a110-52026846e828","html_url":"https://github.com/artichoke/strudel","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/artichoke/strudel","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artichoke%2Fstrudel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artichoke%2Fstrudel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artichoke%2Fstrudel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artichoke%2Fstrudel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/artichoke","download_url":"https://codeload.github.com/artichoke/strudel/tar.gz/refs/heads/trunk","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artichoke%2Fstrudel/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30308853,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-09T17:35:44.120Z","status":"ssl_error","status_checked_at":"2026-03-09T17:35:43.707Z","response_time":61,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["artichoke","c","ffi","hashmap","ruby","rust","rust-crate"],"created_at":"2024-11-06T22:05:09.574Z","updated_at":"2026-03-09T19:12:20.785Z","avatar_url":"https://github.com/artichoke.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# strudel\n\n[![GitHub Actions](https://github.com/artichoke/strudel/workflows/CI/badge.svg)](https://github.com/artichoke/strudel/actions)\n[![Twitter](https://img.shields.io/twitter/follow/artichokeruby?label=Follow\u0026style=social)](https://twitter.com/artichokeruby)\n\u003cbr\u003e\n[![Crate](https://img.shields.io/crates/v/strudel.svg)](https://crates.io/crates/strudel)\n[![API](https://docs.rs/strudel/badge.svg)](https://docs.rs/strudel)\n[![API trunk](https://img.shields.io/badge/docs-trunk-blue.svg)](https://artichoke.github.io/strudel/strudel/)\n\nInsertion-ordered hash table suitable for embedding via FFI.\n\nStatus: Work in progress.\n\nStrudel was conceived as a drop-in replacement for `st_hash`, a hash map\nimplemented in C originally written by Peter Moore @ UCB and used in [Ruby]'s\n[implementation][`st.c`] of the [`Hash`][hash] core class.\n\n[ruby]: https://github.com/ruby/ruby\n[hash]: https://ruby-doc.org/core-2.6.3/Hash.html\n\nThis crate is an exercise in implementing an insertion-ordered hash map in Rust\nthat cannot use the built-in `Hasher` infrastructure. The implementation uses\n[Ruby's `Hash` backend][sthash-notes] and [Python's dict][pydict-notes] as prior\nart.\n\n[sthash-notes]: https://github.com/ruby/ruby/blob/v2_6_3/st.c#L1-L101\n[pydict-notes]:\n  https://github.com/python/cpython/blob/v3.8.4/Objects/dictobject.c#L1-L110\n\nThis crate exports two types:\n\n- `StHashMap` is a hash map built on top of the high performance [`HashMap`] and\n  [`Vec`] in Rust `std`. It is designed to implement the `st_hash` C API and be\n  FFI-friendly. This map supports in-place updates of hash keys. No mutable\n  iterators are provided.\n- `StHashSet` is a set that wraps an `StHashMap` like `HashSet` does in `std`.\n\n[`hashmap`]: https://doc.rust-lang.org/std/collections/struct.HashMap.html\n[`vec`]: https://doc.rust-lang.org/std/vec/struct.Vec.html\n[`hashse`]: https://doc.rust-lang.org/std/collections/struct.HashSet.html\n\nThe `api` and `capi` modules in `strudel` build on top of `StHashMap` to\nimplement a compatible C API to `st_hash`. This API includes support for\niterating over a mutable map and in-place updates of `(key, value)` pairs. These\nfeatures distinguish it from the [`HashMap`] in Rust `std`.\n\n## Usage\n\nAdd this to your `Cargo.toml`:\n\n```toml\n[dependencies]\nstrudel = \"1.0\"\n```\n\n## Building Ruby with Strudel\n\nStrudel exports most of the symbols implemented by `st.c` in MRI 2.6.3. The\n[included patch] and some [`configure` arguments] can build the bootstrapping\nphase of MRI 2.6.3 with Strudel as the hash backend.\n\n[included patch]: strudelify-mri.patch\n[`configure` arguments]: build.sh\n\nTo build `miniruby` with Strudel, run:\n\n```sh\n./build.sh\n```\n\n`build.sh` requires autoconf 2.69. On macOS with Homebrew, this can be done\nwith:\n\n```sh\nbrew install autoconf@2.69\nPATH=\"/usr/local/opt/autoconf@2.69/bin:$PATH\" ./build.sh\n```\n\nThe resulting Ruby is in `./build/ruby-strudel-build-root/miniruby`. `miniruby`\ncan run simple scripts involving `Hash`, for example:\n\n```console\n$ ./build/ruby-strudel-build-root/miniruby -e 'h = {}' -e '1000.times { |i| h[i] = i }' -e 'puts h.length'\n1000\n```\n\n`miniruby` successfully executes the benchmarks in [`benches`](benches).\n\nNOTE: Strudel cannot build a full Ruby due to bugs in the implementation of the\n`st_hash` API.\n\n## License\n\n`strudel` is licensed under the [MIT License](LICENSE) (c) Ryan Lopopolo.\n\nThis repository includes a vendored copy of [`st.h`] and [`st.c`] from Ruby\n2.6.3, which is licensed under the [Ruby license] or [BSD 2-clause license]. See\n[`vendor/README.md`] for more details. These sources are not distributed on\n[crates.io].\n\n[`st.h`]: vendor/ruby-2.6.3/st.h\n[`st.c`]: vendor/ruby-2.6.3/st.c\n[ruby license]: vendor/ruby-2.6.3/COPYING\n[bsd 2-clause license]: vendor/ruby-2.6.3/BSDL\n[`vendor/readme.md`]: vendor/README.md\n[crates.io]: https://crates.io/\n\nThe `st_hash` implementation in Ruby includes the following notice:\n\n```\n/* This is a public domain general purpose hash table package\n   originally written by Peter Moore @ UCB.\n\n   The hash table data strutures were redesigned and the package was\n   rewritten by Vladimir Makarov \u003cvmakarov@redhat.com\u003e.  */\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartichoke%2Fstrudel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fartichoke%2Fstrudel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartichoke%2Fstrudel/lists"}