A lisp-alike interpreter written in Kotlin multiplatform, don't ask....it's just fun ;)
Done starting from here, and then it just got too fun to stop.
Native is tested/setup only for MacOS using linenoise for light readline support. Jvm version is using JLine for readline.
Source code for console colors is included (because I'm too lazy for a proper multiplatform PR :/) from the excellent mordant and colormath libs, originally only for JVM.
I'm using here a derivative lexer which I ported from scala to kotlin, pretty happy with it.
-
make dirmake
- to prepare native target dirs -
make
- to compile native target linenoise lib -
./gradlew check
- for tests (both native/jvm) -
./gradlew build
- to build both jvm and native executables -
./gradlew tasks
- will show all the available tasks if you need anything else.
- jvm -
kotlin build/libs/klisp-0.0.1.jar
- native release -
build/bin/nat/mainReleaseExecutable/main.kexe
- native debug -
build/bin/nat/mainDebugExecutable/main.kexe
I'm using Intellij IDEA for the jvm target and Intellij CLion for the native target, for both debug/run works really smooth, only prob is native compile/link times are pretty slow atm, guess JetBrains will fix that soon.