{"id":15713564,"url":"https://github.com/r-unic/crystallizer","last_synced_at":"2025-05-12T22:54:36.220Z","repository":{"id":191954868,"uuid":"685456902","full_name":"R-unic/crystallizer","owner":"R-unic","description":"TypeScript to Crystal compiler. All the beauty and power of TypeScript, with all the speed and portability of Crystal.","archived":false,"fork":false,"pushed_at":"2024-03-28T23:56:14.000Z","size":43623,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-12T22:54:29.485Z","etag":null,"topics":["code-generation","codegen","compiler","crystal","transpiler","ts","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/R-unic.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":"2023-08-31T09:16:02.000Z","updated_at":"2024-11-20T23:56:43.000Z","dependencies_parsed_at":"2023-09-01T18:21:31.403Z","dependency_job_id":"ffe3836a-01e8-4d07-b6da-1021a8320557","html_url":"https://github.com/R-unic/crystallizer","commit_stats":null,"previous_names":["r-unic/crystallizer"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/R-unic%2Fcrystallizer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/R-unic%2Fcrystallizer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/R-unic%2Fcrystallizer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/R-unic%2Fcrystallizer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/R-unic","download_url":"https://codeload.github.com/R-unic/crystallizer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253837389,"owners_count":21971981,"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":["code-generation","codegen","compiler","crystal","transpiler","ts","typescript"],"created_at":"2024-10-03T21:32:07.876Z","updated_at":"2025-05-12T22:54:36.199Z","avatar_url":"https://github.com/R-unic.png","language":"TypeScript","readme":"![build](https://github.com/R-unic/crystallizer/actions/workflows/test.yml/badge.svg)\n# Crystallizer\nA TypeScript to Crystal compiler. All the beauty and power of TypeScript, with the speed and portability of Crystal.\n\n# Example\n```ts\n// examples/async-await/src/test.ts\n\nasync function myAsyncFunction(): Promise\u003cstring\u003e {\n  return \"Hello!\";\n}\n\nasync function main(): Promise\u003cvoid\u003e {\n  myAsyncFunction() // you can also use await here of course\n    .then(res =\u003e console.log(res));\n}\n\nmain();\n```\n```cr\n# examples/async-await/dist/test.cr\n\nprivate def myAsyncFunction : MiniFuture(String)\n  async! do\n    return \"Hello!\"\n  end\nend\nprivate def main : MiniFuture(Nil)\n  async! do\n    myAsyncFunction.then do |res|\n      puts(res)\n    end\n    return\n  end\nend\nawait main\n```\n\n# Usage\n* All of the below instructions are temporary.\n* You must have Crystal and TypeScript installed to be able to actually use it.\n\n1. Clone the repository\n2. Run `npm i \u0026\u0026 tsc`\n3. Run `npm start \u003cdirectory\u003e` to compile all TypeScript files inside of `\u003cdirectory\u003e` **OR** `npm start` to compile all TypeScript files inside your current working directory\n\n# Todo\n\n- cli:\n  - watch mode\n- codegen:\n  - ignore advanced type generics (T extends, ternary operator, initializers) because Crystal doesn't support them\n  - destructuring (this is so much harder than it needs to be, thanks TypeScript devs)\n  - for..in (is this even necessary?)\n  - macro the rest of the `console` library (warn, error, info, clear, etc.)\n  - macro the `??` operator (`a != nil ? a : b`)\n  - emit comments\n  - disallow:\n    - call expressions on arrow functions directly\n    - type parameters in function types\n- polyfills:\n  - `String` (😭)\n  - `Object`\n  - `Promise`\n- test:\n  - `StringBuilder` class\n  - commonly used utility functions\n  - if statements with `else`/`elsif` branches","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fr-unic%2Fcrystallizer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fr-unic%2Fcrystallizer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fr-unic%2Fcrystallizer/lists"}