Re: [Freedos-devel] MAD compiler for DOS?

2024-01-30 Thread Ralf Quint via Freedos-devel

On 1/30/2024 3:43 PM, Jim Hall via Freedos-devel wrote:

[..]

Jim Hall wrote:
[..]

I'm thinking about writing a book about the early history of document
preparation systems, and RUNOFF seemed a good place to start. I want
to faithfully recreate the MAD code in another programming language -
not an automated translation like ESR's translator would do, but an

[..]

Ralf Quint wrote:

You seem to be as predisposed as me in always finding new deep dark
rabbit holes to decent into 

It is definitely a rabbit hole. :-)

At first it was just curiosity of "what does this code *do*?" and then
it turned into "I wonder if I can rewrite this in something that's
easier to understand?"

But I have a particular interest in the early history of document
preparation systems, including troff (and nroff before that (and roff
before that (and RUNOFF before that))). So this rabbit hole was kind
of a tempting one to step into.



Well, the Wikipedia page lists at least two MAD manuals (the compiler,
not the magazine), I might just download these and have a look at this
late tonight, Tuesdays I can't get to sleep until 2am anyway and always
watching movies on YouTube gets boring after a while... ;-)

That's where I found the MAD manual too. It's interesting reading.
Especially so because they didn't write it for someone who had never
seen MAD (programming language before). In the part about the
"for-next" loop, rather than demonstrate it by saying "let's write a
simple program that counts from 1 to 10" they demonstrated it by
writing an algorithm to solve a polynomial. That's not a simple way to
show something. :-P

It takes a little skill to explain something, it takes great skill to
explain it *simply* to someone who's never seen it before.


Well, I skimmed over the manual and realized that I ran into this 
before, though that might be 2-3 decades ago, when I saw the conditional 
WHENEVER statement. I remember some not so serious discussions (might 
have been on a BBS) about extending the language to include the WHATEVER 
and MAYBE statements... 



Ralf 



___
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel


Re: [Freedos-devel] MAD compiler for DOS?

2024-01-30 Thread Jim Hall via Freedos-devel
Jim Hall wrote:
> > I am working on an academic project that requires understanding the MAD
> > programming language so I can pick apart (and faithfully recreate) an old
> > MAD program. That's the Michigan Algorithm Decoder, from 1959 and the early
> > 1960s.

tom ehlert wrote:
> it would make this much more interesting if you would describe why this 1960s 
> program
> does something interesting toda.

I have an interest in document preparation systems, especially the
early history of document preparation. I just find them fascinating -
probably because I wrote a lot of documents at university using nroff
and LaTeX .. but also because I earned my MS in technical writing and
I teach a few university courses on technical writing, including one
on "writing with digital technologies." So this program (Saltzer's
RUNOFF) is in my niche as an academic, and I want to write a book for
others in that niche.

I admit this is a very academic exercise. This is not going to be on
the New York Times "Best Sellers" list. If anyone sees it, it will
probably just be others in my corner of technical writing. And I'm
okay with that. :-)


Jim Hall wrote:
> > MAD is similar to original FORTRAN,

tom ehlert wrote:
> if wikipedia is right, NOPE.
> according to wikipedia, it's 'inspired' by ALGOL60. and that is not even 
> remotely close
> to FORTRAN.
>

Well, I knew MAD was originally derived from ALGOL60 but ended up in a
completely different place. I should have specified that I don't know
ALGOL60 .. but I do know FORTRAN77 (unfortunately). And I'm seeing
similar things in MAD (like boolean comparisons) to how old-style
FORTRAN did things. That's probably because FORTRAN and ALGOL60 were
just similar in that way. Only so many ways to add instructions when
they're punched on a card, for example.


___
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel


Re: [Freedos-devel] MAD compiler for DOS?

2024-01-30 Thread Jim Hall via Freedos-devel
[..]

Jim Hall wrote:
[..]
> > I'm thinking about writing a book about the early history of document
> > preparation systems, and RUNOFF seemed a good place to start. I want
> > to faithfully recreate the MAD code in another programming language -
> > not an automated translation like ESR's translator would do, but an
[..]

Ralf Quint wrote:
> You seem to be as predisposed as me in always finding new deep dark
> rabbit holes to decent into 

It is definitely a rabbit hole. :-)

At first it was just curiosity of "what does this code *do*?" and then
it turned into "I wonder if I can rewrite this in something that's
easier to understand?"

But I have a particular interest in the early history of document
preparation systems, including troff (and nroff before that (and roff
before that (and RUNOFF before that))). So this rabbit hole was kind
of a tempting one to step into.


> Well, the Wikipedia page lists at least two MAD manuals (the compiler,
> not the magazine), I might just download these and have a look at this
> late tonight, Tuesdays I can't get to sleep until 2am anyway and always
> watching movies on YouTube gets boring after a while... ;-)

That's where I found the MAD manual too. It's interesting reading.
Especially so because they didn't write it for someone who had never
seen MAD (programming language before). In the part about the
"for-next" loop, rather than demonstrate it by saying "let's write a
simple program that counts from 1 to 10" they demonstrated it by
writing an algorithm to solve a polynomial. That's not a simple way to
show something. :-P

It takes a little skill to explain something, it takes great skill to
explain it *simply* to someone who's never seen it before.


Jim


___
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel


Re: [Freedos-devel] MAD compiler for DOS?

2024-01-30 Thread Ralf Quint via Freedos-devel

On 1/30/2024 2:14 PM, Danilo Pecher wrote:

I'm having real problems to read about MAD code written with FAP
subroutines with a straight face. I'm such a child...


Blame Alfred 




___
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel


Re: [Freedos-devel] MAD compiler for DOS?

2024-01-30 Thread tom ehlert via Freedos-devel
> I am working on an academic project that requires understanding the MAD
> programming language so I can pick apart (and faithfully recreate) an old
> MAD program. That's the Michigan Algorithm Decoder, from 1959 and the early
> 1960s.

it would make this much more interesting if you would describe why this 1960s 
program
does something interesting toda.



> MAD is similar to original FORTRAN,
if wikipedia is right, NOPE.
according to wikipedia, it's 'inspired' by ALGOL60. and that is not even 
remotely close
to FORTRAN.
 
 

>  but there are some things that are just
> weird. So I thought if I had a MAD compiler, I could try writing a few
> simple programs to make sure I understand what is going on.
actually a good idea.

> This seems like something that might have been ported to DOS at some point
> in the 1980s. At least, I thought that might be a good place to look.

> Does anyone know of a MAD compiler for DOS?
according to wikipedia: unlikely.

tom



___
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel


Re: [Freedos-devel] MAD compiler for DOS?

2024-01-30 Thread Danilo Pecher via Freedos-devel
I'm having real problems to read about MAD code written with FAP
subroutines with a straight face. I'm such a child...

On Tue, 30 Jan 2024 at 23:00, Ralf Quint via Freedos-devel
 wrote:
>
> On 1/30/2024 1:37 PM, Jim Hall via Freedos-devel wrote:
> > Jim Hall wrote:
> >>> On Mon, Jan 29, 2024 at 8:07 PM Jim Hall  wrote:
>  I am working on an academic project that requires understanding the
>  MAD programming language so I can pick apart (and faithfully recreate)
>  an old MAD program. That's the Michigan Algorithm Decoder, from 1959
>  and the early 1960s.
>  [..]
>  Does anyone know of a MAD compiler for DOS?
> >
> > Ralf Quint wrote:
> >> Up to your email, I haven't even heard of a MAD compiler. Only the
> >> magazine... 
> >> (and interesting seeing that mentioned in the Wikipedia article LOL)
> >
> > Yes, I hadn't heard of it either until a few months ago when I started
> > researching the RUNOFF source code. It's written about half in MAD and
> > about half in FAP (FORTRAN Assembly Programming). The RUNOFF program
> > is written in MAD with some support functions in FAP.
> >
> > I'm thinking about writing a book about the early history of document
> > preparation systems, and RUNOFF seemed a good place to start. I want
> > to faithfully recreate the MAD code in another programming language -
> > not an automated translation like ESR's translator would do, but an
> > understandable recreation by a human who understands what the original
> > code is doing and recreates it in a sensible way in another
> > programming language. Might do it in C or BASIC. BASIC might be
> > easier, since I'm seeing some similarities between MAD and BASIC. But
> > I'd prefer to do it in C.
> You seem to be as predisposed as me in always finding new deep dark
> rabbit holes to decent into 
> > But step #1 is to understand what's going on in the code. MAD is
> > mostly readable, but the for-next loop equivalent is a little weird to
> > me. For example, to loop from 1 to 10 (inclusive) in C, you'd do this:
> >
> > for (i = 1; i <= 10; i++) {
> > ...
> > }
> >
> >
> > Just to compare: in FORTRAN77, it's like "DO label var = start, stop, step":
> >
> > DO 10 I = 1, 10, 1
> >   ...
> > 10 CONTINUE
> >
> >
> > But in MAD, I *think* it's like "THROUGH label, FOR var = start, step,
> > failcondition":
> >
> > THROUGH LOOP, FOR I = 1, 1, I .GT. 10
> >   ...
> > LOOP   CONTINUE
> >
> >
> > And from what I can see, I think "failcondition" gets tested at the
> > end of each iteration, so it's more like this weird 'while'
> > construction in C:
> >
> >i = 1;
> >do {
> > ...
> >  i++;
> >} while ( !(i>10) );
> >
> >
> >
> > That's why I wanted to write some sample code in a real MAD compiler,
> > to see if I'm correctly understanding that (and a few other odd things
> > in the language).
> Well, the Wikipedia page lists at least two MAD manuals (the compiler,
> not the magazine), I might just download these and have a look at this
> late tonight, Tuesdays I can't get to sleep until 2am anyway and always
> watching movies on YouTube gets boring after a while... ;-)
>
> Ralf
>
>
>
>
> ___
> Freedos-devel mailing list
> Freedos-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/freedos-devel


___
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel


Re: [Freedos-devel] MAD compiler for DOS?

2024-01-30 Thread Ralf Quint via Freedos-devel

On 1/30/2024 1:37 PM, Jim Hall via Freedos-devel wrote:

Jim Hall wrote:

On Mon, Jan 29, 2024 at 8:07 PM Jim Hall  wrote:

I am working on an academic project that requires understanding the
MAD programming language so I can pick apart (and faithfully recreate)
an old MAD program. That's the Michigan Algorithm Decoder, from 1959
and the early 1960s.
[..]
Does anyone know of a MAD compiler for DOS?


Ralf Quint wrote:

Up to your email, I haven't even heard of a MAD compiler. Only the
magazine... 
(and interesting seeing that mentioned in the Wikipedia article LOL)


Yes, I hadn't heard of it either until a few months ago when I started
researching the RUNOFF source code. It's written about half in MAD and
about half in FAP (FORTRAN Assembly Programming). The RUNOFF program
is written in MAD with some support functions in FAP.

I'm thinking about writing a book about the early history of document
preparation systems, and RUNOFF seemed a good place to start. I want
to faithfully recreate the MAD code in another programming language -
not an automated translation like ESR's translator would do, but an
understandable recreation by a human who understands what the original
code is doing and recreates it in a sensible way in another
programming language. Might do it in C or BASIC. BASIC might be
easier, since I'm seeing some similarities between MAD and BASIC. But
I'd prefer to do it in C.
You seem to be as predisposed as me in always finding new deep dark 
rabbit holes to decent into 

But step #1 is to understand what's going on in the code. MAD is
mostly readable, but the for-next loop equivalent is a little weird to
me. For example, to loop from 1 to 10 (inclusive) in C, you'd do this:

for (i = 1; i <= 10; i++) {
...
}


Just to compare: in FORTRAN77, it's like "DO label var = start, stop, step":

DO 10 I = 1, 10, 1
  ...
10 CONTINUE


But in MAD, I *think* it's like "THROUGH label, FOR var = start, step,
failcondition":

THROUGH LOOP, FOR I = 1, 1, I .GT. 10
  ...
LOOP   CONTINUE


And from what I can see, I think "failcondition" gets tested at the
end of each iteration, so it's more like this weird 'while'
construction in C:

   i = 1;
   do {
...
 i++;
   } while ( !(i>10) );



That's why I wanted to write some sample code in a real MAD compiler,
to see if I'm correctly understanding that (and a few other odd things
in the language).
Well, the Wikipedia page lists at least two MAD manuals (the compiler, 
not the magazine), I might just download these and have a look at this 
late tonight, Tuesdays I can't get to sleep until 2am anyway and always 
watching movies on YouTube gets boring after a while... ;-)


Ralf




___
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel


Re: [Freedos-devel] MAD compiler for DOS?

2024-01-30 Thread Jim Hall via Freedos-devel
Jim Hall wrote:
> > On Mon, Jan 29, 2024 at 8:07 PM Jim Hall  wrote:
> >> I am working on an academic project that requires understanding the
> >> MAD programming language so I can pick apart (and faithfully recreate)
> >> an old MAD program. That's the Michigan Algorithm Decoder, from 1959
> >> and the early 1960s.
> >> [..]
> >> Does anyone know of a MAD compiler for DOS?


Ralf Quint wrote:
> Up to your email, I haven't even heard of a MAD compiler. Only the
> magazine... 
> (and interesting seeing that mentioned in the Wikipedia article LOL)


Yes, I hadn't heard of it either until a few months ago when I started
researching the RUNOFF source code. It's written about half in MAD and
about half in FAP (FORTRAN Assembly Programming). The RUNOFF program
is written in MAD with some support functions in FAP.

I'm thinking about writing a book about the early history of document
preparation systems, and RUNOFF seemed a good place to start. I want
to faithfully recreate the MAD code in another programming language -
not an automated translation like ESR's translator would do, but an
understandable recreation by a human who understands what the original
code is doing and recreates it in a sensible way in another
programming language. Might do it in C or BASIC. BASIC might be
easier, since I'm seeing some similarities between MAD and BASIC. But
I'd prefer to do it in C.

But step #1 is to understand what's going on in the code. MAD is
mostly readable, but the for-next loop equivalent is a little weird to
me. For example, to loop from 1 to 10 (inclusive) in C, you'd do this:

for (i = 1; i <= 10; i++) {
...
}


Just to compare: in FORTRAN77, it's like "DO label var = start, stop, step":

   DO 10 I = 1, 10, 1
 ...
10 CONTINUE


But in MAD, I *think* it's like "THROUGH label, FOR var = start, step,
failcondition":

   THROUGH LOOP, FOR I = 1, 1, I .GT. 10
 ...
LOOP   CONTINUE


And from what I can see, I think "failcondition" gets tested at the
end of each iteration, so it's more like this weird 'while'
construction in C:

  i = 1;
  do {
...
i++;
  } while ( !(i>10) );



That's why I wanted to write some sample code in a real MAD compiler,
to see if I'm correctly understanding that (and a few other odd things
in the language).


___
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel


Re: [Freedos-devel] MAD compiler for DOS?

2024-01-30 Thread Ralf Quint via Freedos-devel

On 1/30/2024 7:58 AM, Jim Hall via Freedos-devel wrote:

On Mon, Jan 29, 2024 at 8:07 PM Jim Hall  wrote:

I am working on an academic project that requires understanding the
MAD programming language so I can pick apart (and faithfully recreate)
an old MAD program. That's the Michigan Algorithm Decoder, from 1959
and the early 1960s.
[..]
Does anyone know of a MAD compiler for DOS?

It's not (specifically) for DOS, but someone pointed me to Raymond's
MAD implementation. It translates MAD code to C, and you can compile
from there:
https://gitlab.com/esr/mad

I think that will do what I need. But if anyone knows of a full-on MAD
compiler for DOS, please let me know.
Up to your email, I haven't even heard of a MAD compiler. Only the 
magazine... 

(and interesting seeing that mentioned in the Wikipedia article LOL)

Ralf




___
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel


Re: [Freedos-devel] MAD compiler for DOS?

2024-01-30 Thread Jim Hall via Freedos-devel
On Mon, Jan 29, 2024 at 8:07 PM Jim Hall  wrote:
>
> I am working on an academic project that requires understanding the
> MAD programming language so I can pick apart (and faithfully recreate)
> an old MAD program. That's the Michigan Algorithm Decoder, from 1959
> and the early 1960s.
>[..]
> Does anyone know of a MAD compiler for DOS?

It's not (specifically) for DOS, but someone pointed me to Raymond's
MAD implementation. It translates MAD code to C, and you can compile
from there:
https://gitlab.com/esr/mad

I think that will do what I need. But if anyone knows of a full-on MAD
compiler for DOS, please let me know.


___
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel