Open ivan-pi opened 8 months ago
When the need for a feature can be addressed in portable open-source libraries that are available today (or in a few years), experience shows that that's a much better solution than trying to change the language. A "standard" feature is likely to be an incomplete solution -- you'll want some means to deal with endianness, and the standard language doesn't even provide that today for unformatted I/O despite near-universal CONVERT=
extensions. It won't appear in a standard until 2028 at the earliest, and it won' be widely available until the 2030's. Since the current process does not generate any conformance tests, portability across implementations won't be assured, and since the process doesn't involve prototyping, any ambiguity or contradictions in the feature's description will lurk in the document until implementors try to make sense of it after publication.
If you have a library implementation today, and it's portable and universally available, you already have the best solution. Second-best would be a pilot extension to an open-source Fortran compiler and I/O runtime library.
since the process doesn't involve prototyping
The Fortran standard process must involve prototyping.
Second-best would be a pilot extension to an open-source Fortran compiler and I/O runtime library.
Yes, that has to be a prerequisite for any proposal.
Another idea: if Fortran had a way to hook in user-defined readers/writers and still use the built-in Fortran syntax to open and read from files (see https://github.com/j3-fortran/fortran_proposals/issues/331), then one could define a "Base64Writer" as a user library, and still use the write
syntax.
The hook you propose seems related to Section 2.3.9 of the coroutine proposal: https://j3-fortran.org/doc/year/19/19-169.pdf (I haven't dived into the details yet, just noticed it has a similar purpose)
Popular visualization formats like the VTK XML File Format use Base64 encoding of numerical data as text. This slightly increases the amount of storage, but proves to be more reliable when distributing data via channels that predominantly support text (e.g. the internet). Another example use case would be embedding binary data (e.g. images, other binary assets) in HTML reports generated by a Fortran program.
The idea was suggested here:
As the user "rwmsu" has stated in that thread:
Right now, available libraries for Base64 encoding include: