Skip to content

Commit 96cf9c2

Browse files
committed
Fix typos and errors and move a few things around up to Chapter 3
1 parent ccbcc1a commit 96cf9c2

File tree

1 file changed

+78
-92
lines changed

1 file changed

+78
-92
lines changed

src/thesis.tex

Lines changed: 78 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,9 @@ \chapter{WebAssembly}
8787
The language is defined as a virtual instruction set, encapsulating the
8888
semantics of the program in a format that is independent of the underlying
8989
system on which the program runs.
90-
WebAssembly supports two official formats: a readable text format and a
91-
more efficient binary format\cite{WasmSpec}.
92-
Both formats are based directly from the language's abstract syntax.
90+
WebAssembly supports two official formats: a readable text format and a more
91+
efficient binary format\cite{WasmSpec}; both formats are based directly from
92+
the language's abstract syntax.
9393
The binary format is a space-efficient mapping of syntax expressions
9494
into a sequence of raw bytes, with each distinct sequence of bytes
9595
representing exactly one possible combination of syntax elements
@@ -106,57 +106,36 @@ \chapter{WebAssembly}
106106
stack of values and pushing the operation's result onto the stack afterward.
107107
Strictly speaking this is not completely true, as the language's inclusion of
108108
local variables allows circumvention of completely stack-based
109-
execution\cite{WasmNotStackMachine}.
110-
This has led to challenges for implementers of Lightbeam, an optimizing
111-
streaming WebAssembly compiler\cite{IntroducingLightbeam}.
112-
109+
execution\cite{WasmNotStackMachine}; this has led to challenges for
110+
implementers of Lightbeam, an optimizing streaming WebAssembly
111+
compiler\cite{IntroducingLightbeam}.
113112
Memory operations are fully sandboxed by the WebAssembly execution environment.
114113
WebAssembly memories are single lists of raw bytes\cite[p. 16]{WasmSpec}.
115114
Each WebAssembly module can include a single memory vector, and any
116115
computations the module performs that requires memory utilizes this list
117116
of bytes, no direct access of the underlying system's physical or virtual
118117
memory is permitted.
119118

120-
WebAssembly programs are executed by virtual machines, which provide an
119+
WebAssembly programs are executed by virtual machines, which provide an
121120
abstraction layer between the program and the underlying system.
122-
These virtual machines are typically embedded within a host environment.
123-
The connection between the host environment (embedding environment) and the
124-
virtual machine executing the WebAssembly program is called an
125-
\textit{embedder}.
121+
The connection between the host environment which runs the virtual machine
122+
(embedding environment) and the virtual machine executing the WebAssembly
123+
program is called an \textit{embedder}.
126124
In order to interact with the host environment, WebAssembly embedders may
127125
expose functionality via application programming interfaces (APIs): defined
128126
functions that WebAssembly can use to interact with the environment.
129127
With the Web as the primary embedding environment, Web embeddings provide a
130128
defined JavaScript API that allows interaction between web pages.
131129

132-
Instructions are grouped into several categories: numeric instructions which
133-
perform various mathematical operations on specific numeric value types,
134-
parametric instructions which can operate on any value type, variable
135-
instructions for manipulating local or global variables, memory instructions
136-
for manipulating the linear memory, and control instructions for manipulating
137-
the program's control flow.
138-
Notably for a lower level language, WebAssembly's control flow is fully
139-
structured: there is no rudimentary \texttt{goto}-like construct, the flow of
140-
the program is manipulated only by structured instructions such as blocks and
141-
loops, if statements, and branch instructions.
142-
In addition to the above \textit{basic instructions} that are available to
143-
programmers, the specification also defines several \textit{administrative
144-
instructions} which are used to express the reduction of various basic
145-
instructions.
146-
Administrative instructions cannot be called directly, but are internally used
147-
by the virtual machine to represent resulting intermediate states.
148-
As examples, the \texttt{trap} instruction represents the reduction of an
149-
erroneous state, and the \texttt{invoke} instruction represents the invocation
150-
of a function instance by its address in memory.
151-
152130
Embedding environments are free to expose any level of functionality to
153-
WebAssembly. This is enabled by the concept of \textit{host functions},
154-
functions provided by the environment that can be invoked by WebAssembly code.
131+
WebAssembly, enabled by the concept of \textit{host functions} provided by the
132+
environment that can be invoked by WebAssembly.
155133
Host functions can receive and return values like regular functions, though
156-
they can also modify the store\cite[p. 78]{WasmSpec}.
134+
they can also modify the store, the abstract model of the program's global
135+
state\cite[p. 78]{WasmSpec}.
157136
WebAssembly itself provides no guarantees about the determinism of host
158-
functions. As far as WebAssembly is concerned, such functions can be assumed to
159-
succeed or fail arbitrarily at the whims of the embedding environment.
137+
functions---as far as WebAssembly is concerned, such functions can be assumed
138+
to succeed or fail arbitrarily at the whims of the embedding environment.
160139
If the function call succeeds, a compliant embedding environment is required to
161140
correctly remove the expected number of arguments from the stack, and return
162141
the declared number of values.
@@ -166,10 +145,30 @@ \chapter{WebAssembly}
166145
Examples of host functions include functions for reading and writing system
167146
files or performing network operations in a non-Web environment.
168147

148+
WebAssembly instructions are grouped into several categories: numeric
149+
instructions which perform various mathematical operations on specific numeric
150+
value types, parametric instructions which can operate on any value type,
151+
variable instructions for manipulating local or global variables, memory
152+
instructions for manipulating the linear memory, and control instructions for
153+
manipulating the program's control flow.
154+
Notable for a lower level language, WebAssembly's control flow is fully
155+
structured: there is no rudimentary \texttt{goto}-like construct, the flow of
156+
the program is manipulated only by structured instructions such as blocks and
157+
loops, if statements, and branch instructions.
158+
In addition to the \textit{basic instructions} that are available to
159+
programmers, the specification also defines several \textit{administrative
160+
instructions} which are used to express the reduction of various basic
161+
instructions.
162+
Administrative instructions cannot be called directly, but are internally used
163+
by the virtual machine to represent resulting intermediate states.
164+
As examples, the \texttt{trap} instruction represents the reduction of an
165+
erroneous state, and the \texttt{invoke} instruction represents the invocation
166+
of a function instance by its address in memory.
167+
169168
\section{Non-Web Embeddings}
170169

171-
As its name implies, its primary focus is Web-based software; however it is not
172-
specific or tied to the Web.
170+
As the name \textit{WebAssembly} implies, its primary focus is Web-based
171+
software; though it is not solely tied to the Web.
173172
Other non-Web environments execute WebAssembly for a variety of reasons: its
174173
safe memory model, its high performance, and it being a universal,
175174
encapsulated, and independent compile target.
@@ -186,7 +185,6 @@ \section{Non-Web Embeddings}
186185
allowing optimal portability of systems-focused WebAssembly programs while
187186
maintaining the security and sandboxing of the WebAssembly
188187
platform\cite{StandardizingWasi}.
189-
190188
WASI's
191189
\href{https://github.com/WebAssembly/WASI/blob/master/phases/snapshot/docs.md#-fd_readdirfd-fd-buf-pointeru8-buf_len-size-cookie-dircookie---errno-size}{\texttt{fd\_readdir}},
192190
for example, is a host function that allows WebAssembly code to read the
@@ -211,47 +209,39 @@ \section{Past experiments}
211209
software into their browsers that allowed them to work.
212210
Because they operated only using browser plugins, they are unsupported on
213211
popular mobile platforms such as Android and iOS.
212+
WebAssembly, by contrast, is developed in the open as a web standard, the
213+
direction of the project is not at the sole discretion of any one organization.
214+
WebAssembly virtual machines are integrated directly into modern browsers,
215+
requiring no additional action by the user to enable.
214216
If a given applet requires a newer version of the JRE than is installed on the
215217
system, or if no JRE installed at all, the user must download and install it.
216218
The Java 8 Runtime Environment installer currently is between 60 and 80 MB,
217219
depending on the platform.
218220
Performing this installation requires administrative privileges, preventing
219221
users on shared systems from running the applet if they are not able to
220222
perform the installation.
221-
WebAssembly, by contrast, is developed in the open as a web standard, the
222-
direction of the project is not at the sole discretion of any one organization.
223-
WebAssembly virtual machines are integrated directly into modern browsers,
224-
requiring no additional action by the user to enable.
225-
226-
While both Flash and Java Applets provided ways to interact with JavaScript and
227-
the web page, the primary way for a user to interact with both were via the
223+
While WebAssembly requires its own execution environment like Flash and Java
224+
Applets, on the Web this environment is intertwined heavily with existing
225+
JavaScript engines: the three most popular web browsers, Apple's Safari,
226+
Google's Chrome, and Mozilla's Firefox, each execute WebAssembly using their
227+
previously-existing JavaScript
228+
engines\cite{WebkitAssemblingWebAssembly,V8,SpiderMonkeyDevBlog}.
229+
230+
Both Flash and Java Applets provided ways to interact with JavaScript and the
231+
web page, but the primary way for a user to interact with both were via the
228232
plugins' embedded objects within the page.
229233
This disconnect between the web page and the application resulted in a jarring
230234
disintegrated experience for users, and poor or nonexistent accessibility by
231235
default for screen readers.
232236
WebAssembly, by contrast, does \textit{not} have its own way of interacting
233-
with the user---all input and output is performed using the JavaScript bridge.
234-
While WebAssembly does require its own execution environment
235-
similarly to Flash and Java Applets, on the Web this environment is intertwined
236-
heavily with existing JavaScript engines.
237-
The three most popular web browsers, Apple's Safari, Google's Chrome, and
238-
Mozilla's Firefox, each execute WebAssembly using their previously-existing
239-
JavaScript engines\cite{WebkitAssemblingWebAssembly,V8,SpiderMonkeyDevBlog}.
240-
All interactions require utilizing the web embedding's host functions, defined
241-
by the WebAssembly JavaScript Interface\cite{JSInterface} and Web-specific
242-
extensions provided by the Web API\cite{WebAPI}.
237+
with the user---all interactions require utilizing the web embedding's host
238+
functions, defined by the WebAssembly JavaScript Interface\cite{JSInterface}
239+
and Web-specific extensions provided by the Web API\cite{WebAPI}.
243240
While this may result in more work on the part of programmers, one must
244241
perform all input and output by going through JavaScript, it results
245242
in a fully integrated experience by the user: something that is \textit{part}
246243
of the Web, not something that is simply stuck inside the webpage.
247244

248-
While WebAssembly is a language in itself that one could write directly,
249-
it was designed from the beginning to be a standard compile target.
250-
While it is possible to compile other languages to be executable by the Java
251-
Virtual Machine and thus run in Java Applets, doing so is analogous to
252-
compiling other languages to JavaScript so they can be executed on the
253-
Web---not a first class way of writing software.
254-
255245
Finally, as previously mentioned, WebAssembly was designed with major goals of
256246
high performance and security.
257247
While Java applets and Flash applications can offer high performance in optimal
@@ -267,11 +257,11 @@ \section{Past experiments}
267257
Steve Jobs, CEO of Apple and the primary inventor of the iPhone, listed many of
268258
the above reasons for his refusal to provide support for Flash on iPhone
269259
devices\cite{ThoughtsOnFlash}.
270-
This lack of support on the popular devices, along with
271-
the advancement of more powerful open and standardized Web platform
272-
features, resulted in Flash falling out of favor\cite{FlashKilledOff}.
273-
Flash was deprecated in 2017 by Adobe, with an end-of-life date of
274-
December 2020\cite{FlashFuture}.
260+
This lack of support on popular mobile devices, along with the advancement of
261+
more powerful open and standardized Web platform features, resulted in Flash
262+
falling out of favor\cite{FlashKilledOff}.
263+
Flash was deprecated in 2017 by Adobe, with an end-of-life date of December
264+
2020\cite{FlashFuture}.
275265

276266
\section{Evolving WebAssembly}
277267

@@ -281,14 +271,19 @@ \section{Evolving WebAssembly}
281271
For the release of the 1.0 MVP, the main requirements of being a well-defined
282272
replacement for asm.js with distributable modules, efficient binary bytecode,
283273
and high performance were the focus\cite{WasmMvp}.
274+
Version 1.0 of the specification was tagged on July 20,
275+
2019\cite{WasmWg1.0Release}, and focus is now on adding features to increase
276+
the language's capabilities.
284277

285278
Development of the specification takes place in public GitHub repositories.
286-
Version 1.0 of the specification was tagged on July 20,
287-
2019\cite{WasmWg1.0Release}.
288279
While a large list of future features are at various levels of consideration
289280
for post-MVP Wasm, the Community Group and Working Group utilize a phase-based
290281
proposal system for introducing, discussing, and implementing additional
291282
features for WebAssembly\cite{WasmFutureFeatures}.
283+
Proposals may introduce relatively minor behavior changes or describe major
284+
substantive modifications to the language; no proposal is too small to be
285+
considered, though larger proposals with greater surface area require more
286+
deliberation and agreement before being accepted.
292287

293288
For a feature to be adopted into the language, a proposal must be drafted which
294289
passes through a sequence of phases\cite{WasmW3CProcess}:
@@ -311,8 +306,8 @@ \section{Evolving WebAssembly}
311306
\item[2] \textbf{Proposed Specification Text Available}:
312307
Once the full proposed English specification text is available in the
313308
proposal's repository, along with a reasonable community consensus,
314-
prototype implementations for are created so that a test suite can be
315-
added for the new feature.
309+
prototype implementations for the proposed features are created so that
310+
a test suite can be added.
316311

317312
\item[3] \textbf{Implementation Phase}:
318313
After a satisfactory test suite is created and passes for the feature
@@ -334,9 +329,8 @@ \section{Evolving WebAssembly}
334329

335330
In practice, in order to be deliberate about changes to the language, proposals
336331
can take a great deal of time before reaching phase 5 and being fully
337-
integrated into the WebAssembly specification.
338-
As of the time of this writing, only five proposals have done
339-
so\cite{FinishedProposals}.
332+
integrated into the WebAssembly specification; as of the time of this writing
333+
only five proposals have done so\cite{FinishedProposals}.
340334
The first such proposal was standardized relatively early in WebAssembly's
341335
life---prior even to the initial 1.0 release---with the mutable globals
342336
proposal\cite{MutableGlobalProposal} on June 6,
@@ -352,20 +346,12 @@ \section{Evolving WebAssembly}
352346
There are 23 currently outstanding proposals: 6 in phase 3, 4 in phase 2,
353347
9 in phase 1, and 4 in the pre-proposal phase 0\cite{WasmProposals}.
354348

355-
Proposals may introduce relatively minor behavior changes or describe
356-
major substantive modifications to the language.
357-
No proposal is too small to be considered, though conversely larger
358-
proposals with greater surface area require more deliberation and agreement
359-
before being accepted.
360-
361-
Proposals may depend on one another.
362-
For example, a notable proposal for Interface Types adds functionality to
363-
describe high-level non-primitive values such as strings or records
364-
so that values of these types can be passed between WebAssembly
365-
modules\cite{InterfaceTypesProposalExplainer}.
366-
Because these types are not primitive value types supported by WebAssembly
367-
such as integers or floating point numbers, there must be way to refer
368-
to these constructs indirectly.
349+
Proposals may depend on one another: for example, a notable proposal for
350+
Interface Types adds functionality to describe high-level non-primitive values
351+
such as strings or records so that values of these types can be passed between
352+
WebAssembly modules\cite{InterfaceTypesProposalExplainer}.
353+
Because these types are not of the four primitive value types supported by
354+
WebAssembly, there must be way to refer to these constructs indirectly.
369355
Thus, the Interface Types proposal depends on the Reference Types
370356
proposal, which adds typed reference values for functions and other external
371357
types\cite{ReferenceTypesProposalOverview}.
@@ -387,8 +373,8 @@ \section{Evolving WebAssembly}
387373
language are welcome; the only requirement is registering for a W3C account
388374
and agreeing to the terms of the group.
389375
The Community Group's meetings and discussions are facilitated primarily using
390-
a dedicated GitHub repository\cite{CGMeetings}.
391-
The Community Group hosts biweekly meetings via video conference.
376+
a dedicated GitHub repository\cite{CGMeetings}, and it hosts biweekly meetings
377+
via video conference.
392378
Meeting minutes and supplemental materials are posted afterward in the
393379
repository, and off-cycle discussion takes place in the repository's issue
394380
tracker.

0 commit comments

Comments
 (0)