{"id":48437928,"url":"https://github.com/realcoldfry/tslua","last_synced_at":"2026-04-22T10:01:05.576Z","repository":{"id":349145758,"uuid":"1200915492","full_name":"RealColdFry/tslua","owner":"RealColdFry","description":"TypeScript to Lua transpiler, written in Go","archived":false,"fork":false,"pushed_at":"2026-04-16T07:49:32.000Z","size":1049,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-16T09:38:44.223Z","etag":null,"topics":["compiler","golang","lua","luajit","transpiler","typescript","typescript-to-lua"],"latest_commit_sha":null,"homepage":"https://realcoldfry.github.io/tslua/","language":"Go","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/RealColdFry.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":"NOTICE","maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-04T01:27:10.000Z","updated_at":"2026-04-16T06:54:31.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/RealColdFry/tslua","commit_stats":null,"previous_names":["realcoldfry/tslua"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/RealColdFry/tslua","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RealColdFry%2Ftslua","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RealColdFry%2Ftslua/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RealColdFry%2Ftslua/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RealColdFry%2Ftslua/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RealColdFry","download_url":"https://codeload.github.com/RealColdFry/tslua/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RealColdFry%2Ftslua/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32130776,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-22T08:34:57.708Z","status":"ssl_error","status_checked_at":"2026-04-22T08:34:55.583Z","response_time":58,"last_error":"SSL_read: 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":["compiler","golang","lua","luajit","transpiler","typescript","typescript-to-lua"],"created_at":"2026-04-06T14:03:56.789Z","updated_at":"2026-04-22T10:01:05.549Z","avatar_url":"https://github.com/RealColdFry.png","language":"Go","readme":"# tslua\n\n[![CI](https://github.com/RealColdFry/tslua/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/RealColdFry/tslua/actions/workflows/ci.yml)\n[![codecov](https://codecov.io/github/RealColdFry/tslua/graph/badge.svg?token=JARA4MERJG)](https://codecov.io/github/RealColdFry/tslua)\n\nTypeScript-to-Lua transpiler built on [typescript-go](https://github.com/microsoft/typescript-go). Single binary, no Node runtime required.\n\nBuilt on the architecture and test suite of [TypeScriptToLua](https://github.com/TypeScriptToLua/TypeScriptToLua). For general TypeScript-to-Lua usage and caveats, see the [TSTL docs](https://typescripttolua.github.io/). Targets LuaJIT and Lua 5.0-5.5.\n\n[Docs](https://realcoldfry.github.io/tslua/) · [Playground](https://realcoldfry.github.io/tslua/playground/) · [CLI reference](https://realcoldfry.github.io/tslua/cli/overview/)\n\n## Install\n\n```bash\nnpm i @tslua/cli\n```\n\n## Try it\n\n```ts\n// tslua eval -e\nconst items = [10, 20, 30];\nfor (const x of items) { print(x * 2) }\n\n// output:\n// items = {10, 20, 30}\n// for ____, x in ipairs(items) do\n//     print(x * 2)\n// end\n```\n\n## Why tslua\n\n- **Native Go binary.** Uses typescript-go's type checker and AST directly via `go:linkname` shims, no IPC or JS runtime in the loop.\n- **TSTL-compatible.** Ports TSTL's transforms and lualib faithfully. Reads the same `tsconfig.json` options and produces compatible output.\n- **TS 7 ready.** Built on the compiler that TypeScript is migrating to.\n- **Fast.** ~6-18ms incremental rebuilds in watch mode. [Benchmarks](https://realcoldfry.github.io/tslua/performance/)\n- **Alternative class styles.** `tstl` (default, TSTL-compatible), `inline`, `luabind`, `middleclass`.\n\n## Compatibility\n\nTwo verification approaches, both running TSTL's own tests:\n\n- **[Jest harness](https://realcoldfry.github.io/tslua/testing/overview/#jest-harness).** TSTL's Jest suite runs unmodified, but with tslua's transpiler swapped in via a Unix socket server. **6111 / 6179 tests pass (98.9%).**\n- **[Migrated Go tests](https://realcoldfry.github.io/tslua/testing/overview/#migrated-go-tests).** A migration system extracts TSTL's Jest specs and code-generates them into native Go tests. **5656 / 5903 cases migrated (95.8%)** across 70 of 71 spec files, with **100% behavioral pass rate** on migrated cases. The 247 unmigrated cases use TSTL assertion methods (`getMainLuaCodeChunk`, `getLuaExecutionResult`, etc.) not yet supported by the migration script.\n\n## What's not done yet\n\n- **Plugins.** TSTL's `luaPlugins` hook system. A Go binary can't load JS transformer plugins; the plugin story needs a different shape.\n- **Build modes.** `--buildMode library` not implemented.\n- **Diagnostics.** Not all TSTL diagnostics are ported, and some differ due to typescript-go's type checker.\n\n## Building from source\n\nRequires Go 1.24+, Node 20+, and [just](https://github.com/casey/just).\n\n```bash\ngit clone https://github.com/RealColdFry/tslua\ncd tslua\njust setup\njust build\n./tslua eval -e 'print(\"hello\")'\n```\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frealcoldfry%2Ftslua","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frealcoldfry%2Ftslua","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frealcoldfry%2Ftslua/lists"}