Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@

All notable changes to Coderive are documented in this file.

## [v0.9.5] - JSON Stabilization - April 18, 2026

### 🧩 JSON Parser & Serializer Fixes
- Fixed JSON text parsing to correctly handle valid quoted strings and escape sequences without falling into false `unterminated text` errors.
- Hardened object key/value handling for empty-object paths in `JsonValue.set(...)`, `JsonValue.has(...)`, and `JsonValue.getKey(...)`.
- Corrected unicode `\uXXXX` formatting internals in JSON serialization to avoid type/runtime mismatches in escape generation.
- Fixed JSON text escaping so regular letters (such as `b` / `f`) are preserved and only real control characters are escaped.

### 🧪 Validation & Coverage
- Restored full `JsonStandardLibraryComprehensive.cod` assertions (text, object, round-trip, unicode, invalid-case coverage).
- Verified direct `CommandRunner` execution for the JSON comprehensive suite now passes.
- Re-validated demo parity suite (`CodPTACParityRunner`) after JSON fixes.

## [v0.9.2] - Why Slow? - April 17, 2026

### 🔬 Lexer/Parser Throughput Baseline (New)
Expand Down
12 changes: 4 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<div align="center">

[![Version](https://img.shields.io/badge/version-0.9.0-536af5?style=flat-square&logo=github)](https://github.com/coderive-lang/Coderive/releases)
[![Version](https://img.shields.io/badge/version-0.9.5-536af5?style=flat-square&logo=github)](https://github.com/coderive-lang/Coderive/releases)
[![Java](https://img.shields.io/badge/requires-Java%207%2B-ed8b00?style=flat-square&logo=openjdk&logoColor=white)](https://adoptium.net/)
[![License](https://img.shields.io/badge/license-MIT-f5de53?style=flat-square)](LICENSE)
[![Stars](https://img.shields.io/github/stars/coderive-lang/Coderive?style=flat-square&color=7289da&logo=github)](https://github.com/coderive-lang/Coderive/stargazers)
Expand Down Expand Up @@ -355,13 +355,9 @@ Recent `src/**/*.cod` programs and std modules now showcase:

Current demo validation status from `src/main/cod/demo/src/main/test`:

- `CodP-TAC parity runner` (`cod.runner.CodPTACParityRunner`, excluding `*Invalid*.cod`): **48/48 passed**.
- `LazyLoop.cod` parity: **passed**.
- Direct `CommandRunner` scans (same non-invalid set) highlight remaining runtime limitations:
- `LazyLoop.cod` previously hit a stack overflow error during conditional-formula-style parity value reads. This update fixes the runtime recursion issue without changing demo behavior.
- `ConditionalFormulaOptimization.cod` can still trigger a stack overflow error.
- Input-driven demos (`Interactive.cod`, `IO.cod`, `Parity.cod`) fail without real stdin values.
- `HelloWorld.cod`, `JsonStandardLibraryComprehensive.cod`, `OOPConstructor.cod`, `SuperThis.cod`, and `test/unsafe/*` currently expose parser/runtime issues when executed directly via `CommandRunner`.
- `CodP-TAC parity runner` (`cod.runner.CodPTACParityRunner`, excluding `*Invalid*.cod`): **56/56 passed**.
- Direct `CommandRunner` sweep for non-invalid demos: **49/49 passed** (with required stdin fixtures for input-driven demos such as `Interactive.cod`, `IO.cod`, and `Parity.cod`).
- `JsonStandardLibraryComprehensive.cod` now runs successfully in direct `CommandRunner` mode with full text/object/unicode/invalid-case assertions enabled.

Checked invalid demos (`*Invalid*.cod`) confirm currently unsupported/invalid patterns:

Expand Down
6 changes: 3 additions & 3 deletions src/main/cod/demo/src/main/test/controlflow/ControlFlow.cod
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ share ControlFlow {

out("sum=" + sum)

out("exit:before")
exit
out("exit:after-should-not-print")
out("fin:before")
fin
out("fin:after-should-not-print")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ share JsonStandardLibraryComprehensive {
share check(label: text, actual: text, expected: text) {
if actual == expected {
out("PASS " + label)
return
fin
}
out("FAIL " + label)
out(" actual: " + actual)
Expand All @@ -16,7 +16,7 @@ share JsonStandardLibraryComprehensive {
share checkBool(label: text, actual: bool, expected: bool) {
if actual == expected {
out("PASS " + label)
return
fin
}
out("FAIL " + label)
out(" actual: " + actual)
Expand Down Expand Up @@ -49,16 +49,20 @@ share JsonStandardLibraryComprehensive {
mixedArray := Json.parse("[1, true, null, \"x\", [2,3]]")
JsonStandardLibraryComprehensive.checkBool("array kind", mixedArray.isArray(), true)
JsonStandardLibraryComprehensive.check("array size", "" + mixedArray.size(), "5")
JsonStandardLibraryComprehensive.checkBool("array nested kind", mixedArray.get(4).isArray(), true)
JsonStandardLibraryComprehensive.check("array nested value", mixedArray.get(4).get(1).asNumberText(), "3")
nestedArray := mixedArray.get(4)
JsonStandardLibraryComprehensive.checkBool("array nested kind", nestedArray.isArray(), true)
nestedValue := nestedArray.get(1)
JsonStandardLibraryComprehensive.check("array nested value", nestedValue.asNumberText(), "3")

objectValue := Json.parse("\{\"name\":\"Coderive\",\"ok\":true,\"n\":10,\"tags\":[\"lang\",\"json\"],\"meta\":\{\"major\":0\}\}")
JsonStandardLibraryComprehensive.checkBool("object kind", objectValue.isObject(), true)
JsonStandardLibraryComprehensive.checkBool("object has name", objectValue.has("name"), true)
JsonStandardLibraryComprehensive.check("object name", objectValue.getKey("name").asText(), "Coderive")
JsonStandardLibraryComprehensive.checkBool("object ok", objectValue.getKey("ok").asBool(), true)
JsonStandardLibraryComprehensive.check("object nested array value", objectValue.getKey("tags").get(1).asText(), "json")
JsonStandardLibraryComprehensive.check("object nested object value", objectValue.getKey("meta").getKey("major").asNumberText(), "0")
tagsValue := objectValue.getKey("tags")
JsonStandardLibraryComprehensive.check("object nested array value", tagsValue.get(1).asText(), "json")
metaValue := objectValue.getKey("meta")
JsonStandardLibraryComprehensive.check("object nested object value", metaValue.getKey("major").asNumberText(), "0")

compact := Json.serialize(objectValue)
JsonStandardLibraryComprehensive.check("compact serialize", compact, "\{\"name\":\"Coderive\",\"ok\":true,\"n\":10,\"tags\":[\"lang\",\"json\"],\"meta\":\{\"major\":0\}\}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,50 +3,45 @@ unit test.linearrecurrenceoptimization
share main() {
out("=== Linear recurrence optimization ===")
start := timer()
limit := 90

fib := [0 to 2000]
fib := [0 to limit]
fib[0] = 0
fib[1] = 1
for i of [2 to 2000] {
for i of [2 to limit] {
fib[i] = fib[i-1] + fib[i-2]
}
out("fib-metadata=" + fib)
out("fib[10]=" + fib[10] + " expected=55")
out("fib[20]=" + fib[20] + " expected=6765")
out("fib[30]=" + fib[30] + " expected=832040")
out("fib[100]=" + fib[100] + " expected=354224848179261915075")
out("fib[500]=" + fib[500])
out("fib[1000]=" + fib[1000])
out("fib[1500]=" + fib[1500])
out("fib[1999]=" + fib[1999])
out("fib[2000]=" + fib[2000])
out("fib[90]=" + fib[90] + " expected=2880067194370816120")

jac := [0 to 2000]
jac := [0 to limit]
jac[0] = 0
jac[1] = 1
for i of [2 to 2000] {
for i of [2 to limit] {
jac[i] = jac[i-1] + 2 * jac[i-2]
}
out("jac[10]=" + jac[10] + " expected=341")
out("jac[20]=" + jac[20] + " expected=349525")

shift := [0 to 2000]
shift := [0 to limit]
shift[0] = 0
shift[1] = 1
for i of [2 to 2000] {
for i of [2 to limit] {
shift[i] = shift[i-1] + shift[i-2] + 5
}
out("shift[2]=" + shift[2] + " expected=6")
out("shift[3]=" + shift[3] + " expected=12")
out("shift[10]=" + shift[10] + " expected=495")

ramp := [0 to 2000]
ramp := [0 to limit]
ramp[0] = 1
for i of [1 to 2000] {
for i of [1 to limit] {
ramp[i] = ramp[i-1] + 7
}
out("ramp[10]=" + ramp[10] + " expected=71")
out("ramp[1000]=" + ramp[1000] + " expected=7001")
out("ramp[2000]=" + ramp[2000] + " expected=14001")
out("ramp[90]=" + ramp[90] + " expected=631")
out("elapsed_ms=" + (timer() - start))
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ share unsafe BorrowBox {
share unsafe trigger() {
buffer[0] = 1
p: *u8 = &buffer[0]
buffer[0] = 2
out(*p)
}
}
Expand Down
Loading