{"id":31211547,"url":"https://github.com/rosshadden/gdext-v","last_synced_at":"2025-09-21T05:32:50.099Z","repository":{"id":286888850,"uuid":"962878182","full_name":"rosshadden/gdext-v","owner":"rosshadden","description":"V bindings for Godot.","archived":false,"fork":false,"pushed_at":"2025-07-08T20:53:52.000Z","size":1214,"stargazers_count":11,"open_issues_count":4,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-08T21:41:29.352Z","etag":null,"topics":["gamedev","gdextention","godot","v","vlang","vlang-package"],"latest_commit_sha":null,"homepage":"https://rosshadden.github.io/gdext-v/","language":"V","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/rosshadden.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-04-08T20:12:32.000Z","updated_at":"2025-07-08T20:53:56.000Z","dependencies_parsed_at":"2025-04-24T20:24:35.210Z","dependency_job_id":"2609f8a7-6db0-4c0b-ba52-1d44877c13a3","html_url":"https://github.com/rosshadden/gdext-v","commit_stats":null,"previous_names":["rosshadden/gdext-v"],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/rosshadden/gdext-v","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rosshadden%2Fgdext-v","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rosshadden%2Fgdext-v/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rosshadden%2Fgdext-v/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rosshadden%2Fgdext-v/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rosshadden","download_url":"https://codeload.github.com/rosshadden/gdext-v/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rosshadden%2Fgdext-v/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276195642,"owners_count":25601156,"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-21T02:00:07.055Z","response_time":72,"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":["gamedev","gdextention","godot","v","vlang","vlang-package"],"created_at":"2025-09-21T05:31:10.575Z","updated_at":"2025-09-21T05:32:50.092Z","avatar_url":"https://github.com/rosshadden.png","language":"V","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gdext-v\n\nV bindings for Godot.\n\n## Examples\n\nCheck out the [demo repository](https://github.com/rosshadden/gdext-v-demos) for examples.\n\n## Setup\n\nI (obviously) don't have a lot of docs yet and haven't spent time making this project user-friendly yet.\nBut here are the steps that should get you started.\nThese will definitely improve over time.\n\n### Setup library\n\n1. Clone/download this repo somewhere:\n```bash\ngit clone https://github.com/rosshadden/gdext-v.git\n```\n\n2. Point a symlink to it from V's module directory (or make this where you clone it):\n```bash\nln -s /absolute/path/to/gdext-v ~/.vmodules/gd\n```\n\n3. Dump the extension API from Godot into `./data/`:\n```bash\ncd data\ngodot --headless --dump-extension-api-with-docs\ncd ..\n```\n\n4. Run the generator:\n```bash\n./bin/gen.vsh\n```\n\n### Setup project\n\n1. Add a `.gdextension` file to your Godot project (I put mine at `./lib/v.gdextension`):\n```toml\n[configuration]\nentry_symbol = \"gdext_v_init\"\ncompatibility_minimum = 4.4\nreloadable = true\n\n[libraries]\nlinux.debug.x86_64 = \"res://lib/libvlang.so\"\n```\n\n2. Make a V file in your Godot project that will serve as the entry point:\n```v\nmodule main\n\nimport gd\nimport gd.gdext\nimport src.entities.actors\nimport services\n\npub fn init(v voidptr, l gd.GDExtensionInitializationLevel) {\n\tif l == .initialization_level_scene {\n\t\t// This is where you register your classes\n\t\tgd.register_class[actors.Player]('Node2D')\n\t\tgd.register_class_with_name[services.Debug]('Node', 'ThisIsHowYouCanGiveACustomClassName')\n\t}\n}\n\npub fn deinit(v voidptr, l gd.GDExtensionInitializationLevel) {\n\tif l == .initialization_level_scene {}\n}\n\n@[export: 'gdext_v_init']\nfn init_gdext(gpaddr fn (\u0026i8) gd.GDExtensionInterfaceFunctionPtr, clp gd.GDExtensionClassLibraryPtr, mut gdnit gd.GDExtensionInitialization) gd.GDExtensionBool {\n\tgdext.setup(gpaddr, clp)\n\tgdnit.initialize = init\n\tgdnit.deinitialize = deinit\n\treturn 1\n}\n```\n\u003e Note: This is `export`, not to be confused with `gd.export`. This is V's built-in way of exporting to the C FFI.\n\nIf you want your logs to go through Godot, you can set up the `gd.Log`.\n```v\nimport log\n\n@[export: 'gdext_v_init']\nfn init_gdext(gpaddr fn (\u0026i8) gd.GDExtensionInterfaceFunctionPtr, clp gd.GDExtensionClassLibraryPtr, mut gdnit gd.GDExtensionInitialization) gd.GDExtensionBool {\n\t// ☝️all the above setup stuff\n\tlog.set_logger(gd.Log{})\n\treturn 1\n}\n```\n\nThis is _not necessary_, and in fact I prefer it off, because for some reason if there is a crash Godot doesn't output any logs,\nwhereas logging through V's default logger works great.\nNote that the default logger has a `level` of `.info`, so I like to lower it: `log.set_level(.debug)`.\n\n3. Add your files and register them in the `init_gd` function as shown above.\n\n4. Build the project:\n```bash\nv -shared -enable-globals -o lib/libvlang.so -d no_backtrace .\npatchelf --clear-exexstack lib/libvlang.so\n```\n\nThe `patchelf` step is to remove exec bit from the library, which is set by `tcc`.\nThus if using another compiler (with the `-cc` flag) that step may be omitted.\nHowever, `tcc` is _leaps and bounds_ faster than `clang` or `gcc` in my testing,\nso I recommend using it throughout development and using a different compiler for release builds.\n\nI do all this and more [in a build script in the demo repo](https://github.com/rosshadden/gdext-v-demos/blob/44aec37c1ef473ec839660a97abe6a14860b362f/bin/build.vsh).\n\nAnother, more minimal, repo you could reference is the [babel](https://github.com/gamma-ray-studios/babel/blob/main/bin/build.vsh) project,\nwhich is meant to showcase using basic functionality of many Godot language bindings, including `gdext-v`.\n\n## Usage\n\nOnce everything is set up, you just have to run the step above whenever you make changes to your V code:\n```bash\nv -shared -enable-globals -o lib/libvlang.so -d no_backtrace .\npatchelf --clear-exexstack lib/libvlang.so\n```\n\n## Documentation\n\nCheck out the [generated API docs](https://rosshadden.github.io/gdext-v/).\n\nOr generate your own locally:\n```v\nv doc -m -o docs -f html .\ncp .github/templates/index.html docs/\n```\n\n## State\n\nEverything needed to make games with V has been implemented.\nAnd it's pretty damn ergonomic.\nI have a really low tolerance for friction and I want to make this project as pleasant as realistically possible to work with.\n\n## Helpful resources\n\n- [godot-cpp](https://github.com/godotengine/godot-cpp)\n- [godot-rust](https://github.com/godot-rust/gdext)\n- [gdext-nim](https://github.com/godot-nim/gdext-nim)\n- jcweaver997's work on his [vgdextension](https://github.com/jcweaver997/vgdextension) was invaluable to this project.\nI found it while bashing my head against the wall on something specific and searching Github with `NOT is:fork path:*.v` queries (👈 pro tip).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frosshadden%2Fgdext-v","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frosshadden%2Fgdext-v","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frosshadden%2Fgdext-v/lists"}