The feature is to introduce a Core.stdin object that allows trimmed programs to accept data from standard input (stdin), similar to how Core.stdout and Core.stderr are used for output.
Why we need the feature
Currently, trimmed programs lack the ability to read from stdin, which limits their functionality and usability in scenarios where input data needs to be processed. By providing a Core.stdin, we enable these programs to handle input data, making them more versatile and useful in various applications.
How to implement and why
Define Core.stdin:
Introduce a new Core.stdin object within the core library, similar to Core.stdout and Core.stderr.
This object should be an instance of an IO type that reads from the standard input stream.
Modify the core library:
Update the core library files, likely within the src directory, to include the definition and initialization of Core.stdin.
Ensure that Core.stdin is properly initialized during the program startup to point to the standard input stream.
Update documentation:
Modify relevant documentation files to include information about the new Core.stdin object and provide examples of its usage.
Testing:
Add test cases in the test directory to verify that Core.stdin correctly reads input data and behaves as expected in various scenarios.
About backward compatibility
Introducing Core.stdin should not affect backward compatibility as it is an addition rather than a modification of existing functionality. Existing programs that do not use Core.stdin will continue to function as before. However, it is important to ensure that the introduction of this feature does not inadvertently affect other parts of the system.
Original issue: #6
What is the feature
The feature is to introduce a
Core.stdin
object that allows trimmed programs to accept data from standard input (stdin), similar to howCore.stdout
andCore.stderr
are used for output.Why we need the feature
Currently, trimmed programs lack the ability to read from stdin, which limits their functionality and usability in scenarios where input data needs to be processed. By providing a
Core.stdin
, we enable these programs to handle input data, making them more versatile and useful in various applications.How to implement and why
Define
Core.stdin
:Core.stdin
object within the core library, similar toCore.stdout
andCore.stderr
.IO
type that reads from the standard input stream.Modify the core library:
src
directory, to include the definition and initialization ofCore.stdin
.Core.stdin
is properly initialized during the program startup to point to the standard input stream.Update documentation:
Core.stdin
object and provide examples of its usage.Testing:
test
directory to verify thatCore.stdin
correctly reads input data and behaves as expected in various scenarios.About backward compatibility
Introducing
Core.stdin
should not affect backward compatibility as it is an addition rather than a modification of existing functionality. Existing programs that do not useCore.stdin
will continue to function as before. However, it is important to ensure that the introduction of this feature does not inadvertently affect other parts of the system.Test these changes locally