{"id":38800808,"url":"https://github.com/refaktor/ryegen","last_synced_at":"2026-01-17T12:46:42.564Z","repository":{"id":249837221,"uuid":"832664532","full_name":"refaktor/ryegen","owner":"refaktor","description":"Rye language binding generation utility","archived":false,"fork":false,"pushed_at":"2025-10-24T10:38:15.000Z","size":588,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-27T04:55:13.586Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/refaktor.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":"2024-07-23T13:28:00.000Z","updated_at":"2025-10-24T10:23:50.000Z","dependencies_parsed_at":"2024-07-23T17:27:57.011Z","dependency_job_id":"b1b0d69e-6202-4385-8f8d-46eda0a9ddf3","html_url":"https://github.com/refaktor/ryegen","commit_stats":null,"previous_names":["refaktor/ryegen"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/refaktor/ryegen","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/refaktor%2Fryegen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/refaktor%2Fryegen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/refaktor%2Fryegen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/refaktor%2Fryegen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/refaktor","download_url":"https://codeload.github.com/refaktor/ryegen/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/refaktor%2Fryegen/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28508577,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T11:50:55.898Z","status":"ssl_error","status_checked_at":"2026-01-17T11:50:55.569Z","response_time":85,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":[],"created_at":"2026-01-17T12:46:42.469Z","updated_at":"2026-01-17T12:46:42.545Z","avatar_url":"https://github.com/refaktor.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ryegen\nCreate a Rye interpreter with automatic bindings for a Go library.\n\n## Create a binding (requires go1.24+)\n### 1. Initialize a new module\n- Create a new directory as you would for any new Go module.\n- Open a command line inside the directory you just created.\n- Initialize the Go module, e.g.: `go mod init my-module`\n\n### 2. Install Ryegen as a tool\n```\ngo get -tool github.com/refaktor/ryegen/v2@main\n```\n\n### 3. In that directory, create a `ryegen.toml`, e.g.\n`ryegen.toml`:\n```toml\n# Use [[target]] to set options\n# for a specific platform.\n# the 'select' field accepts\n# Go build constraints (see\n# https://pkg.go.dev/cmd/go#hdr-Build_constraints).\n# If you don't set select, all\n# targets are selected.\n# Set options in the last matching\n# [[target]] block take precedence.\n[[target]]\n#select = 'windows \u0026\u0026 amd64' # uncomment to only apply the following options on windows amd64\ncgo-enabled = false # set to true if the package needs cgo\n\n# [[source]] specifies which\n# Go code to generate bindings\n# for. The 'packages' field specifies\n# the base Go packages. Bindings\n# will be generated for those\n# packages, as well as any packages\n# needed by their APIs.\n[[source]]\n# e.g. Go std net/http package, but this\n# can also be online packages\npackages = ['net/http']\n```\n\n### 4. Run Ryegen\n```\ngo tool ryegen\n```\n\n- Tip: You can also use this with the [go:generate directive](https://go.dev/blog/generate).\n\n- Tip: You can also cross-compile bindings easily, as long as they don't use CGo: `go tool ryegen -goos windows -goarch amd64`. See `go tool ryegen -h` for all options.\n\n### 5. Run your Rye interpreter with bindings\n`example.rye`:\n```\nhttp: import\\go \"net/http\"\n\nhttp/HandleFunc \"/\" fn { w r } {\n    w .Write \"Hello, world!\"\n}\n\nport: \":8080\"\nprint \"listening on port \" ++ port\nhttp/ListenAndServe port nil\n```\n\n```\ngo run . ./example.rye\n```\n\n## Run an example\n```\ncd examples/fyne\ngo generate .\ngo run . ./example.rye\n```\n\n## Import dependency handling\nBesides the selected packages, Ryegen will also generate bindings for any packages required by their public APIs.\n\nConsider this example:\n\n```go\nfunc x() strings.Builder\nfunc Y() bytes.Buffer\n```\n\n- Since `x` isn't exported, we don't generate bindings for it or the `strings` package.\n- `Y`, however, is exported, so we *do* generate bindings for both `Y` and the `bytes` package. `bytes`, in turn, uses the `io` package in its API, meaning we also generate bindings for the `io` package.\n\n## Note on channel garbage collection\nTL;DR: At the moment, every converted channel that is left open will leak a fixed amount of memory - **close any channels once unused**.\n\nChannels are converted by spawning a new goroutine which translates incoming values on the fly. At the moment, there is no known way to allow the garbage collector to clean up the goroutine's resources when the channel would have been GC'd (instead, the Rye and Go channels are just left dangling).\n\n## Advanced: Debug info\n### Profiling\nEnv: `RYEGEN_PROFILE=1`\n\nOutputs a profile of the tool run to `ryegen_cpu.prof`.\n\nYou can use [pprof](https://github.com/google/pprof) to visualize it.\n\n### Converter dependencies\nEnv: `RYEGEN_CONV_GRAPH=\u003cregex\u003e`\n\nOutputs the converter dependency graph to `ryegen_conv_graph.gv`.\n\nThe value of the environment variable is a regex that matches methods or types in the converter graph. All nodes that match the regex and their dependencies will be shown.\n\nRyegen will use the `dot` command ([graphviz](https://graphviz.org/)), if it is in your system path.\n\n### Imports\nEnv: `RYEGEN_IMPORT_GRAPH=\u003cregex\u003e`\n\nOutputs the import dependency graph to `ryegen_import_graph.gv`.\n\nThe value of the environment variable is a regex that matches packages in the import graph. All imports that match the regex and their imports will be shown.\n\nRyegen will use the `dot` command ([graphviz](https://graphviz.org/)), if it is in your system path.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frefaktor%2Fryegen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frefaktor%2Fryegen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frefaktor%2Fryegen/lists"}