%Latex Version: TeX, C Version 3.14t3
%dvi2ps Version: dvips 5.521 Copyright 1986, 1993 Radical Eye Software

%\documentstyle[twocolumn,psfig]{article}
\documentstyle[epsfig,12pt]{article}

%\pagestyle{empty}

\setlength{\textwidth}{6.9in}
\setlength{\textheight}{8.75in}
\setlength{\columnsep}{2.5pc}
\setlength{\topmargin}{-0.3in}
\setlength{\oddsidemargin}{-.3in}
\setlength{\parindent}{1pc}

\def\lang{$<$}
\def\rang{$>$}
\newcommand{\DS}{\renewcommand{\baselinestretch}{1.2}
                 \tiny \normalsize}
\newcommand{\SS}{\renewcommand{\baselinestretch}{1}
                 \tiny \normalsize}


\begin{document}
\date{}

\title{\Large\bf Towards Fully HPF Interpreter using Web Technologies }

\author{
\normalsize
\begin{tabular}[t]{c@{\extracolsep{3em}}c@{\extracolsep{3em}}c@{\extracolsep{3em
}}c}
  Erol Akarsu{\dag\ddag} & Geoffrey C.~Fox{\dag\ddag} & Tomasz Haupt{\dag} \\
  \end{tabular} \\
  {\normalsize \dag Northeast Parallel Architectures Center}\\
  {\normalsize \ddag Department of Electrical Engineering and Computer Science}
\\
  {\normalsize 111 College Place, Mail Stop 3-217} \\
  {\normalsize Syracuse University} \\
  {\normalsize Syracuse, NY 13244-4100} \\
  {\normalsize \tt \{akarsu, gcf,haupt\}@npac.syr.edu }
}

\maketitle

\thispagestyle{empty}

In this draft, we propose a fully HPF interpreter.We will use
the basic principles of semi-interpreter for HPF whose structure
is very similar to fully HPF interpreter. Therefore, we first will
tell about semi-interpreter HPF.

\section{Semi-Interpreter for HPF}

\begin{figure}[htbp]
\centerline{\psfig{figure=dynlink.eps,width=5.0in,height=6.0in}}
\caption{\sf Basics of HPF Interpreter Mode.}
\label{fig:dynlink}
\end{figure}

We are trying to integrate the compiled and interpreted HPF and user
can enter into interpreter mode at any time during execution of HPF
application. After entering into this interpreter mode 
(Figure ~\ref {fig:dynlink}), user can request 3 types of jobs:
\begin{enumerate}
\item Any number of HPF statements user would like to interpret .
\item He can make a call to precompiled highly optimized function.
\item He can dynamically define new HPF function/subroutine he may use later.  
\end{enumerate}
After processing one of them, he may return to compiled environment
or continue to stay in interpreter mode.We will give basic events
occurring at each type of request.

In the first case, user may give any number of HPF statements
including Forall Loop and Independent Do Loops and input them to our
HPF server from keyboard or from built-in file. HPF server first run
the HPF lexical analyzer which will look at the HPF statements to find
used variables of current context in which user gives the
request. Then HPFfe(HPF Front End) takes these variables and
the statements and constructs one new subroutine . The arguments of
this subroutine consist of used variables and all the variable
declarations of current context will be same as the ones of this
subroutine. We are including the variables used in HPF statements
in argument list of the subroutine to pass the context information .
Then HPF compiler produces shared object from this subroutine. At the
last step, we will dynamically link this shared object to running
program and call this subroutine with used variables as parameters
whose attributes were stored at the registration table.

In the second case,he can make a call to precompiled functions. For
this, we should search the function table including the corresponding
shared object for each precompiled function and find the shared object
including this function code. Then as above, we will dynamically link
and call this function.

In the third case, he can dynamically define new HPF
function/subroutine from which HPF server will produce shared object
using HPF compiler . For this case, we are not calling any
function but just defining new one to use later.


Here we are giving the reason why fully HPF interpreter is similar to
semi-interpreter for HPF. Notice that above user is giving the
interpreter requests in compiled environment. As long as he stays in
interpreted mode, he can submit interpreter requests. Therefore, if we
can ourself automatically construct the context in which he can
make interpreter commands, then we will have absolutely
fully HPF interpreter. We will explain this in the next chapter

\section {Fully HPF interpreter}

Now we will give basic keystones of our HPF interpreter using
well-known JavaScript language. We will use liveConnect facility of
Netscape which enables communication between JavaScript and
JavaApplets in a page and between JavaScript and plug-ins loaded on a
page. 

We propose that all the HPF statements in JavaScript are sent to HPF
Server in text format trough JavaApplet. It means that user will use
JavaApplet methods to construct communication with HPF server and send
HPF statements in text format.Here HPF server just is just running HPF
program which includes only  HPF declarations user gave first and which waits
for commands from JavaScript to interpret HPF statements. This
interpretation is exactly same as (Figure 1).

Notice that we have to create
environment in which user may give HPF interpreter requests. For this,
user has to send the declarations of all HPF variables before using them 
in JavaScript environment. 
User should also give HPF distribution/alignment directives
with these declarations or redistribute/realign  later.  

We think that declarations of global HPF variables should be done anywhere in
JavaScript. Here we propose they should be done first before any
further HPF statements are sent to HPF server. Later we can take away
this restriction.

Liveconnect facility of Netscape allows the changing the Javascript
variables from inside Java Applet  whose variables also can be changed
from inside JavaScript environment. JavaScript send HPF statements in
text format using Java Applet method to HPF server which process them
and send result back. Applet method looks at the JavaScript variables
and set them. Therefore JavaScript variables will be changed by Applet
method.When JavaScript needs the value of one HPF variable, it sends
its name trough Applet method to HPF server which send the value to
Applet which updates JavaScript HPF variable. When JavaScript wants to
set one HPF variable to one value, it can access that variable in
Applet context and set it and call necessary Applet method to send
SETVAR command to HPF server to set parameter value.

We will imagine that it is not so
difficult to build Internet-Matlab on top of HPF interpreter by not
using MATLAB library but our optimized parallel/serial library. So we
will have MATLAB on Netscape running on distributed processors. 

%\input{author-bio}
\end{document}
