{"id":13713694,"url":"https://github.com/hirochachacha/plua","last_synced_at":"2026-01-17T03:50:35.412Z","repository":{"id":151168821,"uuid":"66744159","full_name":"hirochachacha/plua","owner":"hirochachacha","description":"Lua 5.3 implementation (WIP)","archived":false,"fork":false,"pushed_at":"2017-02-17T01:22:10.000Z","size":937,"stargazers_count":10,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-08-03T23:27:57.202Z","etag":null,"topics":["go","golang","language","lua"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hirochachacha.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":"2016-08-28T01:50:52.000Z","updated_at":"2023-01-05T19:53:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"f843c7b1-3250-4674-938b-51e618c16b8b","html_url":"https://github.com/hirochachacha/plua","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hirochachacha%2Fplua","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hirochachacha%2Fplua/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hirochachacha%2Fplua/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hirochachacha%2Fplua/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hirochachacha","download_url":"https://codeload.github.com/hirochachacha/plua/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224547006,"owners_count":17329413,"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":["go","golang","language","lua"],"created_at":"2024-08-02T23:01:42.265Z","updated_at":"2026-01-17T03:50:35.402Z","avatar_url":"https://github.com/hirochachacha.png","language":"Go","funding_links":[],"categories":["Repositories"],"sub_categories":[],"readme":"plua\n====\n\n[![GoDoc](https://godoc.org/github.com/hirochachacha/plua.svg?status.svg)](http://godoc.org/github.com/hirochachacha/plua)\n[![Build Status](https://travis-ci.org/hirochachacha/plua.svg?branch=master)](https://travis-ci.org/hirochachacha/plua)\n[![Code Climate](https://codeclimate.com/github/hirochachacha/plua/badges/gpa.svg)](https://codeclimate.com/github/hirochachacha/plua)\n[![Test Coverage](https://codeclimate.com/github/hirochachacha/plua/badges/coverage.svg)](https://codeclimate.com/github/hirochachacha/plua/coverage)\n\nDescription\n-----------\n\nLua 5.3 implementation.\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/hirochachacha/plua/compiler\"\n\t\"github.com/hirochachacha/plua/runtime\"\n\t\"github.com/hirochachacha/plua/stdlib\"\n)\n\nvar input = `\n-- example code is taken from https://tour.golang.org/concurrency/5\n\nfunction fibonacci(ch, quit)\n  local x, y = 0, 1\n  while true do\n    local chosen, recv, recvOK = goroutine.select(\n      goroutine.case(\"send\", ch, x),\n      goroutine.case(\"recv\", quit)\n    )\n\n    if chosen == 1 then\n      x, y = y, x+y\n    elseif chosen == 2 then\n\t  print(\"quit\")\n      return\n    end\n  end\nend\n\nch = goroutine.newchannel()\nquit = goroutine.newchannel()\n\ngoroutine.wrap(function()\n  for i = 1, 10 do\n    print(ch:recv())\n  end\n  quit:send(nil)\nend)()\n\nfibonacci(ch, quit)\n\nreturn \"ok\"\n`\n\nfunc main() {\n\tc := compiler.NewCompiler()\n\n\tproto, err := c.Compile(strings.NewReader(input), \"=input.lua\", compiler.Text)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tp := runtime.NewProcess()\n\n\tp.Require(\"\", stdlib.Open)\n\n\trets, err := p.Exec(proto)\n\tif err != nil {\n\t\t// object.PrintError(err) // print traceback from error\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(rets[0])\n}\n```\nOutput:\n```\n0\ttrue\n1\ttrue\n1\ttrue\n2\ttrue\n3\ttrue\n5\ttrue\n8\ttrue\n13\ttrue\n21\ttrue\n34\ttrue\nquit\nok\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhirochachacha%2Fplua","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhirochachacha%2Fplua","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhirochachacha%2Fplua/lists"}