{"id":19212489,"url":"https://github.com/leafo/moonscript-javascript-compiler","last_synced_at":"2025-11-13T20:02:01.188Z","repository":{"id":66222872,"uuid":"131336432","full_name":"leafo/moonscript-javascript-compiler","owner":"leafo","description":"compile moonscript to javascript","archived":false,"fork":false,"pushed_at":"2018-11-28T08:05:58.000Z","size":63,"stargazers_count":16,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-04T17:30:21.729Z","etag":null,"topics":["moonscript"],"latest_commit_sha":null,"homepage":null,"language":"MoonScript","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/leafo.png","metadata":{"files":{"readme":"README.md","changelog":null,"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}},"created_at":"2018-04-27T19:22:02.000Z","updated_at":"2024-03-28T18:15:21.000Z","dependencies_parsed_at":null,"dependency_job_id":"5e948216-b3b3-490d-a111-525775281c69","html_url":"https://github.com/leafo/moonscript-javascript-compiler","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/leafo%2Fmoonscript-javascript-compiler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leafo%2Fmoonscript-javascript-compiler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leafo%2Fmoonscript-javascript-compiler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leafo%2Fmoonscript-javascript-compiler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leafo","download_url":"https://codeload.github.com/leafo/moonscript-javascript-compiler/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240286520,"owners_count":19777353,"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":["moonscript"],"created_at":"2024-11-09T13:47:08.311Z","updated_at":"2025-11-13T20:01:56.165Z","avatar_url":"https://github.com/leafo.png","language":"MoonScript","readme":"\n# MoonScript -\u003e JavaScript\n\nThis is a new transformer and compiler for MoonScript that targets JavaScript.\nIt is an experiment to test [tableshape](https://github.com/leafo/tableshape)\nas a way to rewrite the MoonScript to Lua transformer. Using tableshape will\nmake it easier to develop new features and generate optimized code at the\nexpense of compiling slower compared to the hand written transformer MoonScript\ncurrently uses. (Hopefully the performance penalty is not significant)\n\nIn the current MoonScript implementation, the transformer and compiler run at\nthe same time. State about the code, like what variables are declared, are\nstored in the compiler. When the compiler compiles a line, it can set state for\nthe transfer to see on the next line it processes.\n\nIn this new approach, the compiler and transformer are completely separate\nsteps. The compiler is responsible for translating a subset of syntax nodes to\nto the target language code with no state. The transformer will run completely\nahead of time and keep track of all state as it transforms the syntax tree.\n\nThis approach should help clean up some of the more problematic nodes in\nMoonScript, like the \"Run\" node. The syntax tree will go back to a plain table\ntree with no special instanced nodes that have compiler state in them.\n\n## Why JavaScript\n\nIt's not clear if this project will result in a fully functional JavaScript\nalternative. MoonScript has a lot of Lua semantics built into its syntax that\nwill not map well to JavaScript. It is not a goal of this project to change any\nof MoonScript's syntax to be more compatible with JavaScript.\n\nIt will allow you to compile a subset of the MoonScript syntax to JavaScript,\ngiving you the opportunity to write shared code across browser and server.\n\nHopefully this can be used to write Lapis views that can be used in JavaScript.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleafo%2Fmoonscript-javascript-compiler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleafo%2Fmoonscript-javascript-compiler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleafo%2Fmoonscript-javascript-compiler/lists"}