{"id":30133874,"url":"https://github.com/kingwill101/lualike","last_synced_at":"2025-08-10T20:13:36.534Z","repository":{"id":306768091,"uuid":"1010078091","full_name":"kingwill101/lualike","owner":"kingwill101","description":"a lua like scripting language for dart","archived":false,"fork":false,"pushed_at":"2025-07-27T14:50:08.000Z","size":6606,"stargazers_count":0,"open_issues_count":4,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-07-27T14:52:23.748Z","etag":null,"topics":["dart","dartlang","lua","lua-script","repl","scripting"],"latest_commit_sha":null,"homepage":"","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kingwill101.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"zenodo":null}},"created_at":"2025-06-28T09:46:00.000Z","updated_at":"2025-07-27T14:50:11.000Z","dependencies_parsed_at":"2025-07-27T14:52:26.331Z","dependency_job_id":null,"html_url":"https://github.com/kingwill101/lualike","commit_stats":null,"previous_names":["kingwill101/lualike"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/kingwill101/lualike","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kingwill101%2Flualike","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kingwill101%2Flualike/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kingwill101%2Flualike/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kingwill101%2Flualike/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kingwill101","download_url":"https://codeload.github.com/kingwill101/lualike/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kingwill101%2Flualike/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269780617,"owners_count":24474686,"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-08-10T02:00:08.965Z","response_time":71,"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","dartlang","lua","lua-script","repl","scripting"],"created_at":"2025-08-10T20:13:32.236Z","updated_at":"2025-08-10T20:13:36.518Z","avatar_url":"https://github.com/kingwill101.png","language":"Dart","readme":"# LuaLike\n\n[![GitHub release](https://img.shields.io/github/release/kingwill101/lualike?include_prereleases=\u0026sort=semver\u0026color=blue)](https://github.com/kingwill101/lualike/releases/)\n[![Pub Version](https://img.shields.io/pub/v/lualike)](https://pub.dev/packages/lualike)\n![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/kingwill101/lualike/.github%2Fworkflows%2Fdart.yml)\n[![License](https://img.shields.io/badge/License-MIT-blue)](#license)\n[![issues - lualike](https://img.shields.io/github/issues/kingwill101/lualike)](https://github.com/kingwill101/lualike/issues)\n\n\nA Lua-like language interpreter implemented in Dart, focusing on a clean, easy-to-use AST-based interpreter.\n\n## Features\n\n- Lua-like syntax and semantics\n- AST-based interpreter\n- Rich standard library implementation\n- Seamless interoperability with Dart\n- Robust error handling with protected calls\n\n## Getting started\n\nAdd the package to your `pubspec.yaml`:\n\n```yaml\ndependencies:\n  lualike: ^0.0.1\n```\n\n## Usage\n\n### Basic Usage\n\nThe primary way to execute code is using the AST interpreter.\n\n```dart\nimport 'package:lualike/lualike.dart';\n\nvoid main() async {\n  // Execute some code\n  final result = await executeCode('''\n    local x = 10\n    local y = 20\n    return x + y\n  ''');\n\n  print('Result: ${result.unwrap()}');\n}\n```\n\u003e Result: 30\n\n### Dart Interoperability\n\nYou can easily bridge Dart and LuaLike code using the `LuaLike` class.\nThe class provides two-way interoperability:\n- **`expose`**: Makes Dart functions available to be called from Lua.\n- **`call`**: Allows Dart to call functions defined in Lua.\n\n```dart\nimport 'package:lualike/lualike.dart';\n\nvoid main() async {\n  // Create a lualike instance\n  final lualike = LuaLike();\n\n  // 1. Expose a Dart function to LuaLike\n  lualike.expose('dart_print', (v) {\n    print(\"---------------\");\n    print(v[0].unwrap());\n    print(\"---------------\");\n  });\n\n  // 2. Define a Lua function that uses the exposed Dart function\n  await lualike.execute('''\n    function greet_from_lua(name)\n      dart_print(\"Hello, \" .. name .. \" from a Dart function!\")\n    end\n  ''');\n\n  // 3. Call the Lua function from Dart\n  await lualike.call('greet_from_lua', [Value(\"World\")]);\n\n  // 4. Share data from Dart to Lua\n  lualike.setGlobal('config', {'debug': true, 'maxRetries': 3});\n\n  await lualike.execute('''\n    if config.debug then\n      dart_print(\"Max retries: \" .. config.maxRetries)\n    end\n  ''');\n}\n\n```\n\n```\n---------------\nHello, World from a Dart function!\n---------------\n---------------\nMax retries: 3\n---------------\n\n```\n\n\n## Documentation\n\nFor more examples, check out the `/example` folder.\n\nFor detailed documentation, see the `/docs` folder, which includes guides on:\n- [Value handling](./docs/guides/value_handling.md)\n- [Metatables and metamethods](./docs/guides/metatables.md)\n- [Error handling](./docs/guides/error_handling.md)\n- [Writing builtin functions](./docs/guides/writing_builtin_functions.md)\n- [Standard library implementation](./docs/guides/standard_library.md)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkingwill101%2Flualike","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkingwill101%2Flualike","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkingwill101%2Flualike/lists"}