Replies: 2 comments 5 replies
-
It's up to you based on how you intend to use the system. stdout and stderr are artifacts of Unix history, where shell commands were run in pipelines where downstream components were not prepared to deal with "unusual" error output. That model does not match conventional modern usage very much, especially as it comes to Forth, which is rarely used to implement standalone Posix commands that appear in pipelines. The disconnect between that historical design approach and modern usage is so great that the question is hard to answer in any definitive way. My cforth system, when hosted, uses stderr for crash-level messages where Forth can't start properly or otherwise blows up, but everything that comes from Forth code goes to stdout. |
Beta Was this translation helpful? Give feedback.
-
I use Forth for command line utilities. Sometimes my program consumes text from the standard input, transforms it, and produces text to the standard output. So it's preferred that a Forth system I use for this supports some kind of batch mode, and outputs errors not to stdout, but to stderr (because stdout can be redirected to a file, and its contents must be in some specific format). Also, in batch mode, a Forth system itself should not show output any information at startup, such as a boot message or banner. |
Beta Was this translation helpful? Give feedback.
-
Given Forth's history, there is typically only one output stream for Forth, but for a hosted Forth on a POSIX system, there are typically two output streams available:
stdout
andstderr
.For a hosted Forth should error messages be written to:
Beta Was this translation helpful? Give feedback.
All reactions