-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Answer and enquiry about TMG #212
Comments
Can you explain a bit more about the driving table? Is that available in the later version somewhere?
This list mentions that the |
I created the wiki page, so likely my typing.
...
I believe everything in the PDFs has been typed in and is in git. We're dealing with a snapshot from an unknown point in time, of unknown completeness. My recall is: We don't have any examples of TMG input files. We were exceedingly lucky that the first batch included a complete and functioning system (kernel). I wrote a replacement for the shell, and Warren replaced many utilities. Further luck meant that the second batch (including the t?.s files) included the shell and utility programs). But it seemed our luck ran out when it came to TMG and B. From the B run-time files in the first batch of PDFs, Robert Swierczek was able to figure out what the threaded code B generated might look like, and bootstrap a B compiler. My recall is that PDP-11 TMG parsers depend on a library of routines for "actions", but I never dug in and figured out what parts of the PDP-11 TMG implementation we had corresponding PDP-7 bits for. It's likely that your questions are the answer for the question "What bits are we missing?", but none of us are as familiar with the PDP-11 implementation as you must be. If we only have "runtime" bits, then perhaps creating a TMG based reconstruction bootstrapped on the PDP-11, or using your C translation could be a path to providing a stand-in for what is missing? |
Driving table is a generated assembly code which calls all the "actions" (as Phil calls them above). McIlroy calls them builtins. In other words, driving table is the threaded code: it consists predominantly of call instructions to a range of the available subroutines.
Yes, see tmgl.s.
Correct. Files
Yeah, it could be done and could be interesting. Though, personally, I would be more interested to see the original implementations of TMG and B in TMG. |
Also, to be clear, according to McIlroy, he created TMG in TMG from the start. Quote from here:
And then later parser for B was implemented in TMG. So, indeed, it's a bit unfortunate that those Thanks for your answers anyway. |
@amakukha I'm wondering if you might be able to advise on any aspect of trying to reconstruct a .t file for the PDP-7 version of TMG? How similar are the available PDP-7 actions to the ones used in this early (Multics) "tmg.t" file? Have you seen anything in your explorations that might indicate what the PDP-7 version of TMG might have looked like? One can imagine that it would have been a subset of the Multics version. Do the available PDP-7 files give you any idea of what the structure of the PDP-7 tmg.s might have been like? How close (or far) is the above Multics tmg.t file to the language supported by your portable C version of TMG? |
@philbudne , for the "reconstruction" part, I would advise to just backport "new TMG" from PDP-11 to PDP-7 assembly. That way it would be possible to compile the original PDP-11 "TMG in TMG" file. Some of the existing assembly code for PDP-7 TMG could be reused in the process. I think, it's the most sensible thing to do, because I don't have any information about the changes introduced between PDP-7 TMG and PDP-11 TMG. Regarding the Multics TMG, I didn't analyse it deeply. The problem with different TMG implementations is that they rely on different routines which are implemented in assembly. For example, I can see from the code that Multics TMG relied on functions That said, all TMG implementations are similar in their basic operation and differ only about as much as different BASIC implementations differ. |
FYI, today got A PDP-7 TMG (if not the original) running using @amakukha TMG in C (https://github.com/amakukha/tmg) See email at: Code at: |
I've just noticed this question in the wiki:
But didn't find the edit button. So I will just answer here.
Answer:
Yes, this is an early version of TMG for Unix by Douglas McIlroy. He later did a "new TMG" for Unix Version 2 in PDP-11 assembly. This newer implementation was included into Unix until Version 6, but then was abandoned in favor of YACC, a new compiler-compiler developed at Bell Labs. Recently, I ported this "new TMG" from PDP-11 assembly to C (here is my TMG in C repo).
Many routines in this old Unix TMG are named the same as in the later version. Particularly:
kput
,jget
,obuild
,ctest
,putoct
,bundle
,table
,find
,char
,string
,octal
. Some others are recognizable:getname
(same asgetnam
in the later version),parsedo
(same asparse
),mark
(same assmark
),roindir
(unary *, named.rv
on PDP-11), etc. Data structures int7.s
are also recognizable. Though the code is very different from the "new TMG" that I worked with.Enquiry:
Unfortunately, I didn't notice any TMG programs in this repo. It would be interesting to see, because McIlroy claimed that he wrote TMG for PDP-7 "in its own language" by bootstrapping it up.
I also didn't notice the "driving table" for TMG, which is an assembly output of TMG that would be assembled together with those t[1-8].s files to produce a new compiler. I'd expect that this driving table would be needed to make the TMG code functional.
Didn't find the driving table nor the original TMG program in the PDFs neither.
If anyone is aware of such code, please, let me know.
The text was updated successfully, but these errors were encountered: