{"id":15762370,"url":"https://github.com/williamvenner/gluac-rs","last_synced_at":"2025-04-30T07:47:36.025Z","repository":{"id":62439601,"uuid":"374174200","full_name":"WilliamVenner/gluac-rs","owner":"WilliamVenner","description":"👨‍💻 Rust GLua bytecode compiler","archived":false,"fork":false,"pushed_at":"2024-07-11T19:20:08.000Z","size":25,"stargazers_count":10,"open_issues_count":0,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-10-11T11:33:47.109Z","etag":null,"topics":["bytecode","glua","gluac","gmod","lua","luajit","rust"],"latest_commit_sha":null,"homepage":"","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/WilliamVenner.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}},"created_at":"2021-06-05T17:28:09.000Z","updated_at":"2024-07-12T03:28:37.000Z","dependencies_parsed_at":"2024-10-25T10:18:09.220Z","dependency_job_id":"7586e8d7-a8b8-4252-94e7-78e7064b178b","html_url":"https://github.com/WilliamVenner/gluac-rs","commit_stats":{"total_commits":26,"total_committers":1,"mean_commits":26.0,"dds":0.0,"last_synced_commit":"c64e1160f48f2830f705029b1a36b8303e2ab142"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WilliamVenner%2Fgluac-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WilliamVenner%2Fgluac-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WilliamVenner%2Fgluac-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WilliamVenner%2Fgluac-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WilliamVenner","download_url":"https://codeload.github.com/WilliamVenner/gluac-rs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251665573,"owners_count":21624287,"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":["bytecode","glua","gluac","gmod","lua","luajit","rust"],"created_at":"2024-10-04T11:08:55.764Z","updated_at":"2025-04-30T07:47:35.988Z","avatar_url":"https://github.com/WilliamVenner.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 👨‍💻 gluac-rs\r\n\r\nCompile Garry's Mod Lua into bytecode using Rust!\r\n\r\n## Features\r\n\r\n* Compatible with Windows and Linux\r\n* Works with 32-bit and 64-bit branches of the game (you must compile for the correct target however)\r\n* Thread-safe\r\n\r\n## Usage\r\n\r\nAdd to your [`Cargo.toml`](https://doc.rust-lang.org/cargo/reference/manifest.html) file:\r\n```toml\r\n[dependencies]\r\ngluac-rs = \"*\"\r\n```\r\n\r\n#### [`parking_lot`](https://crates.io/crates/parking_lot) support\r\n\r\nThis crate supports the [`parking_lot`](https://crates.io/crates/parking_lot) Mutex, just add the `parking_lot` feature flag like so:\r\n\r\n```toml\r\n[dependencies]\r\ngluac-rs = { version = \"*\", features = [\"parking_lot\"] }\r\n```\r\n\r\n## Example\r\n\r\n```rust\r\n// A utility macro for user-friendly generation of Lua-compatible CStrings.\r\nuse gluac::lua_string;\r\n\r\n// The instance of our bytecode compiler. This internally creates and prepares a Lua state and closes it when dropped.\r\nlet compiler: BytecodeCompiler = gluac::compiler();\r\n\r\n// Compiling a Lua source code string\r\nlet result: Result\u003cVec\u003cu8\u003e, BytecodeError\u003e = compiler.compile_string(lua_string!(r#\"print(\"Hello, world!\")\"#));\r\n...\r\n\r\n// Compiling a file\r\nlet result: Result\u003cVec\u003cu8\u003e, BytecodeError\u003e = compiler.compile_file(lua_string!(r#\"path/to/file.lua\"#));\r\n...\r\n```\r\n\r\n## Dependencies\r\n\r\nThis crate requires a few dependencies to be in the same directory as the executable.\r\n\r\n### Where to find them\r\n\r\nYou can find these libraries in your Garry's Mod installation, they appear to pop up in a number of different paths on different platforms and branches, so here's all the ones I know of:\r\n\r\n* `bin/`\r\n* `bin/win64`\r\n* `bin/linux32`\r\n* `bin/linux64`\r\n* `garrysmod/bin`\r\n\r\nTake care to use the correct dependencies for your target branch of the game (32-bit/64-bit)\r\n\r\n### Windows\r\n\r\n* `lua_shared.dll`\r\n* `tier0.dll`\r\n* `vstdlib.dll`\r\n\r\n### Linux\r\n\r\nYou may also need to add the directory to the `LD_LIBRARY_PATH` environment variable.\r\n\r\n* `lua_shared.so`\r\n* `libtier0.so`\r\n* `libvstdlib.so`\r\n* `libsteam_api.so` (32-bit only)\r\n\r\nI think older Garry's Mod versions have `_srv` suffixes in the file names for these libraries. These are also supported.\r\n\r\n## Credits\r\n\r\n[Willox](https://github.com/willox) - base code for Lua bindings and lua_shared loading\r\n\r\n[Mats](https://github.com/m4tsa) - helping :D\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwilliamvenner%2Fgluac-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwilliamvenner%2Fgluac-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwilliamvenner%2Fgluac-rs/lists"}