[M3devel] I know, I know...

Mika Nystrom mika at async.caltech.edu
Thu Aug 23 21:51:15 CEST 2012


Well I don't think Jay said that bytes couldn't be unpacked in Modula-3
(you can just use Word for that).

But I think the point was that a compiler back-end might not necessarily
obey your packing instructions?

Here's what I think you should do... it would be super useful, both to
you and other people in the future.  And completely independent of
compilers.

Write a something-or-other that uses m3tk to read your RECORD type
spec, plus pragmas of your own choice (or comments, or auxiliary data
from somewhere) and then generates code using Word.T that can process
byte streams and return the RECORD you declared, in portable Modula-3.
I doubt it's very difficult.  m3tk is cool!

    Mika

=?utf-8?Q?Dragi=C5=A1a_Duri=C4=87?= writes:
>
>--Apple-Mail=_8871A9FB-3130-4B36-8524-F6549A5CEC9E
>Content-Type: multipart/alternative;
>	boundary="Apple-Mail=_2314A877-555E-4BDE-8112-C875A2AE5122"
>
>
>--Apple-Mail=_2314A877-555E-4BDE-8112-C875A2AE5122
>Content-Transfer-Encoding: quoted-printable
>Content-Type: text/plain;
>	charset=windows-1250
>
>I have a friend, working for large software company and he just recently =
>ported some message router from SPARC to Linux/Intel=85 Lots of "network =
>order" data, same as with my current projects. Network, communication in =
>general, network order is everywhere.
>
>Insisting on some god-given data ordering is a bit=85 What is nice word =
>here? :) Outlandish? Outimeish?
>
>This is not first time I started discussion like this here. Every single =
>time Jay explains to me how Modula-3 cannot handle it. I am handling it, =
>as I have shown in my example, with Modula-3 code. With a bit of effort =
>I can make it almost-transparent (subfolder/platform) over various =
>platforms. Of course, as I am developing a full product (not software to =
>be run on arbitrary platform) I don't have to worry about too many =
>platforms. One is enough here, but I still think Modula-3 can benefit, =
>and a lot, if it supported explicit byte/bit ordering/packing/aligning =
>pragmas.
>
>Also, unlike GCC, pointer alignment in Modula-3 is 64bit on x86_64. It =
>is 32bit in GCC, and x86_64 is totally happy with it. Wr have 64bit so =
>we must write piece of software in C to be what? Compatible with API's =
>all systems are compatible with without any hassle.=20
>
>TIA
>--
>Divided by a common language
>
>Dragi=9Aa Duri=E6
>dragisha at m3w.org
>



More information about the M3devel mailing list