Transput RFC - early version based on POSIX
chris hermansen
clhermansen@gmail.com
Thu May 21 21:32:39 GMT 2026
Thanks for the advice, Pietro,
On Thu, May 21, 2026 at 2:10 PM Pietro Monteiro <
pietro.gcc@sociotechnical.xyz> wrote:
> On Thu, May 21, 2026, at 1:39 PM, chris hermansen wrote:
> > Good morning everyone,
> >
> > Jose, thanks for the comments you provided. One more question below:
> > On Thu, May 21, 2026 at 2:16 AM Jose E. Marchesi <jemarch@gnu.org>
> wrote:
> >>
> >> Hello Chris.
> >>
> >> > Good afternoon everyone,
> >> >
> >> > After monkeying around far too long trying to pull out bits of van
> >> > Vliet's transput so I could implement it piece by piece, I have given
> up on
> >> > that approach (way too many dependencies between things in there) and
> am
> >> > gritting my teeth and starting back at the beginning.
> >> >
> >> > To facilitate getting as much as possible working, I'd like to put van
> >> > Vliet's code and ideas on top of Algol 68 POSIX for now, forgetting
> about
> >> > reading and writing binary for the first go-around.
> >> >
> >> > Does that make sense?
> >>
> >> To me, it makes 100% sense. In my experience, once you get something
> >> working it becomes easier to reason about it. There is a lot to learn
> >> in the process too.
> >>
> >> > Assuming it's not too crazy an idea, the first bump on the road I've
> >> > encountered is dealing with system file status. As far as I can
> tell, the
> >> > only pathway in Algol 68 POSIX for this type of thing is to call
> fopen() or
> >> > fcreate() with various flags as documented here:
> >> >
> >> > https://gcc.gnu.org/onlinedocs/ga68/POSIX-files.html
> >> >
> >> > and then, based on what works and what doesn't, I can resolve many of
> van
> >> > Vliet's "possibles":
> >> > - get_possible(f) { true if fopen(filename, bits file o rdonly)
> returns ≥ 0
> >> > }
> >> > - put_possible(f) { true if fopen(filename, bits file o wronly)
> returns ≥ 0
> >> > }
> >> > - bin_possible(f) { always false for now }
> >> > - compressible(f) { always true - indicates variable length lines }
> >> > - reset_possible(f) { always true for now }
> >> > - set_possible(f) { always true for now because lseek() }
> >> > - backspace_possible(f) { always true for now because lseek() }
> >> > - reidf_possible(f) { always false for now because Algol 68 transput
> >> > doesn't provide rename() }
> >> >
> >> > Does this sound like an acceptable start?
> >>
> >> I think it would be better to call to the system's fstat, a wrapper for
> >> which needs to be added to the POSIX prelude.
> >
> > Are you suggesting here that (gasp) I add this in and create a patch?
> >
> > Am I too old a dog to learn a new trick?
>
> Since Jose added support for writing libga68 preludes in Algol 68 this
> became much easier.
> If it's an easy mapping from C you just need to add it to
> libga68/posix.a68.
> If not, you need a add a C wrapper in libga68/ga68-posix.c and then in
> libga68/posix.a68.
>
> Don't forget to add docs in gcc/algol68/ga68.texi and tests in
> gcc/testsuite/algol68/compile
> or gcc/testsuite/algol68/execute
Two rookie questions:
1. I would like to first test out a call or wrapper to fstat in a small
demo program; does that seem reasonable?
2. Thinking of how to proceed with looking at the existing POSIX source
code and proposing a patch, should I start with the regular GCC / GA68
current branch, or somewhere else (e.g. the forge version)?
--
Chris Hermansen · clhermansen "at" gmail "dot" com
C'est ma façon de parler.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://gcc.gnu.org/pipermail/algol68/attachments/20260521/d275e25a/attachment-0001.htm>
More information about the Algol68
mailing list