{"id":16884296,"url":"https://github.com/simolus3/kart","last_synced_at":"2025-04-11T12:24:07.995Z","repository":{"id":104030968,"uuid":"246149736","full_name":"simolus3/kart","owner":"simolus3","description":"WIP Kotlin to Dart compiler","archived":false,"fork":false,"pushed_at":"2020-04-12T20:10:09.000Z","size":347,"stargazers_count":15,"open_issues_count":1,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-25T08:42:46.206Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","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/simolus3.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":"2020-03-09T21:53:44.000Z","updated_at":"2024-08-12T03:43:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"7f73376e-2aaf-4fc4-94bf-00c4ec1506ee","html_url":"https://github.com/simolus3/kart","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/simolus3%2Fkart","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simolus3%2Fkart/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simolus3%2Fkart/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simolus3%2Fkart/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simolus3","download_url":"https://codeload.github.com/simolus3/kart/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248401432,"owners_count":21097328,"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-13T16:17:10.731Z","updated_at":"2025-04-11T12:24:07.983Z","avatar_url":"https://github.com/simolus3.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# kart\n\nKart is a work-in-progress Kotlin to Dart compiler, aiming to support all platforms Dart runs on.\n\n## Roadmap\n\n1. Compile Kotlin: To get started, let's compile Kotlin code that doesn't have dependencies.\n   We should support all statements and expressions, methods, classes and interfaces, etc.\n   We'll support a tiny subset of Kotlin's standard library as compiler intrinsics.\n2. Write a standard lib: Write a Kotlin stdlib implementation targeting Dart.\n3. Further tooling support: Write a gradle plugin, look at Kotlin and Dart interop, incremental\ncompilation and hot reload, ...\n\n## Development\n\n### Setup\n\nTo start hacking on kart, clone this repository and download the [Kotlin CLI compiler](https://kotlinlang.org/docs/tutorials/command-line.html)\nsomewhere. Next, create a file called `local.properties` and put the following content into it:\n```properties\nkart.stdlib_jar=/path/to/downloaded/kotlinc/lib/kotlin-stdlib.jar\n```\n\nFinally, run `pub get` in the `kart_support` directory.\n\nYou can now compile a set of test cases with `./gradlew integration_tests:generateTextDescription`.\n\n### Compiling and running a file\n\nCreate a folder called `example` in this directory, then run `Main.kt` in `kotlin2kernel`, passing\nthe stdlib location from the setup step as parameter. This will compile all Kotlin sources in\n`example` into `output.dill`, which can then be run in Dart.\n\nFor some input files that work, see `integration_tests/cases/`.\n\nThe generated Kernel files can be run similar to regular Dart files: \nJust use `dart --null-safety output.dill`\n\n#### dart2js\n\nTo further compile a Kernel file to JavaScript with `dart2js`, a matching Dart platform needs to \nbe linked. To do that, run `dart kart_support/tool/link_stdlib.dart \u003coutput.dill\u003e js`. If you want to\nrun the generated file in node, use `js-server` instead of `js` in the end.\n\nFinally, run `dart2js \u003coutput_linked.dill\u003e`.\n\n### Viewing generated Dart\n\nTo view a generated `.dill` file in text form, you can run \n`dart kart_support/tool/kernel_to_text.dart \u003c file.dill`.\n\n### Project structure\n\nFor now, the project consists of two main modules: \n`kernel` is used to read, write and transform `.dill` files in Kotlin.\n`kotlin2kernel` is the main compiler, which transforms Kotlin IR to Kernel components.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimolus3%2Fkart","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimolus3%2Fkart","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimolus3%2Fkart/lists"}