print / printErr

Elide does not currently install shell-style print / printErr global functions for guest scripts. The GraalJS js.shell option that would install them is not set, so print and printErr are not present on globalThis in a normal elide run — use console.log / console.error instead. The behavior described below is the intended d8 / SpiderMonkey / GraalJS shell semantics for if/when these globals are enabled.
GlobalStreamDescription
print(...args)stdoutWrites the arguments, joined by a single space, followed by one newline.
printErr(...args)stderrSame formatting as print, but to the standard error stream.
Each argument is coerced to a string with the standard JavaScript rules, then joined with a single ASCII space (" "). A single trailing newline ("\n") is appended.
js
print("a", 1, true); // stdout: "a 1 true\n"
print(); // stdout: "\n"
printErr("warn:", 42); // stderr: "warn: 42\n"

Difference from console

print is not an alias for console.log. console.log applies Node-style formatting (format specifiers, object inspection, color) and is intended for diagnostic output; print performs only the simple space-join shown above and writes raw text. Use console for structured application logging and print for plain stdout writes.

Notes

  • These globals are not present in Node.js; they are a shell convention. Guest code that defines its own print shadows the global as usual.
  • The functions write to the realm's configured output and error streams — the same streams used by console.log and console.error.