{"id":23696024,"url":"https://github.com/xnmeet/rico","last_synced_at":"2026-02-09T12:31:07.088Z","repository":{"id":269808844,"uuid":"908500174","full_name":"xnmeet/rico","owner":"xnmeet","description":"A high-performance Apache Thrift IDL parser written in Rust that converts Thrift IDL files to JSON AST.","archived":false,"fork":false,"pushed_at":"2025-01-06T12:35:25.000Z","size":1852,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-19T13:01:34.242Z","etag":null,"topics":["idl","rust","thrift","thrift-parser"],"latest_commit_sha":null,"homepage":"https://rico-playground.vercel.app","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/xnmeet.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":"2024-12-26T08:16:05.000Z","updated_at":"2025-01-19T03:49:35.000Z","dependencies_parsed_at":"2024-12-26T10:36:53.442Z","dependency_job_id":null,"html_url":"https://github.com/xnmeet/rico","commit_stats":null,"previous_names":["xnmeet/rico"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/xnmeet/rico","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xnmeet%2Frico","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xnmeet%2Frico/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xnmeet%2Frico/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xnmeet%2Frico/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xnmeet","download_url":"https://codeload.github.com/xnmeet/rico/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xnmeet%2Frico/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29265163,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-09T04:11:57.159Z","status":"ssl_error","status_checked_at":"2026-02-09T04:11:56.117Z","response_time":56,"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":["idl","rust","thrift","thrift-parser"],"created_at":"2024-12-30T05:58:48.054Z","updated_at":"2026-02-09T12:31:07.022Z","avatar_url":"https://github.com/xnmeet.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n    \u003cimg src=\"./apps/web/public/logo.svg\" width=\"80px\" height=\"80px\"\u003e\u003c/img\u003e\n    \u003ch1\u003eRico\u003c/h1\u003e\n\u003c/div\u003e\n\u003cdiv align=\"center\"\u003e\nA high-performance Apache Thrift IDL parser written in Rust that converts Thrift IDL files to JSON AST.\n\u003c/div\u003e\n\u003cbr/\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n[![Crates.io](https://img.shields.io/crates/v/rico.svg)](https://crates.io/crates/rico)\n[![Documentation](https://docs.rs/rico/badge.svg)](https://docs.rs/rico)\n[![License](https://img.shields.io/github/license/xnmeet/rico)](LICENSE)\n[![Build Status](https://github.com/xnmeet/rico/workflows/Build%20and%20Test/badge.svg)](https://github.com/xnmeet/rico/actions)\n[![Crates.io Downloads](https://img.shields.io/crates/d/rico)](https://crates.io/crates/rico)\n\n\u003c/div\u003e\n\n\n## Features\n\n- 🚀 Fast and efficient parsing\n- 🎯 Complete Thrift IDL support\n- 🔄 JSON AST output\n- 📝 Comment preservation\n- 🎨 Detailed source location tracking\n- ⚡ Parallel processing support\n- 📊 Built-in benchmarking\n\n## Performance vs thrift-parser\n\nThe program takes `0.03` seconds, which is nearly a 10x performance improvement compared to the JavaScript implementation.\n\n\u003e The test file contains approximately 15,000 lines of code.\n\n![performance](./performance.png)\n\n## Installation\n\n```bash\n[dependencies]\nrico = \"*\"\n```\n\n## Usage\n\n### Basic Parsing\n\n```rust\nuse rico::Parser;\n\nfn main() {\n    let input = r#\"\n        namespace rs demo\n\n        struct User {\n            1: string name\n            2: i32 age\n        }\n    \"#;\n\n    let mut parser = Parser::new(input);\n    match parser.parse() {\n        Ok(ast) =\u003e println!(\"{}\", serde_json::to_string_pretty(\u0026ast).unwrap()),\n        Err(e) =\u003e eprintln!(\"Error: {}\", e),\n    }\n}\n```\n\n### Command Line Tools\n\n#### Scan Multiple Files\n\nYou can also use the `rico-scan` command to scan multiple files and output the JSON AST to a folder.\n\n```bash\ncargo install rico-scan\n```\n\nNow you can use the `rico-scan` CLI tool for processing multiple Thrift files:\n\n```bash\nrico-scan --path ./thrift/files --output ./output\n```\n\n#### Benchmark Parser Performance\n\nRun benchmarks on Thrift files:\n\n```bash\ncargo run -p benchmark\n```\n\n## Project Structure\n\n- `creates/rico/`: Core parser library\n- `apps/scan/`: CLI tool for batch processing\n- `apps/benchmark/`: Performance benchmarking tool\n\n## Supported Thrift Features\n\n- Base types (i32, i64, string, etc.)\n- Collections (list, set, map)\n- Structs and Exceptions\n- Services and Functions\n- Enums\n- Constants\n- Typedefs\n- Namespaces\n- Includes\n- Comments and Annotations\n\n## Development\n\n### Setup\n\n```bash\n# Install insta\ncurl -LsSf https://insta.rs/install.sh | sh\n\n# Install pnpm\nnpm install -g pnpm bun\n\n# Install dependencies\npnpm install\n```\n\n### Building\n\n*build crates*\n\n```bash\ncargo build --workspace\n```\n\n*build docs*\n\n```bash\ncargo doc --workspace\n```\n\n*build wasm*\n\n```bash\ncd wasm/rico \u0026\u0026 npm run build\n\n// debug use bun\nbun examples/basic.ts\n```\n\n### Updating Snapshots\n\nYou can for instance first run the tests and not write and new snapshots, and if you like them run the tests again and update them:\n\n```bash\nINSTA_UPDATE=no cargo test\nINSTA_UPDATE=always cargo test\n```\n\nFor more information see [insta](https://insta.rs/docs/quickstart/)\n\n### Code Structure\n\n- Lexer: Tokenizes input using Logos\n- Parser: Recursive descent parser\n- AST: Strongly typed syntax tree\n- Location Tracking: Preserves source positions\n\n## Contributing\n\n1. Fork the repository\n2. Create your feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'Add some amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\n## License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n\n## Acknowledgments\n\n- [Logos](https://github.com/maciejhirsz/logos) for lexer generation\n- [Serde](https://github.com/serde-rs/serde) for JSON serialization\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxnmeet%2Frico","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxnmeet%2Frico","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxnmeet%2Frico/lists"}