[Swift-commit] r3918 - text/parco10submission
noreply at svn.ci.uchicago.edu
noreply at svn.ci.uchicago.edu
Sat Jan 8 18:55:35 CST 2011
Author: foster
Date: 2011-01-08 18:55:35 -0600 (Sat, 08 Jan 2011)
New Revision: 3918
Modified:
text/parco10submission/paper.tex
Log:
Various minor edits
Modified: text/parco10submission/paper.tex
===================================================================
--- text/parco10submission/paper.tex 2011-01-09 00:45:29 UTC (rev 3917)
+++ text/parco10submission/paper.tex 2011-01-09 00:55:35 UTC (rev 3918)
@@ -373,25 +373,36 @@
Each variable in a Swift script is declared to be of a specific (single) type. The Swift type model is simple, with no concepts of inheritance, abstraction, etc.
There are three basic classes of data types: primitive, mapped, and collection.
-\emph{Primitive types} are provided for integer, float, string, and boolean values. Common operators are defined for
+The four \emph{primitive types} are integer, float, string, and boolean values. Common operators are defined for
primitive types, such as arithmetic, concatenation, and explicit conversion.
-An additional primitive type ``external'' is provided for manual synchronization.
+(An additional primitive type ``external'' is provided for manual synchronization; we do not discuss this feature here.)
-\emph{Mapped types} Mapped types are provided to declare data elements that refer (through a process called``mapping'') to files external to the Swift script.
+\emph{Mapped types} are used to declare data elements that refer (through a process called``mapping,'' described
+in Section~\ref{xx}) to files external to the Swift script.
These files can then be read and written by application programs called by Swift.
The mapping process can map single variables to single files, and structures and arrays to collections of files.
-At the moment, there are no built-in mapped types in the language. Instead, users simply declare type names with no other structure to denote any mapped type names desired. For example: {\tt type file; type log;}
+There are no built-in mapped types in the language. Instead, users declare type names with no other structure to denote
+any mapped type names desired. For example: {\tt type file; type log;}
-\emph{Collection types} are \emph{arrays} and \emph{structures}.
-Arrays contain values of only a single type; structure fields can be of any type. Arrays can be created and defined to be of any primitive or declared type.
-Arrays use numeric indices, but are sparse.
+The two \emph{collection types} are \emph{arrays}, with elements accessed via an index, and \emph{structures}, with elements accessed via a "." operator.
+Arrays contain values of only a single type; structure fields can be of any type.
Both types of collections can contain members of primitive, mapped, or collection types;
in particular, arrays can be nested to provide multi-dimensional indexing.
Structures contain a declared number of elements. The number of elements in an array can be determined at run time.
-New types can be declared to define a new mapped type or to name a structure type. The type model is by design very simple and limited to keep type semantics easy to understand, implement and use.
+The size of a Swift array is not declared in the program but is determined at run time, as items are added to the array.
+This feature proves useful for expressing some common classes of parallel computations. For example, we may
+create an array containing just those experimental configurations that satisfy a certain criteria.
+An array is considered ``closed'' when no further statements that set an element of the array can be executed.
+This state is recognized at run time by information obtained from compile-time analysis of the script's call graph.
+%IAN: This last paragraph raises the issue of whether this state can always be determiend.
+The set of elements that is thus defined need not be contiguous; i.e., the index set may be sparse.
+As we will see below, the {\tt foreach}
+statement makes it easy to access all elements of an array.
-Due to the dynamic, parallel nature of Swift, its arrays have no notion of size. Array elements can be set as a script's execution progresses. The number of elements set increases monotonically. An array is considered ``closed'' when no further statements that set an element of the array can be executed. This state is recognized at run time by information obtained from compile-time analysis of the script's call graph.
+%New types can be declared to define a new mapped type or to name a structure type. The type model is by design very simple and limited to keep type semantics easy to understand, implement and use.
+
+%Due to the dynamic, parallel nature of Swift, its arrays have no notion of size. Array elements can be set as a script's execution progresses. The number of elements set increases monotonically. An array is considered ``closed'' when no further statements that set an element of the array can be executed. This state is recognized at run time by information obtained from compile-time analysis of the script's call graph.
%IAN: This last paragraph raises the issue of whether this state can always be determiend.
%Also, since all data elements have single-assignment semantics, no garbage collection issues arise. \katznote{does this follow? garbage collection removed variables that are no longer needed - I don't see how single assignment helps here.}
@@ -399,10 +410,10 @@
%garbage collection at the "dual" level (i.e., clean temp files) as well as remove unused futures from memory}
% Mike: I mentioned GC as it pertains to structures and arrays: since swift is single-assignment, structures and arrays can never get de-referenced and thus dont need to be GC'ed - *I think*. But I can see that internal objects like futures should be, and given that they dont, its best to steer clear of this issue for now.
-Variables that are declared to be mapped files
+A variable that is declared to be a mapped file
%IAN: Explain what we mean by dynamic lookup? Do we mean e.g accessing a directory to see what files it contains?
-are associated with a \emph{mapper}, which defines (often through a dynamic lookup process) the
-data files that are to be mapped to the variable. Array and structure elements that are declared to be mapped files are similarly mapped.
+is associated with a \emph{mapper}, which defines (often through a dynamic lookup process) the
+file that is mapped to the variable. Array and structure elements that are declared to be mapped files are similarly mapped.
Mapped type and collection
type variable declarations can be annotated with a
More information about the Swift-commit
mailing list