{"id":13672750,"url":"https://github.com/ovr/StaticScript","last_synced_at":"2025-04-28T03:32:56.509Z","repository":{"id":41432335,"uuid":"151862633","full_name":"ovr/StaticScript","owner":"ovr","description":":rocket: TypeScript compiler on top of TypeScript as frontend and LLVM as backend ","archived":false,"fork":false,"pushed_at":"2021-12-12T17:55:41.000Z","size":2343,"stargazers_count":637,"open_issues_count":7,"forks_count":29,"subscribers_count":20,"default_branch":"master","last_synced_at":"2025-04-05T06:07:31.407Z","etag":null,"topics":["llvm","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/ovr.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}},"created_at":"2018-10-06T17:07:48.000Z","updated_at":"2025-03-28T15:05:38.000Z","dependencies_parsed_at":"2022-09-02T05:20:42.528Z","dependency_job_id":null,"html_url":"https://github.com/ovr/StaticScript","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ovr%2FStaticScript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ovr%2FStaticScript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ovr%2FStaticScript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ovr%2FStaticScript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ovr","download_url":"https://codeload.github.com/ovr/StaticScript/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251246394,"owners_count":21558762,"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":["llvm","typescript"],"created_at":"2024-08-02T09:01:46.268Z","updated_at":"2025-04-28T03:32:51.497Z","avatar_url":"https://github.com/ovr.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# \u003cimg src=\"./docs/assets/logo/logo-100x.png\" width=\"28\"\u003e StaticScript\n\n\u003e Real Static Typed Script - RSTS project.\n\nStaticScript is a language on top of TypeScript as frontend and LLVM as backend for code-generation to binary. \n\n![](./docs/assets/how-it-works.png)\n\n### How it was implemented\n\nMy talk about How it's working on hight level and about V8/JIT and etc\n\n[Video](https://www.youtube.com/watch?v=gS9a_NBHdw0)\n\nI prepared two talks on PiterJS meetup with explanation about how it was implemented\n\n***Part 1***\n\n[Slides](https://speakerdeck.com/ovr/staticscript-typescript-compiler-on-top-of-typescript-as-frontend-and-llvm-as-backend-number-1)\n\n[Video](https://youtu.be/KjJn-J8d1Xc)\n\n***Part 2***\n\n[Slides](https://speakerdeck.com/ovr/staticscript-typescript-compiler-on-top-of-typescript-as-frontend-and-llvm-as-backend-number-2)\n\n(Video)(Sorry, but due technical problems on meetup It was not recorded)\n\n# Installing\n\nFor latest stable version:\n\n```sh\nnpm install -g static-script\n```\n\n# Let's write simple example\n\nPut it in `calculate-pi.ts`\n\n```ts\n{\n    function calculatePI(cycles: number): number {\n        let inside = 0;\n\n        for (let i = 0; i \u003c cycles; i++) {\n            let x = Math.random() * 2 - 1;\n            let y = Math.random() * 2 - 1;\n\n            if ((x*x + y*y) \u003c 1) {\n                inside++\n            }\n        }\n\n        return 4.0 * inside / cycles;\n    }\n\n    console_log(calculatePI(1000000000));\n}\n```\n\nNext compile it:\n\n```sh\n$ ./bin/ssc calculate-pi.ts\n```\n\nNext run it:\n\n```sh\n$ time ./output/main\n```\n\nThis will produce:\n\n```\n3.144800\n./output/main  0,01s user 0,00s system 80% cpu 0,013 total\n```\n\n### LICENSE\n\nThis project is open-sourced software licensed under the MIT License.\n\nSee the [LICENSE](LICENSE) file for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fovr%2FStaticScript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fovr%2FStaticScript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fovr%2FStaticScript/lists"}