A simple keyword-based chatbot with implementations in both C and Zig.
See BENCHMARK.md for detailed build metrics.
| Metric | C | Zig | Difference |
|---|---|---|---|
| Build Time | 93ms | 710ms | Zig is 7.63x slower |
| Executable Size | 33K | 1.3M | Zig is 39x larger |
Run build benchmark:
./benchmark.shBoth versions produce identical output. Runtime measurements with test inputs:
| Metric | C | Zig | Difference |
|---|---|---|---|
| Execution Time | 286ms | 526ms | C is 1.83x faster |
Run runtime benchmark:
./run_benchmarks.shcd c
make
./chatSee c/Makefile for more details.
cd zig
zig build-exe src/main.zig -femit-bin=zig-out/bin/chat
./zig-out/bin/chatOr use the Zig build system:
cd zig
zig build runSee zig/README.md for more details.
No automated tests (original implementation).
cd zig
zig test src/chatbot.zigOr:
cd zig
zig build test