apps/kv (kaledis)
In-Memory Key-Value Store & Redis Daemon
A high-performance in-memory key-value database engine and TCP network daemon for Kale. Implements Redis RESP serialization (strings, integers, arrays, errors), hash map storage with collision handling, slot compaction, and CLI command dispatching.


Sub-Millisecond Multi-Cursor Editing
Unlike line-array or gap-buffer architectures, the Kale Piece Table holds an immutable original file buffer coupled with an append-only edit buffer. Loading a 100MB file takes under 1ms because no memory copying occurs.
import "apps/kv/store.kl" as kv;
import "apps/kv/daemon.kl" as daemon;
fn main() -> int32 {
let store: kv.KvStore* = kv.store_new(256);
kv.store_set(store, "system_name", "Kale Ecosystem");
kv.store_set(store, "version", "v0.2.0");
let val: string = kv.store_get(store, "system_name");
print(val);
kv.store_free(store);
return 0;
}Deterministic command-line invocations to build, link native dynamic dependencies, and run automated regression tests:
kale build apps/kv/main.kl -o bin/kaledis.exe -lws2_32./bin/kaledis.exe --port 6379redis-cli -p 6379 PINGGPG Key 1B917D4779A6102E • Continuous integration with automated symbol verification.
Full wire-level parser and serializer for Redis Simple Strings, Bulk Strings, Integers, and Arrays.
Powered by libs/net/tcp for concurrent network I/O and zero-allocation query handling.
Deterministic bucket hashing with dynamic capacity tracking, slot reuse, and key enumeration.