[Swift-commit] r2385 - text/hpdc09submission
noreply at svn.ci.uchicago.edu
noreply at svn.ci.uchicago.edu
Tue Dec 30 09:43:22 CST 2008
Author: benc
Date: 2008-12-30 09:43:21 -0600 (Tue, 30 Dec 2008)
New Revision: 2385
Modified:
text/hpdc09submission/paper.latex
Log:
more stuff mostly about the language
Modified: text/hpdc09submission/paper.latex
===================================================================
--- text/hpdc09submission/paper.latex 2008-12-30 14:00:22 UTC (rev 2384)
+++ text/hpdc09submission/paper.latex 2008-12-30 15:43:21 UTC (rev 2385)
@@ -75,7 +75,10 @@
Data is represented in a script by strongly-typed single-assignment
variables, using a syntax familiar to many programmers.
- Data stored in POSIX-like files can be \emph{mapped} to a variable.
+ A variable may store data of \emph{primitive type} such as an
+integer or a string. However, a variable may also be \emph{mapper}
+to one or more POSIX-like files, allowing treatment of those files using
+the same syntax as other variables.
In that case, the variable declaration is annotated with a
\emph{mapping} describing the file(s) that make up that \emph{dataset}.
For example, this line declares a variable named \verb|photo| with
@@ -159,8 +162,10 @@
\subsection{Working with arrays}
-Arrays of values can be declared, with a mapper describing which files
-are to go into that array. For example, the \verb|filesys_mapper| maps
+Arrays of values can be declared using the \verb|[]| suffix. An array
+can be mapped to a collection of files, one element per file, by using
+a different form of mapping expression. For example, the
+\verb|filesys_mapper| maps
all files matching a particular unix glob pattern into an array:
\begin{verbatim}
@@ -250,6 +255,48 @@
\verb|a| will be regarded as closed since no other statements in the
script make an assignment to \verb|a|.
+\subsection{Compound procedures}
+
+As with many other programming languages, procedures consisting of SwiftScript
+code can be defined. These differ from the previously mentioned procedures
+declared with the \verb|app| keyword, as they invoke other SwiftScript
+procedures rather than a component program.
+
+ \begin{verbatim}
+ (file output) process (file input) {
+ file intermediate;
+ intermediate = first(input);
+ output = second(intermediate);
+ }
+
+ file x <"x.txt">;
+ file y <"y.txt">;
+ y = process(x);
+ \end{verbatim}
+
+This will invoke two procedures, with an intermediate data file named
+anonymously connecting the \verb|first| and \verb|second| procedures.
+
+Ordering of execution is generally determined by execution of \verb|app|
+procedures, not by any containing procedures. In this code block:
+
+ \begin{verbatim}
+ (file a, file b) A() {
+ a = A1();
+ b = A2();
+ }
+ file x, y, s, t;
+ (x,y) = A();
+ s = S(x);
+ t = S(y);
+ \end{verbatim}
+
+then a valid execution order is: \verb|A1 S(x) A2 S(y)|. The
+compound procedure \verb|A| does not have to have fully completed
+for its return values to be used by subsequent statements.
+
+TODO: talk about anonymous mapping somewhere - a mappers section...
+
\subsection{More about types}
Each variable and procedure parameter in SwiftScript is strongly typed.
@@ -286,6 +333,15 @@
o = p(brain.h);
\end{verbatim}
+Collections of files can be mapped to complex types using mappers, like
+for arrays. For example, the simple mapper used in this expression will
+map the files \verb|data.h| and \verb|data.v| to the variable members
+\verb|m.h| and \verb|m.v| respectively:
+
+ \begin{verbatim}
+ volume m <simple_mapper;prefix="data">;
+ \end{verbatim}
+
Sometimes data may be stored in a form that does not fit with Swift's
file-and-site model; for example, data might be stored in an RDBMS on some
database server. In that case, a variable can be declared to have
@@ -329,10 +385,11 @@
TODO mappings may be to URLs, not only to local filesystem files; and more
explicit description of what mapping is.
-\subsection{Operators and built-in procedures and functions}
+\subsection{Operators, built-in procedures, functions and mappers}
-SwiftScript has a number of built in operators, procedures and functions
-are very briefly described in tables \ref{optable} and \ref{proctable}.
+SwiftScript has a number of built in operators, procedures, functions
+are very briefly described in tables \ref{optable}, \ref{proctable}
+and \ref{mappertable}.
\begin{table}[htb]
\begin{tabular}{|c|p{2in}|}
@@ -385,6 +442,20 @@
\label{proctable}
\end{table}
+\begin{table}[htb]
+\begin{tabular}{|r|p{2in}|}
+\hline
+\verb|single_file_mapper| & maps a single explicitly named file \\
+\hline
+\verb|filesys_mapper| & maps files matching a pattern into an array \\
+\hline
+\verb|simple_mapper| & maps files to arbitrarily nested data types based on
+ components of the file name \\
+\hline
+\end{tabular}
+\caption{SwiftScript built-in mappers}
+\end{table}
+
\subsection{The execution environment for component programs}
A SwiftScript \verb|app| declaration describes how a component
@@ -784,14 +855,19 @@
active development group; releases roughly every 2 months.
+\section{Acknowledgements}
+TODO: authors beyond number 3 go here according to ACM style guide, rather
+than in header
+
+TODO: NSF/DOE grant acknowledgements
+
\section{TODO}
Reference Swift as a follow-on project to VDL in VDS; how does XDTM fit
into this? Is it of any interest other than as part of the
project history?
- NSF/DOE grant acknowledgements
Acknowledgement of all developers names?
More information about the Swift-commit
mailing list