hiroshinishio / julia

The Julia Programming Language
https://julialang.org/
MIT License
0 stars 0 forks source link

GitAuto: "Inferrable" stdin for use with trimmed programs #8

Open gitauto-for-dev[bot] opened 3 months ago

gitauto-for-dev[bot] commented 3 months ago

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 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

  1. 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.
  2. 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.
  3. Update documentation:

    • Modify relevant documentation files to include information about the new Core.stdin object and provide examples of its usage.
  4. 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.

Test these changes locally

git checkout -b gitauto-wes/issue-#6-330ab2d3-d1a4-47f5-9bc0-c162bbf4f994
git pull origin gitauto-wes/issue-#6-330ab2d3-d1a4-47f5-9bc0-c162bbf4f994