Implementation of Starlark in pure Kotlin.
Starlark is strongly influenced by Python, Starlark syntax is a strict subset of Python, and Starlark semantics is almost a subset of that language.
- works
- passes upstream test suite even
- pure Kotlin Multiplatform (no dependency on the JVM)
- simplicity of implementation
- well-documented and reasonably clean code
-
performance
starlarkt is currently a tree-walk interpreter. The Go implementation of Starlark is a bytecode virtual machine. In the future a bytecode virtual machine may be implemented for starlarkt, but it's not deemed important.
- overview
- Starlark implementation in Go by Google:
- Starlark implementation in Java by Google
- Starlark implementation in Rust by Facebook
- test suite
- language design
- awesome-starlark
Yes, the useful info is kinda all over the place.
Practices
- Follow Kotlin coding conventions
- Follow Kotlin best practices for library designers
- Follow Semantic Line Breaks
Build a native executable (here, Apple Silicon):
$ ./gradlew :app:linkDebugExecutableMacosArm64Run it:
$ ./app/build/bin/macosArm64/debugExecutable/starlarkt.kexeBuild a JVM jar and startup script:
$ ./gradlew :app:installJvmDistRun it:
$ ./app/build/install/app-jvm/bin/appRun tests (on JVM, because it supports JUnit, which has more cool features than plain kotlin.test):
$ ./gradlew :interpreter:jvmTest