hart@cp1.BELL-ATL.COM (Rod Hart) (08/31/87)
I recently got ctex running on my 6300pc by hacking the file tex.h. When I try to run anything through it I get diagnostic messages that are foreign to me. Does anyone have documentation for ctex that could be sent to me via email? Next, just to play safe, I'll like to hear from anyone else who has been able to get ctex to run under MSDOS on a xt or clone.
rokicki@rocky.STANFORD.EDU (Tomas Rokicki) (09/01/87)
$ I recently got ctex running on my 6300pc by hacking the file tex.h. Please, folks, Pat Monardo's Common TeX is Common TeX; my version of TeX in C is CTeX. You might check out a copy of `TeX: The Program', Volume B of Computers and Typesetting by Don Knuth, published by Addison-Wesley. Everything you need should be in there. -tom
akk2@ur-tut.UUCP (Atul Kacker) (09/03/87)
In article <540@rocky.STANFORD.EDU> rokicki@rocky.UUCP (Tomas Rokicki) writes: >>>$ I recently got ctex running on my 6300pc by hacking the file tex.h. (This above comment is not from Tom) > >Please, folks, Pat Monardo's Common TeX is Common TeX; my version of >TeX in C is CTeX. >-tom I guess the reason for the Common TeX and CTeX confusion is that the tar file available from ucbvax for Common TeX is called ctex21.tar. Anyway, Tom is CTeX available for ftp from somewhere ? and what machines has it been ported to ? To the original poster who is getting it to work on a 6300pc : I am trying to get it running on an IBM PC AT and am having some problems. Could you send me your e-mail path so I could get in touch with you. -- ------------------------------------------------------------- Atul Kacker ...{seismo,topaz,nike}!rochester!ur-tut!akk2 OR akk2@tut.cc.rochester.edu -------------------------------------------------------------
allbery@ncoast.UUCP (Brandon Allbery) (09/04/87)
As quoted from <540@rocky.STANFORD.EDU> by rokicki@rocky.STANFORD.EDU (Tomas Rokicki): +--------------- | $ I recently got ctex running on my 6300pc by hacking the file tex.h. | | Please, folks, Pat Monardo's Common TeX is Common TeX; my version of | TeX in C is CTeX. +--------------- What other variants are there, what languages, are they shareware or PD or commercial or etc., how much do they cost, what kinds of systems are supported, and all that good stuff. TeX (in pascal) is pretty worthless when all you have is a C compiler... -- Brandon S. Allbery, moderator of comp.sources.misc {{harvard,mit-eddie}!necntc,well!hoptoad,sun!mandrill!hal}!ncoast!allbery ARPA: necntc!ncoast!allbery@harvard.harvard.edu Fido: 157/502 MCI: BALLBERY <<ncoast Public Access UNIX: +1 216 781 6201 24hrs. 300/1200/2400 baud>> ** Site "cwruecmp" has changed its name to "mandrill". Please re-address ** *** all mail to ncoast to pass through "mandrill" instead of "cwrueject: jec
rokicki@rocky.STANFORD.EDU (Tomas Rokicki) (09/04/87)
> Anyway, Tom is CTeX available for ftp from somewhere ? and what > machines has it been ported to ? No, CTeX is not available for ftp since it is a commercial product being licensed by n^2 Computer Consultants, Box 2736, College Station, TX 77841 (409) 845-3104. It's cheap, and it works. It's been ported to the IBM RT (under both OS's), all IRIS workstations, all SUN's, Vaxen running 4.3 BSD or Eunice, the Amiga, the Convex C-1, the 3B2 (and friends), PS/2 (where it runs like a champ), several Masscomps, the V system (SUN's), and practically anything else you can shake a stick at. It's about 20% faster and more organized than Common TeX, but the code is less readable and not as easy to modify. -tom
guest@vu-vlsi.UUCP (visitors) (09/05/87)
In article <4313@ncoast.UUCP> allbery@ncoast.UUCP (Brandon Allbery) writes: >As quoted from <540@rocky.STANFORD.EDU> by rokicki@rocky.STANFORD.EDU (Tomas Rokicki): >+--------------- >| $ I recently got ctex running on my 6300pc by hacking the file tex.h. >| >| Please, folks, Pat Monardo's Common TeX is Common TeX; my version of >| TeX in C is CTeX. >+--------------- > >What other variants are there, what languages, are they shareware or PD >or commercial or etc., how much do they cost, what kinds of systems are >supported, and all that good stuff. TeX (in pascal) is pretty worthless >when all you have is a C compiler... While it is true that TeX written in pascal is very difficult to work on if you only have a C compiler, isn't the reason TeX was originally written in pascal was because everyone and their Aunt Sophie knows enough pascal and probably has access (somehow) to a pascal compiler. I think that if this is indeed the case, why do people make it difficult for themselves, and some others, by rewriting it in C? --just a thought. ============================================================================== | Mark Schaffer | BITNET: 164485913@vuvaxcom | | Villanova University | UUCP: ...{ihnp4!psuvax1,burdvax,cbmvax,pyrnj,bpa} | | (Go Wildcats!) | !vu-vlsi!excalibur!164485913 | ============================================================================== please respond/reply to the above addresses and not to guest@vu-vlsi.UUCP
tli@sargas.usc.edu.UUCP (09/06/87)
In article <1109@vu-vlsi.UUCP> 164485913@excalibur.UUCP (Mark Schaffer) writes:
While it is true that TeX written in pascal is very difficult to work on
if you only have a C compiler, isn't the reason TeX was originally written
in pascal was because everyone and their Aunt Sophie knows enough pascal
and probably has access (somehow) to a pascal compiler. I think that if
this is indeed the case, why do people make it difficult for themselves,
and some others, by rewriting it in C?
The problem comes about when Uncle Homer buys a System V box. pc is
standard with BSD variants, but not with System V.
Tony Li - USC University Computing Services "Fene mele kiki bobo"
Uucp: oberon!tli -- Joe Isuzu
Bitnet: tli@uscvaxq, tli@ramoth
Internet: tli@sargas.usc.edu
chris@mimsy.UUCP (Chris Torek) (09/07/87)
In article <540@rocky.STANFORD.EDU> rokicki@rocky.STANFORD.EDU (Tomas Rokicki) writes: >Please, folks, Pat Monardo's Common TeX is Common TeX; my version of >TeX in C is CTeX. ... and my version of Unix support for TeX, which is only a small part of what is in fact needed to support TeX, is `ctex'. I had the name first (the RCS file for verser1.c dates back to 20 May 1984, and the code was written earlier still), but I suspect I will also be the first to change names, especially since I stopped work on the TeX-in-C part long ago. (Sigh. I hate creating names.) -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7690) Domain: chris@mimsy.umd.edu Path: uunet!#!m:ietE PC
guy%gorodish@Sun.COM (Guy Harris) (09/07/87)
> The problem comes about when Uncle Homer buys a System V box. pc is > standard with BSD variants, but not with System V. This is a gross oversimplification. A Pascal compiler, "pc", comes on 4BSD distributions from Berkeley. It does not, and did not, come on any UNIX distribution from AT&T. This does not mean that any system running a UNIX with BSD stuff in it has a Pascal compiler; the vendor may not have ported "pc", or may not use any of the compilers from 4BSD, or may offer the Pascal compiler as an unbundled product. Nor does it mean that systems not running UNIXes with BSD stuff in them don't have Pascal compilers; AT&T has one for the 3B2 (but I don't know if they provide the source to people who wish to port it) and plenty of other boxes running UNIX variants derived primarily from System V source have them as well. It is almost certainly the case that more UNIX boxes include C compilers than include Pascal compilers, but this has little to do with the UNIX variant provided with those boxes. Guy Harris {ihnp4, decvax, seismo, decwrl, ...}!sun!guy guy@sun.com
dca@toylnd.UUCP (David C. Albrecht) (09/08/87)
> While it is true that TeX written in pascal is very difficult to work on > if you only have a C compiler, isn't the reason TeX was originally written > in pascal was because everyone and their Aunt Sophie knows enough pascal > and probably has access (somehow) to a pascal compiler. I think that if > this is indeed the case, why do people make it difficult for themselves, > and some others, by rewriting it in C? > > --just a thought. If they really wanted to write it in a language that virtually everyone has access to it should have been BASIC :-). Gack, yuck, excuse me while I wash my mouth out with soap. Mfffph, mrphg. Okay, there are plenty of machines out there that don't have a Pascal compiler. I have an AT&T 3b1 running SYS V (no pascal and I'm sure it would cost a bloody fortune). I have an Amiga (didn't buy a Pascal). Many people would rather keep there software all in one language if at all possible. As most Unix software is in C, most of the stuff from the net for my Amiga is in C, it only makes sense that I would like my documentation tools to be in C as well. I've got nothing against Pascal, From a readability standpoint I really like the language, I've just bowed to the inevitability of life on Usenet. David Albrecht
elg@killer.UUCP (09/08/87)
in article <4341@oberon.USC.EDU>, tli@sargas.usc.edu (Tony Li) says: > In article <1109@vu-vlsi.UUCP> 164485913@excalibur.UUCP (Mark Schaffer) writes: > While it is true that TeX written in pascal is very difficult to work on > if you only have a C compiler, isn't the reason TeX was originally written > in pascal was because everyone and their Aunt Sophie knows enough pascal > and probably has access (somehow) to a pascal compiler. > The problem comes about when Uncle Homer buys a System V box. pc is > standard with BSD variants, but not with System V. There's also the problem of different Pascal variants. What runs on Vax "pc", won't necessarily run on another machine, like, say, an Amiga runnin AmigaDOS, or a Pyramid running Unix, despite both of those machines having a Pascal compiler. The "otherwise" clauses on case statements, for example, often have to be kludged around via various preprocessors and such. But, a standard "C" program that makes use of no routines besides the standard Unix library, will run on just about any modern machine... the only machines that don't have "C" compilers nowadays are generally your anachronisms, like some Multics unit moldering somewhere in the swamps of Louisiana, which don't have enough demand nowadays to feed a compiler writer... By the way, I have run many "plain" "C" programs here on my lowly Commodore 128... just about any Unix utility like "wc", "shar"(various ones), etc., will compile straight away with no problems.... try that with Pascal! The difference is that Pascal must be extended in order to be useful, for example, to have file i/o to named files, while "C" and a suitable subset of its standard library, are quite capable of doing some pretty decent work (e.g. I doubt that "nroff" does anything fancy that couldn't be done in a suitable subset....). -- Eric Green elg@usl.CSNET "... is there anybody in there? {cbosgd,ihnp4}!killer!elg can anybody hear me? Snail Mail P.O. Box 92191 is there anyone home?" Lafayette, LA 70509
msf@amelia (Michael S. Fischbein) (09/08/87)
In article <1501@killer.UUCP> elg@killer.UUCP (Eric Green) writes: >There's also the problem of different Pascal variants. What runs on Vax "pc", >won't necessarily run on another machine, like, say, an Amiga runnin AmigaDOS, >or a Pyramid running Unix, despite both of those machines having a Pascal >compiler. The "otherwise" clauses on case statements, for example, often have >to be kludged around via various preprocessors and such. This is quite true; but the tangle output is in a quite vanillia pascal that intentionally avoids as many of theses variant constructs as possible. Its output is very difficult to read by humans, but humans are supposed to look at the weave output. The TeX program should run on a minimal Jensen & Wirth pascal, if I remember correctly. That is, all identifiers are unique in the first six characters, all capital letters, etc. The (few) non-standard constructs are mentioned in the documentation and may be avoided with suitable flags. mike Michael Fischbein msf@prandtl.nas.nasa.gov ...!seismo!decuac!csmunix!icase!msf These are my opinions and not necessarily official views of any organization.
bd@hpsemc.UUCP (Bob Desinger) (09/08/87)
> No, CTeX is not available for ftp since it is a commercial > product being licensed by n^2 Computer Consultants, Box 2736, > College Station, TX 77841 (409) 845-3104. I've heard good things about your version. Do these people have an electronic address? I'm interested in price, fonts (CM, right?), supported systems, supported printers, and all that. Electric mail is at least as useful as a toll-free 800 number, perhaps more so. The person who raved about your version also mentioned that Common TeX's DVI files aren't byte-for-byte exactly the same as Knuth's, but the CTeX DVI files match perfectly. He didn't mention whether it affected the output, but it seems noteworthy if only for the spirit. Common TeX is more popular because it's free. bob desinger hplabs!hpsemc!bd ucbvax!hpda!hpsemc!bd ihnp4!hpfcla!hpda!hpsemc!bd P.S. One reason for rewriting in C is because C's code-generation has typically been heavily scrutinized and tuned, whereas Pascal receives varying levels of attention. CTeX runs about four times faster on an HP 9000 Series 500 than the Knuth/Pardo Pascal original, according to the man who recommended CTeX.
rob@philabs.Philips.Com (Rob Robertson) (09/09/87)
In article <1109@vu-vlsi.UUCP> 164485913@excalibur.UUCP (Mark Schaffer) writes: >While it is true that TeX written in pascal is very difficult to work on >if you only have a C compiler, isn't the reason TeX was originally written >in pascal was because everyone and their Aunt Sophie knows enough pascal >and probably has access (somehow) to a pascal compiler. I think that if >this is indeed the case, why do people make it difficult for themselves, >and some others, by rewriting it in C? The berkeley pascal compilers ON 4.X BSD VAXEN is a pig, it generates enormous code that runs slow. By just doing a Pascal->C translation a gain of about 20-30 percent can be achieved. If you profile it and optimize the C code you can do alot better. TeX is a good subject for this type of translation because it is pretty big, and one can readily notice the improvement in speed in the translated version. When TeX82 was written (1982, the previous versions of TeX were written in SAIL), Pascal was a very good choice. At the time it was the most popular structured language (remember Knuth is a Computer Scientist, so FORTRAN and COBOL are out) across vendor lines and C to most people was just the third letter in the alphabet. So Knuth wrote it in Pascal, and did a pretty good job of it. rob -- william robertson rob@philabs.philips.com "better living through shell scripts"
chris@mimsy.UUCP (Chris Torek) (09/29/87)
In article <1698@briar.Philips.Com> rob@philabs.Philips.Com (Rob Robertson) writes: >The berkeley pascal compilers ON 4.X BSD VAXEN is a pig, it generates >enormous code that runs slow. By just doing a Pascal->C translation a >gain of about 20-30 percent can be achieved. The same improvement can be had by doing two things: 1) add a default clause for case statements (~15%)---this is trivial, for the compiler already generates code for the default; all you need do is make it generate different code if there is an `otherwise'; and 2) run another peephole optimiser on the assembly out of /lib/c2 (~15%). A third hack that helps somewhat is to patch the Fortran code generator (yes, pc uses f1) to recognise a = a + b; and convert this to a += b; although in fact this should be done in pc itself. On the other hand, using a better compiler, such as Pastel, gives a 50% improvement: the resulting TeX runs about twice as fast as plain-old-Berkeley-pc TeX. (On the bright side for Berkeley pc, TeX did not break the compiler, as it did for most other Pascals. There is *something* to be said for slow and stupid. :-) ) Here is the post-c2-optimiser I used. It was written quite some time ago, and has things I would do differently now.... In fact, these should probably be merged into c2 itself. #ifndef lint static char rcsid[] = "$Header: fiddle.c$"; #endif /* * fiddle - fiddle with assembly code (play peephole optimizer) */ #include <stdio.h> #include <ctype.h> char inbuf[BUFSIZ]; main () { register char *p, *bufp; while (fgets (inbuf, sizeof inbuf, stdin)) { retry: p = bufp = inbuf; while (*p) if (*p++ == ':') bufp = p; p = bufp; if (p > inbuf) { register int c = *p; *p = 0; fputs (inbuf, stdout); *p = c; } if (*p++ == 'a' && *p++ == 'd' && *p++ == 'd' && *p++ == 'l' && *p++ == '2' && *p++ == '\t') { /* stuff depending on "addl2\t" */ if (try1 (p)) goto retry; if (try2 (p)) goto retry; } p = bufp; if (*p++ == 'a' && *p++ == 's' && *p++ == 'h' && *p++ == 'l' && *p++ == '\t' && *p++ == '$' && *p++ == '2' && *p++ == ',' && *p++ == 'r') { /* stuff depending on "ashl\t$2,r" */ if (try3 ()) goto retry; } fputs (bufp, stdout); } exit (0); } char * getreg (p, ar) register char *p; int *ar; { register int r; r = *p++ - '0'; if (r == 1 && isdigit (*p)) r = 10 + *p++ - '0'; *ar = r; return p; } char * getconst (p, ac) register char *p; int *ac; { register int r; if (!isdigit (*p)) return 0; r = *p++ - '0'; while (isdigit (*p)) r = r * 10 + *p++ - '0'; *ac = r; return p; } /* * Try to convert * * addl2 $const,rX \ * ashl $2,rX,rX > moval y+4*const[rX],rX * addl2 $y,rX,rX / * * addl2 $const,rX \ * ashl $2,rX,rX -- moval 4*const[rX],rX * * return 0 iff didn't do anything at all */ try1 (p) register char *p; { register int n, r; int n2, r2; if (*p++ != '$') return 0; n = 0; while (isdigit (*p)) n = n * 10 + *p++ - '0'; if (*p++ != ',' || *p++ != 'r' || !isdigit (*p)) return 0; r = *p++ - '0'; if (r == 1 && isdigit (*p)) r = 10 + *p++ - '0'; if (*p != '\n') { /* shouldn't happen */ fprintf (stderr, "\n? left over: %s\n", p); return 0; } /* * About to be committed... */ if (fgets (inbuf, sizeof inbuf, stdin) == NULL) { e_o_f: inbuf[0] = 0; give_up: printf ("addl2\t$%d,r%d\n", n, r); return 1; } /* * addl2 $c1,rX \ * addl2 $c2,rX -- addl2 $c1+c2,rX */ more_adds: if (inbuf[0] == 'a' && inbuf[1] == 'd' && inbuf[2] == 'd' && inbuf[3] == 'l' && inbuf[4] == '2' && inbuf[5] == '\t' && inbuf[6] == '$') { p = &inbuf[7]; p = getconst (p, &n2); if (p == 0 || *p++ != ',' || *p++ != 'r') goto give_up; p = getreg (p, &r2); if (r2 != r || *p != '\n') goto give_up; n += n2; /* collapse the constants */ if (fgets (inbuf, sizeof inbuf, stdin) == NULL) goto e_o_f; goto more_adds; } if (inbuf[0] != 'a' || inbuf[1] != 's' || inbuf[2] != 'h' || inbuf[3] != 'l' || inbuf[4] != '\t' || inbuf[5] != '$' || inbuf[6] != '2' || inbuf[7] != ',' || inbuf[8] != 'r') goto give_up; p = &inbuf[9]; p = getreg (p, &r2); if (r2 != r || *p++ != ',' || *p++ != 'r') goto give_up; p = getreg (p, &r2); if (r2 != r || *p != '\n') goto give_up; putc ('#', stderr); (void) fflush (stderr); /* * One more trick: if next line is another "addl2 $y,rX", we can * use the instruction "moval $const*4+(y),rX". */ if (fgets (inbuf, sizeof inbuf, stdin) == NULL) { inbuf[0] = 0; just_one: printf ("moval\t%d[r%d],r%d\n", n << 2, r, r); return 1; } if (inbuf[0] == 'a' && inbuf[1] == 'd' && inbuf[2] == 'd' && inbuf[3] == 'l' && inbuf[4] == '2' && inbuf[5] == '\t' && inbuf[6] == '$') { char *end_of_y; p = &inbuf[7]; while (*p != ',') p++; end_of_y = p; p++; if (*p++ != 'r') goto just_one; p = getreg (p, &r2); if (r2 != r || *p != '\n') goto just_one; /* bingo! */ putc ('!', stderr); (void) fflush (stderr); *end_of_y = 0; printf ("moval\t%s+%d[r%d],r%d\n", &inbuf[7], n << 2, r, r); if (fgets (inbuf, sizeof inbuf, stdin) == NULL) inbuf[0] = 0; return 1; } goto just_one; } /* * Try to convert: * * addl2 rX,rX \ * addl2 $y,rX -- movaw y[rX],rX */ try2 (p) register char *p; { int r1, r2; char *end_of_y; if (*p++ != 'r') return 0; p = getreg (p, &r1); if (*p++ != ',' || *p++ != 'r') return 0; p = getreg (p, &r2); if (*p != '\n' || r1 != r2) return 0; if (fgets (inbuf, sizeof inbuf, stdin) == NULL) { inbuf[0] = 0; give_up: printf ("addl2\tr%d,r%d\n", r1, r1); return 1; } if (inbuf[0] != 'a' || inbuf[1] != 'd' || inbuf[2] != 'd' || inbuf[3] != 'l' || inbuf[4] != '2' || inbuf[5] != '\t' || inbuf[6] != '$') goto give_up; p = &inbuf[7]; while (*p != ',') p++; end_of_y = p; p++; if (*p++ != 'r') goto give_up; p = getreg (p, &r2); if (*p != '\n' || r1 != r2) goto give_up; /* got it */ putc ('>', stderr); (void) fflush (stderr); *end_of_y = 0; printf ("movaw\t%s[r%d],r%d\n", &inbuf[7], r1, r1); if (fgets (inbuf, sizeof inbuf, stdin) == NULL) inbuf[0] = 0; return 1; } /* * Try to convert: * * ashl $2,rX,rX \ * addl2 $y,rX -- moval y[rX],rX */ try3 (p) register char *p; { int r1, r2; char *end_of_y; p = getreg (&inbuf[9], &r1); if (*p++ != ',' || *p++ != 'r') return 0; p = getreg (p, &r2); if (*p != '\n' || r1 != r2) return 0; if (fgets (inbuf, sizeof inbuf, stdin) == NULL) { inbuf[0] = 0; give_up: printf ("ashl\t$2,r%d,r%d\n", r1, r1); return 1; } if (inbuf[0] != 'a' || inbuf[1] != 'd' || inbuf[2] != 'd' || inbuf[3] != 'l' || inbuf[4] != '2' || inbuf[5] != '\t' || inbuf[6] != '$') goto give_up; p = &inbuf[7]; while (*p != ',') p++; end_of_y = p; p++; if (*p++ != 'r') goto give_up; p = getreg (p, &r2); if (*p != '\n' || r1 != r2) goto give_up; /* got it */ putc ('-', stderr); (void) fflush (stderr); *end_of_y = 0; printf ("moval\t%s[r%d],r%d\n", &inbuf[7], r1, r1); if (fgets (inbuf, sizeof inbuf, stdin) == NULL) inbuf[0] = 0; return 1; } -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7690) Domain: chris@mimsy.umd.edu Path: uunet!mimsy!chris