{"id":28885196,"url":"https://github.com/sjsakib/ffirpc","last_synced_at":"2025-09-07T10:36:06.099Z","repository":{"id":299975001,"uuid":"1002485933","full_name":"sjsakib/ffirpc","owner":"sjsakib","description":"Compile golang gRPC service to C shared library or WebAssembly and consume form multiple languages through FFI","archived":false,"fork":false,"pushed_at":"2025-07-28T16:51:46.000Z","size":7131,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-28T18:34:54.483Z","etag":null,"topics":["dart","ffi","golang","grpc","shared-module"],"latest_commit_sha":null,"homepage":"","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sjsakib.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}},"created_at":"2025-06-15T15:22:22.000Z","updated_at":"2025-07-28T16:54:06.000Z","dependencies_parsed_at":"2025-06-19T08:35:39.747Z","dependency_job_id":"ada5d277-97fe-420c-b46e-bf1f6faef060","html_url":"https://github.com/sjsakib/ffirpc","commit_stats":null,"previous_names":["sjsakib/ffirpc"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sjsakib/ffirpc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjsakib%2Fffirpc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjsakib%2Fffirpc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjsakib%2Fffirpc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjsakib%2Fffirpc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sjsakib","download_url":"https://codeload.github.com/sjsakib/ffirpc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjsakib%2Fffirpc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274026708,"owners_count":25209739,"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","status":"online","status_checked_at":"2025-09-07T02:00:09.463Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["dart","ffi","golang","grpc","shared-module"],"created_at":"2025-06-20T22:04:54.993Z","updated_at":"2025-09-07T10:36:06.065Z","avatar_url":"https://github.com/sjsakib.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FFI RPC\n\nAn experimental Go library that enables gRPC services to be consumed from multiple programming languages using Foreign Function Interface (FFI) through WebAssembly or C shared library.\n\n## Overview\n\nFFI RPC allows developers to:\n\n- Write gRPC services in Go\n- Compile them to WebAssembly or C shared libraries\n- Call them from Node.js, Dart, and other languages that support WASM or FFI\n- Bypass network overhead for local inter-language communication\n\n## But why?\n\nThe primary purpose is to see if this could be done. Use cases where it could be useful:\n\n- You have some shared business logic that you would like write once in Go and call from multiple languages, specially if you need to support offline functionality\n\nSo why involve gRPC and not just regular FFI?\n\n- Defining, Encoding, Decoding the request and response types can be a pain\n- Hope is that protobuf will be faster than encoding/decoding the data with json despite the overhead of gRPC\n- Easy code generation for the consumers, whereas with regular FFI, wrappers or bindings have to be written/generated\n- If written as a service, can easily be exposed to the internet for environments where FFI is not available or practical\n\n## Project Structure\n\n```\n├── ffirpc.go          # Core FFI RPC server implementation\n├── ffirpc-js.go       # Core FFI RPC server implementation for JavaScript/WebAssembly\n├── clients/           # Client libraries for different languages\n│   ├── node/          # Node.js/TypeScript client\n│   └── dart/          # Dart client\n└── example/           # An example service and its consumers\n    ├── example.proto  # Protocol buffer definition\n    ├── proto-gen/     # Generated protocol buffer code\n    ├── service.go     # Service implementation\n    ├── main.go        # Entrypoint for server (C shared library)\n    ├── main-wasm.go   # Entrypoint for WebAssembly server\n    └── consumers/     # Example client implementations\n        ├── node/      # Node.js consumer\n        └── dart/      # Dart consumer\n```\n\n## Running the example\n\n### Compile the go service\n\n```bash\ncd example\nmake build\n```\n\n### Run the dart consumer\n\n```bash\ncd example/consumers/dart\ndart main.dart\n```\n\n### Run the node consumer\n\nBuild the node library\n\n```bash\ncd clients/node\nnpm install\nnpm run build\n```\n\nRun the node consumer\n\n```bash\ncd example/consumers/node\ntsx index.ts\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsjsakib%2Fffirpc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsjsakib%2Fffirpc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsjsakib%2Fffirpc/lists"}