Bytes, chars, ints, etc (gnu algol 68, C, ...)
chris hermansen
clhermansen@gmail.com
Sat Jan 17 03:51:29 GMT 2026
Jose and everyone,
On Fri, Jan 16, 2026 at 4:04 PM Jose E. Marchesi <jemarch@gnu.org> wrote:
>
> > James and everyone,
> >
> > On Fri, Jan 16, 2026 at 12:43 PM jpl <jpl.algol68@gmail.com> wrote:
> >
> >> Thanks to all for the responses. There is high educational value to
> >> them and have learned quite much,
> >>
> >
> > 100% in agreement there - lots of self-learning, too. Thanks to all!
> >
> >>
> >> I started this thread due to some concern if we would be able to know
> >> the exact byte sizes of our variables.
> >>
> >> In turn this relates to binary transput of these variables. For
> >> example, writing binary output files that would allow decoding by byte
> >> counting. Actually, I do not know if Algol68 has a way to create
> >> "byte-packed records" (aka structs), but that connects a bit too.
> >>
> >
> > I seem to be edging closer to writing some transput code... assuming I
> get
> > to that point, my goal is to more or less follow what the Java folks do
> > with binary transput, which is to write and read binary values in a
> > canonical fashion, so that they can be written on a bigendian machine and
> > read on a littleendian machine, and vice versa.
> >
> > I was also thinking that, while debugging, it could be useful to write
> and
> > read binary as JSON or hexadecimal strings.
>
> Please I beg you for the love of what is more precious, no JSON or XML.
>
> What about Motorola S-Record? :)
>
> There is also a nice GNU poke "pickle" to edit srec data, which should
> help greatly for debugging..
>
>
I would only ever do this to myself while iterating toward the thing I'm
going to have to look at with od / xd. I promise to not inflict any of
that stuff on anyone else!
Really I'm just imagining a tag and a value that I can read to make sure
I'm getting it right, then moving to non-tagged binary. E.g.
INT#456597a3;REAL#f4912324;
(besides if I do it as text I can use the existing POSIX char stuff while
I'm waiting for the binary write / read routines, in order to get the rest
of the stack operational).
Happy weekend everyone!
--
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/20260116/89a92924/attachment.htm>
More information about the Algol68
mailing list