The whole Channel thing

Jose E. Marchesi jemarch@gnu.org
Sun Feb 8 00:13:18 GMT 2026


For me, I found the notion "a channel represents a physical device"
confusing until I realized it should not be understood as "a physical
device is represented by a single channel".

I look at channels as ways to acccess books in physical devices, or
"modes" of access.

For example,

   stand_in_channel
   stand_back_channel
   stand_out_channel

are all channels giving access to the same physical device: the
_filestore_.  In POSIX systems that is the hierarchy of filesystem
rooted at / and covers books like actual files stored in a filesystem on
some partition, character devices, /proc, etc.

Using stand_in_channel, stand_back_channel and stand_out_channel
determines then not only the physical device (the filestore in all three
cases) but the "mode" of accessing the desired book: in read-only mode,
in read-write mode, in write-only mode.

The idfs used in all three channels are filestore names, i.e. file paths
such as /foo/bar, /dev/null or `foo.o'.

Then, you can have other channels that represent othe physical devices
that are not the filestore.  The collection in QAD is very interesting:

stand_env_channel provides access to the environment of the runnign
process, which is _not_ the filestore.  The represented physical device
is the auxv array passed to _start by the kernel, and having it as a
channel allows to transput on the auxv array entreis (these are the
books) using the same interface than to files in the filestore.  The
idfs in this case are the names of the enviroment variables, PATH, HOME,
etc.

A www_channel could represent the WWW.  The books would be the URIs you
use in http get and post operations.

etc etc

I think it is a nice abstraction.  Transput means interchanging data
with all sort of "external" devices, and not everythig is the filestore,
not even in Unix.


> Good evening once again,
>
> I have this sense of a few things emerging from the murk, but I'm not sure
> I'm fully appreciating them. mode Channel is one of those things.
>
> I am beginning to think that instances of mode Channel are entirely and
> completely defined in the standard prelude and there is no intent to allow
> the programmer to define more channels on her own.  I base this opinion on
> a few things:
>
> 1. Mountbatten's algol68toc translator defines a whole slew of Channel
> instances, including the keyboard, the environment variables, the
> arguments, and others.
>
> 2. Our dear mentor McGettrick begins his discourse on Channels with the
> following:
>
> Channels correspond to the physical devices (i.e. peripherals) attached to
> a computer and their precise form will depend on the particular ALGOL 68
> system.
>
>
> 3. Try as I might, I have found nowhere an example of a declaration of a
> Channel (nor a ref Channel) outside the standard prelude.
>
> So with that all in mind, I don't see a whole lot of point to defining any
> Channel instances other than:
>
> standin channel
> standout channel
> standback channel
> standerr channel
>
> for a "first attempt" at creating a working transput library.
>
> Does anyone object to that approach?  If so, an alternative would be to
> look at Mountbatten's list of Channel instances to pick out what might be
> necessary (again for a first attempt).


More information about the Algol68 mailing list