From 99122bb55df520b894361333975642d1c22df33b Mon Sep 17 00:00:00 2001 From: Kyle Serrecchia Date: Mon, 10 Aug 2026 10:31:05 -0700 Subject: [PATCH] complete Java and Kotlin CI coverage --- ROADMAP.md | 11 +++++----- languages/j/java/README.md | 27 ++++++++++++------------ languages/j/java/expected-output.txt | 18 ++++++++++++++++ languages/j/java/test.sh | 8 ++++++- languages/k/kotlin/README.md | 29 +++++++++++++++++++------- languages/k/kotlin/expected-output.txt | 28 +++++++++++++++++++++++++ languages/k/kotlin/test.sh | 12 +++++++++++ 7 files changed, 104 insertions(+), 29 deletions(-) create mode 100644 languages/j/java/expected-output.txt create mode 100644 languages/k/kotlin/expected-output.txt create mode 100644 languages/k/kotlin/test.sh diff --git a/ROADMAP.md b/ROADMAP.md index d5715ea..1ec40db 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -31,10 +31,11 @@ Folders without a `test.sh` are skipped until backfilled. dotnet. OCaml + Elixir captured locally; F# and Clojure captured from the CI log (PR #31). Clojure uses `clojure`, not the interactive `clj` wrapper (which printed an rlwrap notice instead of running). All four green on CI. -- [ ] **Step 5 — Java and Kotlin.** Java: PR #29 (the `java` branch) fixes the - numeral typing so PRED works; add test.sh + expected output to that - branch, let CI validate it, then merge #29. Kotlin: runner has a JDK; - install kotlinc in the workflow. +- [x] **Step 5 — Java and Kotlin.** Java's numeral fix and `test.sh` landed in + PR #29; its expected output was captured from that PR's actual CI run. + Kotlin's existing implementation compiles unchanged with Kotlin 2.4.10; + its test builds a temporary runnable jar. GitHub's `ubuntu-latest` runner + already provides Kotlin 2.4.10 and Java 17, so no installer is needed. - [ ] **Step 6 — exotic languages: ArkScript, FatScript, bruijn, Language 84.** Each needs its own toolchain acquisition (GitHub releases, cargo/stack installs, or building from source). If one is genuinely unobtainable in @@ -71,5 +72,3 @@ Keep a "wanted" list in the README for languages left open to contributors spec or needs a runtime supplement. - [ ] Comment on merged PR #6 noting the `Function` fix, closing the loop on the thread there. -- [ ] Java README still describes an Oracle JDK manual install — point it at - apt/Temurin and the test.sh instead. diff --git a/languages/j/java/README.md b/languages/j/java/README.md index b6dd14b..78fb212 100644 --- a/languages/j/java/README.md +++ b/languages/j/java/README.md @@ -1,23 +1,22 @@ -# Java 21 Installation Guide +# Java Lambda Core -## Download Java 21 -Download Java 21 from the official Oracle website: -[Java 21 Downloads](https://www.oracle.com/in/java/technologies/downloads/#java21) +This implementation requires a Java Development Kit version 11 or newer. +Java's source-file mode compiles and runs `LambdaCore.java` directly, so no +separate build command or external package is needed. -## Installation Steps -1. Select the appropriate JDK version for your OS (Windows, macOS, or Linux). -2. Download the installer or compressed archive. -3. Follow the installation instructions provided by Oracle. - -## Verify Installation -Run the following command to check the installed Java version: +## Run ```sh -java -version +java LambdaCore.java ``` -# Run Code +## Test + +From this folder, run: ```sh -java LambdaCore.java +sh test.sh ``` + +The repository's root `run-tests.sh` compares the program's output with +`expected-output.txt` on every pull request. diff --git a/languages/j/java/expected-output.txt b/languages/j/java/expected-output.txt new file mode 100644 index 0000000..ff7bfcf --- /dev/null +++ b/languages/j/java/expected-output.txt @@ -0,0 +1,18 @@ +BOOLEAN TRUE +BOOLEAN FALSE +BOOLEAN FALSE +BOOLEAN TRUE +BOOLEAN FALSE +BOOLEAN FALSE +BOOLEAN FALSE +BOOLEAN TRUE +BOOLEAN FALSE +BOOLEAN TRUE +BOOLEAN TRUE +BOOLEAN TRUE +0 +1 +2 +1 +0 +0 diff --git a/languages/j/java/test.sh b/languages/j/java/test.sh index 2e4a986..d4b3415 100644 --- a/languages/j/java/test.sh +++ b/languages/j/java/test.sh @@ -1 +1,7 @@ -java LambdaCore.java +#!/bin/sh +set -eu + +command -v java >/dev/null 2>&1 || exit 42 + +dir=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) +java "$dir/LambdaCore.java" diff --git a/languages/k/kotlin/README.md b/languages/k/kotlin/README.md index 20be34a..0f7c2dd 100644 --- a/languages/k/kotlin/README.md +++ b/languages/k/kotlin/README.md @@ -1,11 +1,24 @@ -# Kotlin instalation -Download Kotlin version 2.1.10 ot above from here https://kotlinlang.org/docs/command-line.html +# Kotlin Lambda Core -# Run code -```shell -# build -kotlinc lambda-core.kt -include-runtime -d lambda-core.jar +This implementation requires the Kotlin command-line compiler and a Java +Development Kit. It is tested with Kotlin 2.4.10 and Java 17 or newer; both are +preinstalled on GitHub's `ubuntu-latest` runner. + +## Build and run -#run +```sh +kotlinc lambda-core.kt -include-runtime -d lambda-core.jar java -jar lambda-core.jar -``` \ No newline at end of file +``` + +## Test + +From this folder, run: + +```sh +sh test.sh +``` + +The test compiles into a temporary directory, runs the resulting jar, and +removes the build artifact afterward. The repository's root `run-tests.sh` +compares the output with `expected-output.txt` on every pull request. diff --git a/languages/k/kotlin/expected-output.txt b/languages/k/kotlin/expected-output.txt new file mode 100644 index 0000000..96a6591 --- /dev/null +++ b/languages/k/kotlin/expected-output.txt @@ -0,0 +1,28 @@ +LOGIC +---------------- +TRUE/FALSE +true +false +NOT +false +true +AND +false +false +false +true +OR +false +true +true +true +CHURCH NUMERALS +--------------- +ZERO/SUCC +0 +1 +2 +PRED +2 +1 +0 diff --git a/languages/k/kotlin/test.sh b/languages/k/kotlin/test.sh new file mode 100644 index 0000000..a2aaf78 --- /dev/null +++ b/languages/k/kotlin/test.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu + +command -v kotlinc >/dev/null 2>&1 || exit 42 +command -v java >/dev/null 2>&1 || exit 42 + +dir=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) +build_dir=$(mktemp -d) +trap 'rm -r "$build_dir"' 0 1 2 15 + +kotlinc "$dir/lambda-core.kt" -include-runtime -d "$build_dir/lambda-core.jar" +java -jar "$build_dir/lambda-core.jar"