✗
Failing This test is currently failing.
Failed: js-runtime
Failure Output
🎯 Compiler coordination: Passes: 17 (flow-based: frontend, analysis, emission) Code
// Cross-target stdlib parity: the idiomatic hello-world through std.io must
// produce identical output whether emitted to Zig or JS. `println` resolves
// across the module boundary (std.io is imported, module-qualified), and the
// JS target uses println's |js variant (console.log) while Zig uses |zig
// (std.debug.print). Same source, same output, two backends.
~import std/io
~std/io:print("Hello, world!\n")
Actual · Zig
✓ passHello, world!
Actual · JavaScript
✗ js-runtime/Users/larsde/src/koru/tests/regression/600_STDLIB/630_IO/630_001_io_println_cross_target/output_emitted.js:3
(struct { fn __kw(comptime __f: []const u8, __a: anytype) void { var __kb: [65536]u8 = undefined; const __ks = @import("std").fmt.bufPrint(&__kb, __f, __a) catch __kb[0..0]; @import("std").mem.doNotOptimizeAway(@import("std").posix.write(1, __ks) catch @as(usize, 0)); } }).__kw("Hello, world!\n", .{});
^
SyntaxError: Unexpected token '{'
at wrapSafe (node:internal/modules/cjs/loader:1762:18)
at Module._compile (node:internal/modules/cjs/loader:1803:20)
at Module._extensions..js (node:internal/modules/cjs/loader:1969:10)
at Module.load (node:internal/modules/cjs/loader:1552:32)
at Module._load (node:internal/modules/cjs/loader:1354:12)
at wrapModuleLoad (node:internal/modules/cjs/loader:255:19)
at Module.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:154:5)
at node:internal/main/run_main_module:33:47
Node.js v25.9.0
Expected output
✓ Zig✗ JavaScriptHello, world!
Emitted JavaScript source
const main_module = {
flow0() {
(struct { fn __kw(comptime __f: []const u8, __a: anytype) void { var __kb: [65536]u8 = undefined; const __ks = @import("std").fmt.bufPrint(&__kb, __f, __a) catch __kb[0..0]; @import("std").mem.doNotOptimizeAway(@import("std").posix.write(1, __ks) catch @as(usize, 0)); } }).__kw("Hello, world!\n", .{});
},
};
main_module.flow0();
Flows
flow ~print click a branch to expand · @labels scroll to their anchor
print (expr: "Hello, world!\n")
Test Configuration
MUST_RUN