{"id":13902278,"url":"https://github.com/sunny-chung/kotlite","last_synced_at":"2025-06-24T15:07:37.821Z","repository":{"id":232148871,"uuid":"783528970","full_name":"sunny-chung/kotlite","owner":"sunny-chung","description":"A Kotlin Multiplatform library to interpret Kotlite code, which is a subset of the Kotlin language, during runtime in a safe way.","archived":false,"fork":false,"pushed_at":"2024-07-09T14:53:26.000Z","size":3269,"stargazers_count":59,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-13T18:48:30.871Z","etag":null,"topics":["android","interpreter","ios","javascript","kotlin","kotlin-multiplatform","macos","tvos","watchos"],"latest_commit_sha":null,"homepage":"https://sunny-chung.github.io/kotlite/","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/sunny-chung.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2024-04-08T04:29:35.000Z","updated_at":"2025-05-10T04:03:30.000Z","dependencies_parsed_at":"2024-04-27T07:44:46.063Z","dependency_job_id":null,"html_url":"https://github.com/sunny-chung/kotlite","commit_stats":null,"previous_names":["sunny-chung/kotlite"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/sunny-chung/kotlite","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunny-chung%2Fkotlite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunny-chung%2Fkotlite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunny-chung%2Fkotlite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunny-chung%2Fkotlite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sunny-chung","download_url":"https://codeload.github.com/sunny-chung/kotlite/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunny-chung%2Fkotlite/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261700827,"owners_count":23196504,"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":["android","interpreter","ios","javascript","kotlin","kotlin-multiplatform","macos","tvos","watchos"],"created_at":"2024-08-06T22:01:04.640Z","updated_at":"2025-06-24T15:07:37.792Z","avatar_url":"https://github.com/sunny-chung.png","language":"Kotlin","funding_links":[],"categories":["Kotlin"],"sub_categories":[],"readme":"# Kotlite \u0026 Kotlite Interpreter\n\n_A lite embedded Kotlin interpreter_\n\n![Android](https://img.shields.io/badge/Android-blue)\n![JVM](https://img.shields.io/badge/JVM-blue)\n![js](https://img.shields.io/badge/js-blue)\n![iOS](https://img.shields.io/badge/iOS-blue)\n![macOS](https://img.shields.io/badge/macOS-blue)\n![watchOS](https://img.shields.io/badge/watchOS-blue)\n![tvOS](https://img.shields.io/badge/tvOS-blue)\n![Verification Test Status](https://github.com/sunny-chung/kotlite/actions/workflows/run-test.yaml/badge.svg?branch=main)\n\n**Kotlite** is an open-sourced type-safe programming language that has a rich subset of the [script](https://kotlinlang.org/docs/custom-script-deps-tutorial.html) variant of the [Kotlin](https://kotlinlang.org/) programming language. It comes with standard libraries, which are a subset of Kotlin Multiplatform/Common standard libraries and a few third-party libraries.\n\n**Kotlite Interpreter** is a lightweight Kotlin Multiplatform library to interpret and execute codes written in Kotlite, and bridge the host runtime environment and the embedded runtime environment.\n\nKotlite Interpreter ![Kotlite Interpreter](https://img.shields.io/maven-central/v/io.github.sunny-chung/kotlite-interpreter)\n\nKotlite Stdlib ![Kotlite Stdlib](https://img.shields.io/maven-central/v/io.github.sunny-chung/kotlite-stdlib)\n\nKotlite Library Preprocessor ![Kotlite Library Preprocessor](https://img.shields.io/maven-central/v/io.github.sunny-chung/kotlite-stdlib-processor-plugin)\n\n[Release Notes](CHANGELOG.md)\n\n## TL;DR\n\n```kotlin\nval env = ExecutionEnvironment().apply {\n    install(AllStdLibModules())\n}\nval interpreter = KotliteInterpreter(\n    filename = \"UserScript\",\n    code = \"\"\"\n        fun fib(n: Int): Long {\n            if (n \u003e 100) throw Exception(\"n is too large\")\n            \n            val dp = mutableMapOf\u003cInt, Long\u003e()\n            fun f(i: Int): Long {\n                if (i \u003c 0) throw Exception(\"Invalid i: ${'$'}i\")\n                if (i \u003c= 1) return i.toLong()\n                if (i in dp) {\n                    return dp[i]!!\n                }\n                return (f(i - 2) + f(i - 1)).also {\n                    dp[i] = it\n                }\n            }\n            \n            return f(n)\n        }\n        val a = fib(19)\n    \"\"\".trimIndent(),\n    executionEnvironment = env,\n)\ninterpreter.eval()\nval symbolTable = interpreter.symbolTable()\nval a = (symbolTable.findPropertyByDeclaredName(\"a\") as LongValue).value // 4181L\n```\n\nThe interpreter is well tested.\n\n![Well tested](./doc/usermanual/media/tests.png)\n\n## Demo\n\n[Web - Kotlite Interpreter in browser](https://sunny-chung.github.io/kotlite/demo/)\n\nhttps://github.com/sunny-chung/kotlite/assets/14835950/464ddb68-5623-463e-89cb-5b34a4bebf41\n\nhttps://github.com/sunny-chung/kotlite/assets/14835950/417143fa-6240-40cf-ba5f-8e40e97a4243\n\nhttps://github.com/sunny-chung/kotlite/assets/14835950/f731c9a0-d941-4cd3-a23c-bfc2a60429f4\n\n## Documentation\n\n[Documentation site](https://sunny-chung.github.io/kotlite/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsunny-chung%2Fkotlite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsunny-chung%2Fkotlite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsunny-chung%2Fkotlite/lists"}