JavaTeX

Petr Sojka sojka at daeron.fi.muni.cz
Tue Aug 6 19:01:15 CEST 1996


Archive-Date: Mon, 05 Aug 1996 21:54:45 CST
From: tim at maths.tcd.ie (Timothy Murphy)
Reply-To: tim at maths.tcd.ie (Timothy Murphy)
Subject: Announcing: javaTeX
Date: 6 Aug 1996 01:58:50 +0100
Keywords: Java TeX
To: tex-news at SHSU.EDU

\documentclass[a4paper,12pt]{article}
\usepackage{amsmath}
\usepackage{doc}
\MakeShortVerb{\"}
\newcommand{\Java}{Java}
\newcommand{\javaTeX}{java\TeX}

\title{The \javaTeX\ project \& "web2java"%
\thanks{This is an abridged document;
the full version can be retrieved from
\texttt{ftp://ftp.maths.tcd.ie/pub/TeX/javaTeX/javaTeX.tex}}}

\author{Timothy Murphy\\
"<tim at maths.tcd.ie>"\\
School of Mathematics, Trinity College Dublin}

\date{29 July 1996}

\begin{document}

\maketitle

\begin{abstract}
The general aim of the \javaTeX\ project
is to examine the relation --- if any ---
between \Java\ and \TeX,
and in particular (as a first step) to translate
the standard \TeX\ programs ("tangle", "tex", "mf", etc)
into \Java, using "web2java" ---
a simple modification of the standard UnixTeX utility "web2c".
\end{abstract}

\tableofcontents

\section{Project details}

All the material in the project is in the public domain,
and can be retrieved by anonymous FTP from
"ftp://ftp.maths.tcd.ie/pub/TeX/javaTeX".
(It is hoped later to submit the programs to the CTANs.)

Any suggestions and contributions are very welcome.

A mailing list has been set up.
To join this, email "majordomo at maths.tcd.ie"
with the message (not heading)
\begin{verbatim}
    subscribe javatex
\end{verbatim}
The material forming the project is also available
through the mailing-list.
You can obtain this file, for example,
by emailing "majordomo at maths.tcd.ie" with the message
\begin{verbatim}
    get javatex javaTeX.tex
\end{verbatim}
To obtain a list of available files, send the message
\begin{verbatim}
    index javatex
\end{verbatim}
For information on the working of "majordomo" send the message
\begin{verbatim}
    help
\end{verbatim}
to "majordomo at maths.tcd.ie".

\section{Why Java?}

Java is a dialect of C;
and 95\% of the code produced by "web2java"
is indistinguishable from C.
At the same time, Java is much safer than C;
for example, run-time checking of array-bounds
catches many errors that would be missed by C.

Java is object-oriented, which is of course a Good Thing.
Although in fact we have made very little use of this ---
apart from hiving off a few functions
(I suppose we should say ``methods''!)
like "reset" and "rewrite" into "TeXlib.class".
But it would be nice to have a generic DVI driver
which sent ``messages'' to an abstract "printer",
which could be ``instantiated'' as a PostScript printer,
a screen viewer, etc.

Java has a simple graphics interface,
although again we have made no use of this to date.
It might prove \emph{too} simple for the purposes of \TeX.

Java also has a simple network interface,
which could prove useful
in integrating \TeX\ into WWW (the World-Wide Web).

A theoretical advantage of Java is that
it compiles into device-independent ``bytecode'' format,
so that, for example, "tangle.class" compiled on a Sun
should run under Windows 95.

There remains the intriguing possibility of DVI ``Applets'',
as a way of putting \TeX\ on the Web.

Against all these advantages there is at present
one overwhelming disadvantage ---
Java is extremely slow.
For example, it takes about 40 times as long
to "tangle" "tex.web" in Java as it does in C.
Doubtless this ratio can be somewhat reduced
by better coding;
but it seems improbable that it could be improved
more than four-fold.

Our hope must be that a true Java compiler
will soon be available, converting Java into machine code.
Since Java is a standard programming language
there seems no reason why such a compiler should not emerge;
we would exect to see one before the end of the year.

\section{How \texttt{web2java} works}

\section{The \texttt{web2java} program}

\section{Implementation}

\subsection{Removing \texttt{goto}'s}

\subsection{Type definitions}

\subsection{Input/Output}

\section{Conclusions}

\end{document}

--
Timothy Murphy
e-mail: tim at maths.tcd.ie
tel: +353-1-2842366
s-mail: School of Mathematics, Trinity College, Dublin 2, Ireland



More information about the csTeX mailing list