{"id":13672094,"url":"https://github.com/llogiq/momo","last_synced_at":"2025-04-04T15:08:50.346Z","repository":{"id":47744980,"uuid":"187286483","full_name":"llogiq/momo","owner":"llogiq","description":"A Rust proc_macro_attribute to outline conversions from generic functions","archived":false,"fork":false,"pushed_at":"2024-05-30T13:45:03.000Z","size":547,"stargazers_count":271,"open_issues_count":11,"forks_count":7,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-03-28T14:06:26.449Z","etag":null,"topics":["hacktoberfest","monomorphization"],"latest_commit_sha":null,"homepage":"","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/llogiq.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":"2019-05-17T22:00:43.000Z","updated_at":"2025-03-14T22:17:24.000Z","dependencies_parsed_at":"2024-05-30T15:56:20.444Z","dependency_job_id":"5bddbaa6-8deb-4b7b-892c-ef23284342d8","html_url":"https://github.com/llogiq/momo","commit_stats":{"total_commits":14,"total_committers":4,"mean_commits":3.5,"dds":0.6428571428571428,"last_synced_commit":"f24815a6e7ec922d7fe71b5e821ef7cc763358bb"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/llogiq%2Fmomo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/llogiq%2Fmomo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/llogiq%2Fmomo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/llogiq%2Fmomo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/llogiq","download_url":"https://codeload.github.com/llogiq/momo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247198461,"owners_count":20900080,"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":["hacktoberfest","monomorphization"],"created_at":"2024-08-02T09:01:26.500Z","updated_at":"2025-04-04T15:08:50.318Z","avatar_url":"https://github.com/llogiq.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# momo\n**Keep your compile time during MOnoMOrphization**\n[![badge](https://docs.rs/momo/badge.svg)](https://docs.rs/momo)\n\nThis is a `proc_macro` crate to help keeping the code footprint of\ngeneric methods in check. Often, generics are used in libraries to\nimprove ergonomics.  However,  this has a cost in compile time and\nbinary size.  Optimally,  one creates a  small shell function that\ndoes the generic conversions and then calls an inner function, but\nthat makes the code less readable.\n\nAdd a `#[momo]`  annotation from this crate to split your function\ninto an outer conversion and a private inner function.  In return,\nyou get some compile time for a tiny bit of runtime (if at all) –\nwithout impairing readability.\n\nConversions currently supported are `Into` (`.into()`), `AsRef`\n(`.as_ref()`), and `AsMut` (`.as_mut()`).  See `enum Conversions`\nin code.\n\n\n## Notes on watt\n\nThis new updated version uses D. Tolnay's [watt] runtime to speed\nup the compile time, which was negatively affected with proc macro\nbaggage.\n\nThe main crate uses a pre-built wasm containing the tagged version.\nRebuilding the wasm can be done with the commands:\n\n```bash\ncd wasm\n\ncargo +nightly build \\\n    --release \\\n    --target wasm32-unknown-unknown \\\n    -Z build-std=std,panic_abort \\\n    -Z build-std-features=panic_immediate_abort\n\n# If wasm-opt is unavailable, copying the file is fine.\nwasm-opt target/wasm32-unknown-unknown/release/momo_watt.wasm -Oz \\\n--strip-debug --simplify-globals --vacuum -o ../src/momo.wasm\n```\n\nYou might need to add the  `wasm32-unknown-unknown` target to your\nRust toolchain.\n\n[watt]: https://github.com/dtolnay/watt\n\n(If you are tagging a new version, remember to commit the new `wasm` file.\nAlso change the versions in both `Cargo.toml` files.)\n\n## Debugging the macro\n\nThe [cargo-expand] tool may be used to expand the output of macro expansion,\nincluding from this proc-macro.  To examine the results of the example file,\nuse `cargo expand --example check`.\n\n[cargo-expand]: https://github.com/dtolnay/cargo-expand\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fllogiq%2Fmomo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fllogiq%2Fmomo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fllogiq%2Fmomo/lists"}