{"id":16686967,"url":"https://github.com/paralin/goscript","last_synced_at":"2025-03-13T16:23:39.312Z","repository":{"id":152080483,"uuid":"86519684","full_name":"paralin/goscript","owner":"paralin","description":"Type-aware and modular Go to JavaScript compiler.","archived":false,"fork":false,"pushed_at":"2024-03-18T22:16:59.000Z","size":26,"stargazers_count":1,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-10T22:48:36.533Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/paralin.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}},"created_at":"2017-03-29T00:10:35.000Z","updated_at":"2024-03-18T22:10:55.000Z","dependencies_parsed_at":null,"dependency_job_id":"d073d18a-9af7-4bbe-9d21-866c5fd0cf58","html_url":"https://github.com/paralin/goscript","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/paralin%2Fgoscript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paralin%2Fgoscript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paralin%2Fgoscript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paralin%2Fgoscript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paralin","download_url":"https://codeload.github.com/paralin/goscript/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243438977,"owners_count":20291057,"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":[],"created_at":"2024-10-12T15:07:23.418Z","updated_at":"2025-03-13T16:23:39.285Z","avatar_url":"https://github.com/paralin.png","language":"Go","readme":"# GoScript\n\n[![GoDoc Widget]][GoDoc] [![Go Report Card Widget]][Go Report Card]\n\n[GoDoc]: https://godoc.org/github.com/paralin/goscript\n[GoDoc Widget]: https://godoc.org/github.com/paralin/goscript?status.svg\n[Go Report Card Widget]: https://goreportcard.com/badge/github.com/paralin/goscript\n[Go Report Card]: https://goreportcard.com/report/github.com/paralin/goscript\n\n## Introduction\n\nGoScript is a Go to TypeScript compiler. It allows Go programs to run in the\nbrowser after being checked and optimized by the TypeScript compiler.\n\nIt's currently an experimental project, and not ready for production.\n\n## Generated Code\n\nBelow is a simple example of how code is generated:\n\n```go\npackage main\n\nimport (\n\t\"os\"\n)\n\nfunc main() {\n\tos.Stdout.WriteString(\"Hello world!\\n\")\n}\n```\n\nGenerated with `goscript compile .`:\n\n```typescript\nimport * as os from \"@go/os\";\nfunction main() {\n\tos.Stdout.WriteString(\"Hello world!\\n\");\n}\n```\n\nCode is compiled with `GOARCH=js`. Code designed to work with `syscall/js` and\nwasm /should/ work correctly with GoScript out of the box.\n\nAll Go import paths are prefixed with `@go/` and can be imported in TypeScript:\n\n```typescript\nimport { MyFunction, MyStruct } from '@go/github.com/myorg/mypackage';\n\nMyFunction();\nlet myThing = new MyStruct();\nmyThing.DoSometing();\n```\n\nGo structs are converted into classes.\n\n## Roadmap\n\n - [ ] Sample programs compile \u0026 run\n - [ ] Generate init() function to recursively initialize packages\n - [ ] Tooling to integrate with typescript compiler\n - [ ] \"go test\" implementation with Go -\u003e Ts transformation\n - [ ] performance testing\n - [ ] examples of calling Go code from TypeScript\n\nAt the moment, some of the Go ast is not implemented. This work will be\ncompleted first before tackling the above features.\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparalin%2Fgoscript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fparalin%2Fgoscript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparalin%2Fgoscript/lists"}