{"id":17437201,"url":"https://github.com/simsys/arrform","last_synced_at":"2025-08-20T23:32:32.270Z","repository":{"id":57494257,"uuid":"435548526","full_name":"Simsys/arrform","owner":"Simsys","description":"String formatting in Rust without memory allocator","archived":false,"fork":false,"pushed_at":"2024-12-02T07:28:15.000Z","size":83,"stargazers_count":15,"open_issues_count":0,"forks_count":9,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-12-09T06:36:10.485Z","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/Simsys.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":"2021-12-06T15:28:19.000Z","updated_at":"2024-12-02T07:28:19.000Z","dependencies_parsed_at":"2024-10-21T12:50:30.658Z","dependency_job_id":null,"html_url":"https://github.com/Simsys/arrform","commit_stats":{"total_commits":10,"total_committers":1,"mean_commits":10.0,"dds":0.0,"last_synced_commit":"fdbb0cfe18eadbff99cc8cd63f1b5a43df70e665"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Simsys%2Farrform","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Simsys%2Farrform/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Simsys%2Farrform/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Simsys%2Farrform/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Simsys","download_url":"https://codeload.github.com/Simsys/arrform/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230471175,"owners_count":18231193,"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":[],"created_at":"2024-10-17T11:06:59.045Z","updated_at":"2024-12-19T17:08:22.877Z","avatar_url":"https://github.com/Simsys.png","language":"Rust","readme":"String formatting without memory allocator\n==========================================\n \nIn bare matal systems, there is often the task of converting numbers into text and formatting \nthem. The standard Rust functions like format!, write! etc. cannot be used in no_std \nenvironments because they require a memory allocator. The arrform! macro uses the standard \nlibrary functions, but writes to a fixed length array which is alocated on the stack.\n\nThis crate is usable in no_std environments. This is a replacement for the format! macro, based \non a fixed-size array allocated on the stack.\n\n# arrform!\n\n``` rust\nuse arrform::{arrform, ArrForm};\n\nlet af = arrform!(64, \"write some stuff {}: {:.2}\", \"foo\", 42.3456);\nassert_eq!(\"write some stuff foo: 42.35\", af.as_str());\n```\n\n## ArrForm struct as an alternative\n\nThe ArrForm struct provides more detailed error handling and supports multiple use of the \nsame buffer. However, it is much more cumbersome to use and generates more syntactic noise. \n\n# Overhead\n\nThe convenient option to format can cost a lot of storage space. On a Cortex M4 992 bytes of \nprogram code are needed additionally, if instead of a simple string a simple u32 number is \nembedded with the help of the macro. It becomes even more expensive if f32 numbers are output \nformatted (30,928 bytes additional). The program code used to determine these numbers can be \nfound in the example directory.\n\nLooking for an alternative that wastes less memory? The Crate [tfmt](https://github.com/Simsys/tfmt) \ncan be used as an alternative in most cases. This crate has the additional advantages that it \nis guaranteed not to contain any panic branches and also works much more efficiently.\n\n# License\n\nApache version 2.0 or Mit\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimsys%2Farrform","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimsys%2Farrform","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimsys%2Farrform/lists"}