<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.expertiza.ncsu.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Rrastog3</id>
	<title>Expertiza_Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.expertiza.ncsu.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Rrastog3"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Rrastog3"/>
	<updated>2026-09-12T07:04:28Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_M1950._Support_Asynchronous_Web_Assembly_Compilation&amp;diff=130658</id>
		<title>CSC/ECE 517 Fall 2019 - M1950. Support Asynchronous Web Assembly Compilation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_M1950._Support_Asynchronous_Web_Assembly_Compilation&amp;diff=130658"/>
		<updated>2019-12-07T01:30:57Z</updated>

		<summary type="html">&lt;p&gt;Rrastog3: /* Testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Servo is a prototype web browser engine written in the [https://en.wikipedia.org/wiki/Rust_(programming_language) Rust] language. Servo is a new, experimental browser that supports synchronously compiling and executing WebAssembly code, but does not yet support asynchronous compilation. This means that the entire WebAssembly program must be fetched before compilation can begin, which leads to longer time loading pages that run WebAssembly programs than in other web browsers. The goal of the project is to support compiling WebAssembly programs asynchronously so compilation can begin while the program is still being fetched from the network.&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo]Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in [https://www.rust-lang.org/ Rust] language. The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc. &lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[https://doc.rust-lang.org/book/index.html Rust] is an open source systems programming language developed by Mozilla. Servo is written in Rust. The main purpose behind its design is to be thread safe and concurrent. The emphasis is also on speed, safety and control of memory layout.&lt;br /&gt;
&lt;br /&gt;
===Web Assembly===&lt;br /&gt;
&lt;br /&gt;
[https://webassembly.org/ WebAssembly] is a new type of code that can be run in modern web browsers — it is a low-level assembly-like language with a compact binary format that runs with near-native performance and provides languages such as C/C++ and Rust with a compilation target so that they can run on the web. It is also designed to run alongside JavaScript, allowing both to work together.&lt;br /&gt;
&lt;br /&gt;
=='''Scope'''==&lt;br /&gt;
&lt;br /&gt;
Major browsers support the WebAssembly standard which can be used to implement performance-sensitive sandboxed applications. Servo is a new, experimental browser that supports synchronously compiling and executing WebAssembly code, but does not yet support asynchronous compilation. This means that the entire WebAssembly program must be fetched before compilation can begin, which leads to longer time loading pages that run WebAssembly programs than in other web browsers. The goal of this work is to support compiling WebAssembly programs asynchronously so compilation can begin while the program is still being fetched from the network.&lt;br /&gt;
&lt;br /&gt;
The scope of this milestone was to complete the initial steps mentioned [https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project here]. The subsequent steps mentioned [https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project here] are to be done for the final project.&lt;br /&gt;
&lt;br /&gt;
The steps for the &amp;lt;b&amp;gt;OSS project&amp;lt;/b&amp;gt; are as follows:&lt;br /&gt;
&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
&lt;br /&gt;
* Create a rust JS::StreamConsumer wrapper that stores a pointer to the object and has methods for consumeChunk, streamEnd, streamError, and noteResponseURLs.&lt;br /&gt;
* Implement an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches ConsumeStreamCallback that initiates the streaming web assembly compilation then creates a wrapper for the stream consumer and stores it in the Response object&lt;br /&gt;
* Implement an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches ReportStreamErrorCallback and reports an error with the error! macro&lt;br /&gt;
* Lastly, call InitStreamConsumerCallback in new_rt_and_cx with the two new functions as arguments, described in the specifications&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Steps.png|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The steps for the &amp;lt;b&amp;gt;final project&amp;lt;/b&amp;gt; are as follows:&lt;br /&gt;
&lt;br /&gt;
* Binding runnable dispatching:&lt;br /&gt;
* Pass network task source into new_rt_and_cx functions&lt;br /&gt;
* Create rust JS::Runnable wrapper that stores a pointer to the object and has a run method that calls the new C function passing the stored pointer&lt;br /&gt;
* Create an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches DispatchToEventLoopCallback that casts the closure argument to a boxed network task source, wraps the runnable pointer in the new struct, and uses the network task source to queue a task that calls the run method of the wrapper&lt;br /&gt;
* Call InitDispatchToEventLoop in new_rt_and_cx_with_parent passing the new function and the boxed network task source as the closure argument /blob/b2f83932fe9d361face14efd03f2465b9262e687/mozjs/js/src/jsapi.h#L2475) in new-rt_and_cx_with_parent passing the new function&lt;br /&gt;
&lt;br /&gt;
* Add a stream consumer wrapper field to Response, and call the streamEnd method in Response::finish&lt;br /&gt;
* Add a stream_chunk method to Response and call it from FetchContext::process_response_chunk; this should invoke the consumeChunk method of the stream consumer wrapper if it exists.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Untitled Diagram.png|center]]&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern'''==&lt;br /&gt;
Design patterns are not applicable as our task involved just implementation of methods. However, the Implementation section below provides details of the steps as why it was implemented, the way it was implemented&lt;br /&gt;
&lt;br /&gt;
=='''Implementation'''==&lt;br /&gt;
The following steps were followed to meet the project requirements as per this [https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project github page].&lt;br /&gt;
&lt;br /&gt;
===OSS Project (Initial Steps)===&lt;br /&gt;
&lt;br /&gt;
===Step 1===&lt;br /&gt;
&lt;br /&gt;
We have implemented a Stream Consumer structure which has the methods for consumeChunk, streamEnd, streamError, and noteResponseURLs based on the Stream Consumer class implemented in the Mozilla Spider Monkey module. &lt;br /&gt;
&lt;br /&gt;
[[File:IS1-1.png]]&lt;br /&gt;
&lt;br /&gt;
The note_response_urls function takes optional arguments as input, if nothing is passed it calls the underlying JS function with null ptr in place of the URLs. &lt;br /&gt;
&lt;br /&gt;
[[File:IS1-2.png]]&lt;br /&gt;
&lt;br /&gt;
===Step 2===&lt;br /&gt;
&lt;br /&gt;
We implemented the consume stream function which checks if a response extracted from the source is valid and returns an appropriate boolean value. The function checks if the response has a valid mime type, is CORS- origin type and has an ok status. if the source cannot be extracted we throw a dom exception and return false.&lt;br /&gt;
&lt;br /&gt;
[[File:IS2-1.png]]&lt;br /&gt;
&lt;br /&gt;
This step checks if the response type is of &amp;quot;default&amp;quot;, &amp;quot;cors&amp;quot; or &amp;quot;basic&amp;quot; type. This step checks the status code of the repsonse. It throws an error if the response is not OK ie. the status is not between 200 and 299.&lt;br /&gt;
&lt;br /&gt;
[[File:IS2-2.png]]&lt;br /&gt;
&lt;br /&gt;
These steps check if the response is locked. If the response is locked, it is not accessible and it throws a type error. If the response's body is already consumed, there is no need to process the response again. The function raises a corresponding type error. &lt;br /&gt;
&lt;br /&gt;
[[File:IS2-3-1.png]]&lt;br /&gt;
&lt;br /&gt;
===Step 3===&lt;br /&gt;
&lt;br /&gt;
The implementation of the ReportStreamErrorCallback function to retrieve and report errors during stream compilation, CompileError, or TypeError in case of invalid Mime type and unprocessable stream.&lt;br /&gt;
&lt;br /&gt;
[[File:IS3.png]]&lt;br /&gt;
&lt;br /&gt;
===Step 4===&lt;br /&gt;
&lt;br /&gt;
The implementation of InitStreamConsumerCallback in new_rt_and_cx_with_parent function. We call the Consume Stream callback added in step 2  and the Report Stream Error Callback added in Step 3 in  new runtime environment.&lt;br /&gt;
&lt;br /&gt;
[[File:IS4.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Final Project (Subsequent Steps)'''===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Step 1===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* To enable the asynchronous compilation, we had to integrate event loop support and bind the runnable dispatching in the servo runtime. For this, we needed to pass NetworkingTaskSource object around new_rt_and_cx and new_rt_and_cx_with_parent functions in order to add the task in the job queue for execution.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:SS1_1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Implemented an extern &amp;quot;C&amp;quot; function, dispatch_to_event_loop in script_runtime.rs that matches DispatchToEventLoopCallback that casts the closure argument to a boxed network task source, wraps the runnable pointer in the new struct, and uses the network task source to queue a task that calls the run method of the wrapper. Additionally, called the InitDispatchToEventLoop funtion in new_rt_and_cx_with_parent passing the new function and the boxed network task source as the closure argument in new-rt_and_cx_with_parent passing the new function.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:SS1_2.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Added rust JS::Runnable wrapper in script_runtime.rs that stores a pointer to the object and has a run method that calls the added C function, DispatchableRun, passing the stored pointer.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:SS1_3.png]]&lt;br /&gt;
&lt;br /&gt;
===Step 2===&lt;br /&gt;
&lt;br /&gt;
We added a Stream Consumer object defined in the initial steps to the Response structure.&lt;br /&gt;
&lt;br /&gt;
[[File:add_stream_consumer_to_response.png]]&lt;br /&gt;
&lt;br /&gt;
In the Repsonse::finish() method we called the stream_end() function using the Stream Consumer object we recently added.&lt;br /&gt;
&lt;br /&gt;
[[File:add_stream_end_to_finish.png]]&lt;br /&gt;
&lt;br /&gt;
===Step 3===&lt;br /&gt;
&lt;br /&gt;
We added a stream_chunk method in the response class which invokes the consume_chunk() method defined for the StreamConsumer object. The consume_chunk() method Asynchronously compiles the WebAssembly module and returns a boolean value based on it's success.&lt;br /&gt;
&lt;br /&gt;
[[File:stream_chunk.png]]&lt;br /&gt;
&lt;br /&gt;
=='''Testing'''==&lt;br /&gt;
&lt;br /&gt;
The changes we have made allow for asynchronous compilation of Web Assembly modules. After the changes we are able to load a website which makes use of WebAssembly promises. Here is the link to our [https://www.youtube.com/watch?v=SlEArNp288M&amp;amp;feature=youtube demo]. &lt;br /&gt;
&lt;br /&gt;
In addition, we have tested our implementation against the servo-provided automated test suite using `./mach test-wpt tests/wpt/web-platform-tests/wasm/webapi` command.&lt;br /&gt;
The following image is the output of the said command:&lt;br /&gt;
&lt;br /&gt;
[[File:Serv_tests.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Following are the steps to compile the implementation to check for any broken code:&lt;br /&gt;
&lt;br /&gt;
# Install the pre-requisites required for servo as mentioned [https://github.com/servo/servo/blob/master/README.md here] &lt;br /&gt;
# Run the following commands&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; &lt;br /&gt;
  cd&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 git clone https://github.com/Akash-Pateria/servo&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 cd servo&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 git checkout -b origin/async-wasm-compilation-initial&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach fmt&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach test-tidy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach build -d&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will see that the servo build is successful and no errors are reported.&lt;br /&gt;
&lt;br /&gt;
=='''Pull Request'''==&lt;br /&gt;
&lt;br /&gt;
===OSS Project (Initial Steps)===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/servo/servo/pull/24563 Pull Request 1] [https://github.com/servo/servo/pull/24653 Pull Request 2]&lt;br /&gt;
&lt;br /&gt;
===Final Project (Subsequent Steps)===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/servo/servo/pull/24757 Pull Request 1] [https://github.com/servo/servo/pull/24977 Pull Request 2]&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/book&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://rustbyexample.com/&amp;lt;br&amp;gt;&lt;br /&gt;
7.    https://webassembly.org/&amp;lt;br&amp;gt;&lt;br /&gt;
8.    https://developer.mozilla.org/en-US/docs/WebAssembly&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rrastog3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_M1950._Support_Asynchronous_Web_Assembly_Compilation&amp;diff=130071</id>
		<title>CSC/ECE 517 Fall 2019 - M1950. Support Asynchronous Web Assembly Compilation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_M1950._Support_Asynchronous_Web_Assembly_Compilation&amp;diff=130071"/>
		<updated>2019-12-06T17:52:14Z</updated>

		<summary type="html">&lt;p&gt;Rrastog3: /* Step 3 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Servo is a prototype web browser engine written in the [https://en.wikipedia.org/wiki/Rust_(programming_language) Rust] language. Servo is a new, experimental browser that supports synchronously compiling and executing WebAssembly code, but does not yet support asynchronous compilation. This means that the entire WebAssembly program must be fetched before compilation can begin, which leads to longer time loading pages that run WebAssembly programs than in other web browsers. The goal of the project is to support compiling WebAssembly programs asynchronously so compilation can begin while the program is still being fetched from the network.&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo]Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in [https://www.rust-lang.org/ Rust] language. The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc. &lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[https://doc.rust-lang.org/book/index.html Rust] is an open source systems programming language developed by Mozilla. Servo is written in Rust. The main purpose behind its design is to be thread safe and concurrent. The emphasis is also on speed, safety and control of memory layout.&lt;br /&gt;
&lt;br /&gt;
===Web Assembly===&lt;br /&gt;
&lt;br /&gt;
[https://webassembly.org/ WebAssembly] is a new type of code that can be run in modern web browsers — it is a low-level assembly-like language with a compact binary format that runs with near-native performance and provides languages such as C/C++ and Rust with a compilation target so that they can run on the web. It is also designed to run alongside JavaScript, allowing both to work together.&lt;br /&gt;
&lt;br /&gt;
=='''Scope'''==&lt;br /&gt;
&lt;br /&gt;
Major browsers support the WebAssembly standard which can be used to implement performance-sensitive sandboxed applications. Servo is a new, experimental browser that supports synchronously compiling and executing WebAssembly code, but does not yet support asynchronous compilation. This means that the entire WebAssembly program must be fetched before compilation can begin, which leads to longer time loading pages that run WebAssembly programs than in other web browsers. The goal of this work is to support compiling WebAssembly programs asynchronously so compilation can begin while the program is still being fetched from the network.&lt;br /&gt;
&lt;br /&gt;
The scope of this milestone was to complete the initial steps mentioned [https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project here]. The subsequent steps mentioned [https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project here] are to be done for the final project.&lt;br /&gt;
&lt;br /&gt;
The steps for the &amp;lt;b&amp;gt;OSS project&amp;lt;/b&amp;gt; are as follows:&lt;br /&gt;
&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
&lt;br /&gt;
* Create a rust JS::StreamConsumer wrapper that stores a pointer to the object and has methods for consumeChunk, streamEnd, streamError, and noteResponseURLs.&lt;br /&gt;
* Implement an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches ConsumeStreamCallback that initiates the streaming web assembly compilation then creates a wrapper for the stream consumer and stores it in the Response object&lt;br /&gt;
* Implement an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches ReportStreamErrorCallback and reports an error with the error! macro&lt;br /&gt;
* Lastly, call InitStreamConsumerCallback in new_rt_and_cx with the two new functions as arguments, described in the specifications&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Steps.png|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The steps for the &amp;lt;b&amp;gt;final project&amp;lt;/b&amp;gt; are as follows:&lt;br /&gt;
&lt;br /&gt;
* Binding runnable dispatching:&lt;br /&gt;
* Pass network task source into new_rt_and_cx functions&lt;br /&gt;
* Create rust JS::Runnable wrapper that stores a pointer to the object and has a run method that calls the new C function passing the stored pointer&lt;br /&gt;
* Create an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches DispatchToEventLoopCallback that casts the closure argument to a boxed network task source, wraps the runnable pointer in the new struct, and uses the network task source to queue a task that calls the run method of the wrapper&lt;br /&gt;
* Call InitDispatchToEventLoop in new_rt_and_cx_with_parent passing the new function and the boxed network task source as the closure argument /blob/b2f83932fe9d361face14efd03f2465b9262e687/mozjs/js/src/jsapi.h#L2475) in new-rt_and_cx_with_parent passing the new function&lt;br /&gt;
&lt;br /&gt;
* Add a stream consumer wrapper field to Response, and call the streamEnd method in Response::finish&lt;br /&gt;
* Add a stream_chunk method to Response and call it from FetchContext::process_response_chunk; this should invoke the consumeChunk method of the stream consumer wrapper if it exists.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Untitled Diagram.png|center]]&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern'''==&lt;br /&gt;
Design patterns are not applicable as our task involved just implementation of methods. However, the Implementation section below provides details of the steps as why it was implemented, the way it was implemented&lt;br /&gt;
&lt;br /&gt;
=='''Implementation'''==&lt;br /&gt;
The following steps were followed to meet the project requirements as per this [https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project github page].&lt;br /&gt;
&lt;br /&gt;
===OSS Project (Initial Steps)===&lt;br /&gt;
&lt;br /&gt;
===Step 1===&lt;br /&gt;
&lt;br /&gt;
We have implemented a Stream Consumer structure which has the methods for consumeChunk, streamEnd, streamError, and noteResponseURLs based on the Stream Consumer class implemented in the Mozilla Spider Monkey module. &lt;br /&gt;
&lt;br /&gt;
[[File:IS1-1.png]]&lt;br /&gt;
&lt;br /&gt;
The note_response_urls function takes optional arguments as input, if nothing is passed it calls the underlying JS function with null ptr in place of the URLs. &lt;br /&gt;
&lt;br /&gt;
[[File:IS1-2.png]]&lt;br /&gt;
&lt;br /&gt;
===Step 2===&lt;br /&gt;
&lt;br /&gt;
We implemented the consume stream function which checks if a response extracted from the source is valid and returns an appropriate boolean value. The function checks if the response has a valid mime type, is CORS- origin type and has an ok status. if the source cannot be extracted we throw a dom exception and return false.&lt;br /&gt;
&lt;br /&gt;
[[File:IS2-1.png]]&lt;br /&gt;
&lt;br /&gt;
This step checks if the response type is of &amp;quot;default&amp;quot;, &amp;quot;cors&amp;quot; or &amp;quot;basic&amp;quot; type. This step checks the status code of the repsonse. It throws an error if the response is not OK ie. the status is not between 200 and 299.&lt;br /&gt;
&lt;br /&gt;
[[File:IS2-2.png]]&lt;br /&gt;
&lt;br /&gt;
These steps check if the response is locked. If the response is locked, it is not accessible and it throws a type error. If the response's body is already consumed, there is no need to process the response again. The function raises a corresponding type error. &lt;br /&gt;
&lt;br /&gt;
[[File:IS2-3-1.png]]&lt;br /&gt;
&lt;br /&gt;
===Step 3===&lt;br /&gt;
&lt;br /&gt;
The implementation of the ReportStreamErrorCallback function to retrieve and report errors during stream compilation, CompileError, or TypeError in case of invalid Mime type and unprocessable stream.&lt;br /&gt;
&lt;br /&gt;
[[File:IS3.png]]&lt;br /&gt;
&lt;br /&gt;
===Step 4===&lt;br /&gt;
&lt;br /&gt;
The implementation of InitStreamConsumerCallback in new_rt_and_cx_with_parent function. We call the Consume Stream callback added in step 2  and the Report Stream Error Callback added in Step 3 in  new runtime environment.&lt;br /&gt;
&lt;br /&gt;
[[File:IS4.png]]&lt;br /&gt;
&lt;br /&gt;
===Final Project (Subsequent Steps)===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Step 2===&lt;br /&gt;
&lt;br /&gt;
We added a Stream Consumer object defined in the initial steps to the Response structure.&lt;br /&gt;
&lt;br /&gt;
[[File:add_stream_consumer_to_response.png]]&lt;br /&gt;
&lt;br /&gt;
In the Repsonse::finish() method we called the stream_end() function using the Stream Consumer object we recently added.&lt;br /&gt;
&lt;br /&gt;
[[File:add_stream_end_to_finish.png]]&lt;br /&gt;
&lt;br /&gt;
===Step 3===&lt;br /&gt;
&lt;br /&gt;
We added a stream_chunk method in the response class which invokes the consume_chunk() method defined for the StreamConsumer object. The consume_chunk() method Asynchronously compiles the WebAssembly module and returns a boolean value based on it's success.&lt;br /&gt;
&lt;br /&gt;
[[File:stream_chunk.png]]&lt;br /&gt;
&lt;br /&gt;
=='''Testing'''==&lt;br /&gt;
&lt;br /&gt;
The code added in the initial steps (scope) is not expected to have any change in behavior on its own. We loaded https://wasm.bootcss.com/demo/Tanks/ to verify that there is no change in behavior due to our changes. &lt;br /&gt;
&lt;br /&gt;
In addition, we have tested our implementation against the servo-provided automated test suite using `./mach test-wpt tests/wpt/web-platform-tests/wasm/webapi` command.&lt;br /&gt;
The following image is the output of the said command:&lt;br /&gt;
&lt;br /&gt;
[[File:Serv_tests.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Following are the steps to compile the implementation to check for any broken code:&lt;br /&gt;
&lt;br /&gt;
# Install the pre-requisites required for servo as mentioned [https://github.com/servo/servo/blob/master/README.md here] &lt;br /&gt;
# Run the following commands&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; &lt;br /&gt;
  cd&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 git clone https://github.com/Akash-Pateria/servo&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 cd servo&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 git checkout -b origin/async-wasm-compilation-initial&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach fmt&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach test-tidy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach build -d&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will see that the servo build is successful and no errors are reported.&lt;br /&gt;
&lt;br /&gt;
=='''Pull Request'''==&lt;br /&gt;
&lt;br /&gt;
===OSS Project (Initial Steps)===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/servo/servo/pull/24563 Pull Request 1] [https://github.com/servo/servo/pull/24653 Pull Request 2]&lt;br /&gt;
&lt;br /&gt;
===Final Project (Subsequent Steps)===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/servo/servo/pull/24757 Pull Request 1] [https://github.com/servo/servo/pull/24977 Pull Request 2]&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/book&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://rustbyexample.com/&amp;lt;br&amp;gt;&lt;br /&gt;
7.    https://webassembly.org/&amp;lt;br&amp;gt;&lt;br /&gt;
8.    https://developer.mozilla.org/en-US/docs/WebAssembly&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rrastog3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_M1950._Support_Asynchronous_Web_Assembly_Compilation&amp;diff=130070</id>
		<title>CSC/ECE 517 Fall 2019 - M1950. Support Asynchronous Web Assembly Compilation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_M1950._Support_Asynchronous_Web_Assembly_Compilation&amp;diff=130070"/>
		<updated>2019-12-06T17:50:50Z</updated>

		<summary type="html">&lt;p&gt;Rrastog3: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Servo is a prototype web browser engine written in the [https://en.wikipedia.org/wiki/Rust_(programming_language) Rust] language. Servo is a new, experimental browser that supports synchronously compiling and executing WebAssembly code, but does not yet support asynchronous compilation. This means that the entire WebAssembly program must be fetched before compilation can begin, which leads to longer time loading pages that run WebAssembly programs than in other web browsers. The goal of the project is to support compiling WebAssembly programs asynchronously so compilation can begin while the program is still being fetched from the network.&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo]Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in [https://www.rust-lang.org/ Rust] language. The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc. &lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[https://doc.rust-lang.org/book/index.html Rust] is an open source systems programming language developed by Mozilla. Servo is written in Rust. The main purpose behind its design is to be thread safe and concurrent. The emphasis is also on speed, safety and control of memory layout.&lt;br /&gt;
&lt;br /&gt;
===Web Assembly===&lt;br /&gt;
&lt;br /&gt;
[https://webassembly.org/ WebAssembly] is a new type of code that can be run in modern web browsers — it is a low-level assembly-like language with a compact binary format that runs with near-native performance and provides languages such as C/C++ and Rust with a compilation target so that they can run on the web. It is also designed to run alongside JavaScript, allowing both to work together.&lt;br /&gt;
&lt;br /&gt;
=='''Scope'''==&lt;br /&gt;
&lt;br /&gt;
Major browsers support the WebAssembly standard which can be used to implement performance-sensitive sandboxed applications. Servo is a new, experimental browser that supports synchronously compiling and executing WebAssembly code, but does not yet support asynchronous compilation. This means that the entire WebAssembly program must be fetched before compilation can begin, which leads to longer time loading pages that run WebAssembly programs than in other web browsers. The goal of this work is to support compiling WebAssembly programs asynchronously so compilation can begin while the program is still being fetched from the network.&lt;br /&gt;
&lt;br /&gt;
The scope of this milestone was to complete the initial steps mentioned [https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project here]. The subsequent steps mentioned [https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project here] are to be done for the final project.&lt;br /&gt;
&lt;br /&gt;
The steps for the &amp;lt;b&amp;gt;OSS project&amp;lt;/b&amp;gt; are as follows:&lt;br /&gt;
&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
&lt;br /&gt;
* Create a rust JS::StreamConsumer wrapper that stores a pointer to the object and has methods for consumeChunk, streamEnd, streamError, and noteResponseURLs.&lt;br /&gt;
* Implement an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches ConsumeStreamCallback that initiates the streaming web assembly compilation then creates a wrapper for the stream consumer and stores it in the Response object&lt;br /&gt;
* Implement an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches ReportStreamErrorCallback and reports an error with the error! macro&lt;br /&gt;
* Lastly, call InitStreamConsumerCallback in new_rt_and_cx with the two new functions as arguments, described in the specifications&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Steps.png|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The steps for the &amp;lt;b&amp;gt;final project&amp;lt;/b&amp;gt; are as follows:&lt;br /&gt;
&lt;br /&gt;
* Binding runnable dispatching:&lt;br /&gt;
* Pass network task source into new_rt_and_cx functions&lt;br /&gt;
* Create rust JS::Runnable wrapper that stores a pointer to the object and has a run method that calls the new C function passing the stored pointer&lt;br /&gt;
* Create an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches DispatchToEventLoopCallback that casts the closure argument to a boxed network task source, wraps the runnable pointer in the new struct, and uses the network task source to queue a task that calls the run method of the wrapper&lt;br /&gt;
* Call InitDispatchToEventLoop in new_rt_and_cx_with_parent passing the new function and the boxed network task source as the closure argument /blob/b2f83932fe9d361face14efd03f2465b9262e687/mozjs/js/src/jsapi.h#L2475) in new-rt_and_cx_with_parent passing the new function&lt;br /&gt;
&lt;br /&gt;
* Add a stream consumer wrapper field to Response, and call the streamEnd method in Response::finish&lt;br /&gt;
* Add a stream_chunk method to Response and call it from FetchContext::process_response_chunk; this should invoke the consumeChunk method of the stream consumer wrapper if it exists.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Untitled Diagram.png|center]]&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern'''==&lt;br /&gt;
Design patterns are not applicable as our task involved just implementation of methods. However, the Implementation section below provides details of the steps as why it was implemented, the way it was implemented&lt;br /&gt;
&lt;br /&gt;
=='''Implementation'''==&lt;br /&gt;
The following steps were followed to meet the project requirements as per this [https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project github page].&lt;br /&gt;
&lt;br /&gt;
===OSS Project (Initial Steps)===&lt;br /&gt;
&lt;br /&gt;
===Step 1===&lt;br /&gt;
&lt;br /&gt;
We have implemented a Stream Consumer structure which has the methods for consumeChunk, streamEnd, streamError, and noteResponseURLs based on the Stream Consumer class implemented in the Mozilla Spider Monkey module. &lt;br /&gt;
&lt;br /&gt;
[[File:IS1-1.png]]&lt;br /&gt;
&lt;br /&gt;
The note_response_urls function takes optional arguments as input, if nothing is passed it calls the underlying JS function with null ptr in place of the URLs. &lt;br /&gt;
&lt;br /&gt;
[[File:IS1-2.png]]&lt;br /&gt;
&lt;br /&gt;
===Step 2===&lt;br /&gt;
&lt;br /&gt;
We implemented the consume stream function which checks if a response extracted from the source is valid and returns an appropriate boolean value. The function checks if the response has a valid mime type, is CORS- origin type and has an ok status. if the source cannot be extracted we throw a dom exception and return false.&lt;br /&gt;
&lt;br /&gt;
[[File:IS2-1.png]]&lt;br /&gt;
&lt;br /&gt;
This step checks if the response type is of &amp;quot;default&amp;quot;, &amp;quot;cors&amp;quot; or &amp;quot;basic&amp;quot; type. This step checks the status code of the repsonse. It throws an error if the response is not OK ie. the status is not between 200 and 299.&lt;br /&gt;
&lt;br /&gt;
[[File:IS2-2.png]]&lt;br /&gt;
&lt;br /&gt;
These steps check if the response is locked. If the response is locked, it is not accessible and it throws a type error. If the response's body is already consumed, there is no need to process the response again. The function raises a corresponding type error. &lt;br /&gt;
&lt;br /&gt;
[[File:IS2-3-1.png]]&lt;br /&gt;
&lt;br /&gt;
===Step 3===&lt;br /&gt;
&lt;br /&gt;
The implementation of the ReportStreamErrorCallback function to retrieve and report errors during stream compilation, CompileError, or TypeError in case of invalid Mime type and unprocessable stream.&lt;br /&gt;
&lt;br /&gt;
[[File:IS3.png]]&lt;br /&gt;
&lt;br /&gt;
===Step 4===&lt;br /&gt;
&lt;br /&gt;
The implementation of InitStreamConsumerCallback in new_rt_and_cx_with_parent function. We call the Consume Stream callback added in step 2  and the Report Stream Error Callback added in Step 3 in  new runtime environment.&lt;br /&gt;
&lt;br /&gt;
[[File:IS4.png]]&lt;br /&gt;
&lt;br /&gt;
===Final Project (Subsequent Steps)===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Step 2===&lt;br /&gt;
&lt;br /&gt;
We added a Stream Consumer object defined in the initial steps to the Response structure.&lt;br /&gt;
&lt;br /&gt;
[[File:add_stream_consumer_to_response.png]]&lt;br /&gt;
&lt;br /&gt;
In the Repsonse::finish() method we called the stream_end() function using the Stream Consumer object we recently added.&lt;br /&gt;
&lt;br /&gt;
[[File:add_stream_end_to_finish.png]]&lt;br /&gt;
&lt;br /&gt;
===Step 3===&lt;br /&gt;
&lt;br /&gt;
We added a stream_chunk method in the response class which invokes the consume_chunk() method defined for the StreamConsumer object. This method Asynchronously compiles the WebAssembly module and returns a boolean value based on it's success.&lt;br /&gt;
&lt;br /&gt;
[[File:stream_chunk.png]]&lt;br /&gt;
&lt;br /&gt;
=='''Testing'''==&lt;br /&gt;
&lt;br /&gt;
The code added in the initial steps (scope) is not expected to have any change in behavior on its own. We loaded https://wasm.bootcss.com/demo/Tanks/ to verify that there is no change in behavior due to our changes. &lt;br /&gt;
&lt;br /&gt;
In addition, we have tested our implementation against the servo-provided automated test suite using `./mach test-wpt tests/wpt/web-platform-tests/wasm/webapi` command.&lt;br /&gt;
The following image is the output of the said command:&lt;br /&gt;
&lt;br /&gt;
[[File:Serv_tests.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Following are the steps to compile the implementation to check for any broken code:&lt;br /&gt;
&lt;br /&gt;
# Install the pre-requisites required for servo as mentioned [https://github.com/servo/servo/blob/master/README.md here] &lt;br /&gt;
# Run the following commands&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; &lt;br /&gt;
  cd&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 git clone https://github.com/Akash-Pateria/servo&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 cd servo&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 git checkout -b origin/async-wasm-compilation-initial&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach fmt&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach test-tidy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach build -d&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will see that the servo build is successful and no errors are reported.&lt;br /&gt;
&lt;br /&gt;
=='''Pull Request'''==&lt;br /&gt;
&lt;br /&gt;
===OSS Project (Initial Steps)===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/servo/servo/pull/24563 Pull Request 1] [https://github.com/servo/servo/pull/24653 Pull Request 2]&lt;br /&gt;
&lt;br /&gt;
===Final Project (Subsequent Steps)===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/servo/servo/pull/24757 Pull Request 1] [https://github.com/servo/servo/pull/24977 Pull Request 2]&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/book&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://rustbyexample.com/&amp;lt;br&amp;gt;&lt;br /&gt;
7.    https://webassembly.org/&amp;lt;br&amp;gt;&lt;br /&gt;
8.    https://developer.mozilla.org/en-US/docs/WebAssembly&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rrastog3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Stream_chunk.png&amp;diff=130069</id>
		<title>File:Stream chunk.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Stream_chunk.png&amp;diff=130069"/>
		<updated>2019-12-06T17:49:42Z</updated>

		<summary type="html">&lt;p&gt;Rrastog3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Rrastog3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_M1950._Support_Asynchronous_Web_Assembly_Compilation&amp;diff=130068</id>
		<title>CSC/ECE 517 Fall 2019 - M1950. Support Asynchronous Web Assembly Compilation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_M1950._Support_Asynchronous_Web_Assembly_Compilation&amp;diff=130068"/>
		<updated>2019-12-06T17:49:15Z</updated>

		<summary type="html">&lt;p&gt;Rrastog3: /* Step 3 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Servo is a prototype web browser engine written in the [https://en.wikipedia.org/wiki/Rust_(programming_language) Rust] language. Servo is a new, experimental browser that supports synchronously compiling and executing WebAssembly code, but does not yet support asynchronous compilation. This means that the entire WebAssembly program must be fetched before compilation can begin, which leads to longer time loading pages that run WebAssembly programs than in other web browsers. The goal of the project is to support compiling WebAssembly programs asynchronously so compilation can begin while the program is still being fetched from the network.&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo]Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in [https://www.rust-lang.org/ Rust] language. The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc. &lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[https://doc.rust-lang.org/book/index.html Rust] is an open source systems programming language developed by Mozilla. Servo is written in Rust. The main purpose behind its design is to be thread safe and concurrent. The emphasis is also on speed, safety and control of memory layout.&lt;br /&gt;
&lt;br /&gt;
===Web Assembly===&lt;br /&gt;
&lt;br /&gt;
[https://webassembly.org/ WebAssembly] is a new type of code that can be run in modern web browsers — it is a low-level assembly-like language with a compact binary format that runs with near-native performance and provides languages such as C/C++ and Rust with a compilation target so that they can run on the web. It is also designed to run alongside JavaScript, allowing both to work together.&lt;br /&gt;
&lt;br /&gt;
=='''Scope'''==&lt;br /&gt;
&lt;br /&gt;
Major browsers support the WebAssembly standard which can be used to implement performance-sensitive sandboxed applications. Servo is a new, experimental browser that supports synchronously compiling and executing WebAssembly code, but does not yet support asynchronous compilation. This means that the entire WebAssembly program must be fetched before compilation can begin, which leads to longer time loading pages that run WebAssembly programs than in other web browsers. The goal of this work is to support compiling WebAssembly programs asynchronously so compilation can begin while the program is still being fetched from the network.&lt;br /&gt;
&lt;br /&gt;
The scope of this milestone was to complete the initial steps mentioned [https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project here]. The subsequent steps mentioned [https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project here] are to be done for the final project.&lt;br /&gt;
&lt;br /&gt;
The steps for the &amp;lt;b&amp;gt;OSS project&amp;lt;/b&amp;gt; are as follows:&lt;br /&gt;
&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
&lt;br /&gt;
* Create a rust JS::StreamConsumer wrapper that stores a pointer to the object and has methods for consumeChunk, streamEnd, streamError, and noteResponseURLs.&lt;br /&gt;
* Implement an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches ConsumeStreamCallback that initiates the streaming web assembly compilation then creates a wrapper for the stream consumer and stores it in the Response object&lt;br /&gt;
* Implement an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches ReportStreamErrorCallback and reports an error with the error! macro&lt;br /&gt;
* Lastly, call InitStreamConsumerCallback in new_rt_and_cx with the two new functions as arguments, described in the specifications&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Steps.png|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The steps for the &amp;lt;b&amp;gt;final project&amp;lt;/b&amp;gt; are as follows:&lt;br /&gt;
&lt;br /&gt;
* Binding runnable dispatching:&lt;br /&gt;
* Pass network task source into new_rt_and_cx functions&lt;br /&gt;
* Create rust JS::Runnable wrapper that stores a pointer to the object and has a run method that calls the new C function passing the stored pointer&lt;br /&gt;
* Create an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches DispatchToEventLoopCallback that casts the closure argument to a boxed network task source, wraps the runnable pointer in the new struct, and uses the network task source to queue a task that calls the run method of the wrapper&lt;br /&gt;
* Call InitDispatchToEventLoop in new_rt_and_cx_with_parent passing the new function and the boxed network task source as the closure argument /blob/b2f83932fe9d361face14efd03f2465b9262e687/mozjs/js/src/jsapi.h#L2475) in new-rt_and_cx_with_parent passing the new function&lt;br /&gt;
&lt;br /&gt;
* Add a stream consumer wrapper field to Response, and call the streamEnd method in Response::finish&lt;br /&gt;
* Add a stream_chunk method to Response and call it from FetchContext::process_response_chunk; this should invoke the consumeChunk method of the stream consumer wrapper if it exists.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Untitled Diagram.png|center]]&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern'''==&lt;br /&gt;
Design patterns are not applicable as our task involved just implementation of methods. However, the Implementation section below provides details of the steps as why it was implemented, the way it was implemented&lt;br /&gt;
&lt;br /&gt;
=='''Implementation'''==&lt;br /&gt;
The following steps were followed to meet the project requirements as per this [https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project github page].&lt;br /&gt;
&lt;br /&gt;
===OSS Project (Initial Steps)===&lt;br /&gt;
&lt;br /&gt;
===Step 1===&lt;br /&gt;
&lt;br /&gt;
We have implemented a Stream Consumer structure which has the methods for consumeChunk, streamEnd, streamError, and noteResponseURLs based on the Stream Consumer class implemented in the Mozilla Spider Monkey module. &lt;br /&gt;
&lt;br /&gt;
[[File:IS1-1.png]]&lt;br /&gt;
&lt;br /&gt;
The note_response_urls function takes optional arguments as input, if nothing is passed it calls the underlying JS function with null ptr in place of the URLs. &lt;br /&gt;
&lt;br /&gt;
[[File:IS1-2.png]]&lt;br /&gt;
&lt;br /&gt;
===Step 2===&lt;br /&gt;
&lt;br /&gt;
We implemented the consume stream function which checks if a response extracted from the source is valid and returns an appropriate boolean value. The function checks if the response has a valid mime type, is CORS- origin type and has an ok status. if the source cannot be extracted we throw a dom exception and return false.&lt;br /&gt;
&lt;br /&gt;
[[File:IS2-1.png]]&lt;br /&gt;
&lt;br /&gt;
This step checks if the response type is of &amp;quot;default&amp;quot;, &amp;quot;cors&amp;quot; or &amp;quot;basic&amp;quot; type. This step checks the status code of the repsonse. It throws an error if the response is not OK ie. the status is not between 200 and 299.&lt;br /&gt;
&lt;br /&gt;
[[File:IS2-2.png]]&lt;br /&gt;
&lt;br /&gt;
These steps check if the response is locked. If the response is locked, it is not accessible and it throws a type error. If the response's body is already consumed, there is no need to process the response again. The function raises a corresponding type error. &lt;br /&gt;
&lt;br /&gt;
[[File:IS2-3-1.png]]&lt;br /&gt;
&lt;br /&gt;
===Step 3===&lt;br /&gt;
&lt;br /&gt;
The implementation of the ReportStreamErrorCallback function to retrieve and report errors during stream compilation, CompileError, or TypeError in case of invalid Mime type and unprocessable stream.&lt;br /&gt;
&lt;br /&gt;
[[File:IS3.png]]&lt;br /&gt;
&lt;br /&gt;
===Step 4===&lt;br /&gt;
&lt;br /&gt;
The implementation of InitStreamConsumerCallback in new_rt_and_cx_with_parent function. We call the Consume Stream callback added in step 2  and the Report Stream Error Callback added in Step 3 in  new runtime environment.&lt;br /&gt;
&lt;br /&gt;
[[File:IS4.png]]&lt;br /&gt;
&lt;br /&gt;
===Final Project (Subsequent Steps)===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Step 2===&lt;br /&gt;
&lt;br /&gt;
We added a Stream Consumer object defined in the initial steps to the Response structure.&lt;br /&gt;
&lt;br /&gt;
[[File:add_stream_consumer_to_response.png]]&lt;br /&gt;
&lt;br /&gt;
In the Repsonse::finish() method we called the stream_end() function using the Stream Consumer object we recently added.&lt;br /&gt;
&lt;br /&gt;
[[File:add_stream_end_to_finish.png]]&lt;br /&gt;
&lt;br /&gt;
===Step 3===&lt;br /&gt;
&lt;br /&gt;
We added a stream_chunk method in the response class which invokes the consume_chunk() method defined for the StreamConsumer object. This method Asynchronously compiles the WebAssembly module and returns a boolean value based on it's success.&lt;br /&gt;
&lt;br /&gt;
=='''Testing'''==&lt;br /&gt;
&lt;br /&gt;
The code added in the initial steps (scope) is not expected to have any change in behavior on its own. We loaded https://wasm.bootcss.com/demo/Tanks/ to verify that there is no change in behavior due to our changes. &lt;br /&gt;
&lt;br /&gt;
In addition, we have tested our implementation against the servo-provided automated test suite using `./mach test-wpt tests/wpt/web-platform-tests/wasm/webapi` command.&lt;br /&gt;
The following image is the output of the said command:&lt;br /&gt;
&lt;br /&gt;
[[File:Serv_tests.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Following are the steps to compile the implementation to check for any broken code:&lt;br /&gt;
&lt;br /&gt;
# Install the pre-requisites required for servo as mentioned [https://github.com/servo/servo/blob/master/README.md here] &lt;br /&gt;
# Run the following commands&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; &lt;br /&gt;
  cd&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 git clone https://github.com/Akash-Pateria/servo&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 cd servo&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 git checkout -b origin/async-wasm-compilation-initial&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach fmt&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach test-tidy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach build -d&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will see that the servo build is successful and no errors are reported.&lt;br /&gt;
&lt;br /&gt;
=='''Pull Request'''==&lt;br /&gt;
&lt;br /&gt;
===OSS Project (Initial Steps)===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/servo/servo/pull/24563 Pull Request 1] [https://github.com/servo/servo/pull/24653 Pull Request 2]&lt;br /&gt;
&lt;br /&gt;
===Final Project (Subsequent Steps)===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/servo/servo/pull/24757 Pull Request 1] [https://github.com/servo/servo/pull/24977 Pull Request 2]&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/book&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://rustbyexample.com/&amp;lt;br&amp;gt;&lt;br /&gt;
7.    https://webassembly.org/&amp;lt;br&amp;gt;&lt;br /&gt;
8.    https://developer.mozilla.org/en-US/docs/WebAssembly&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rrastog3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_M1950._Support_Asynchronous_Web_Assembly_Compilation&amp;diff=130059</id>
		<title>CSC/ECE 517 Fall 2019 - M1950. Support Asynchronous Web Assembly Compilation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_M1950._Support_Asynchronous_Web_Assembly_Compilation&amp;diff=130059"/>
		<updated>2019-12-06T17:35:28Z</updated>

		<summary type="html">&lt;p&gt;Rrastog3: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Servo is a prototype web browser engine written in the [https://en.wikipedia.org/wiki/Rust_(programming_language) Rust] language. Servo is a new, experimental browser that supports synchronously compiling and executing WebAssembly code, but does not yet support asynchronous compilation. This means that the entire WebAssembly program must be fetched before compilation can begin, which leads to longer time loading pages that run WebAssembly programs than in other web browsers. The goal of the project is to support compiling WebAssembly programs asynchronously so compilation can begin while the program is still being fetched from the network.&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo]Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in [https://www.rust-lang.org/ Rust] language. The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc. &lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[https://doc.rust-lang.org/book/index.html Rust] is an open source systems programming language developed by Mozilla. Servo is written in Rust. The main purpose behind its design is to be thread safe and concurrent. The emphasis is also on speed, safety and control of memory layout.&lt;br /&gt;
&lt;br /&gt;
===Web Assembly===&lt;br /&gt;
&lt;br /&gt;
[https://webassembly.org/ WebAssembly] is a new type of code that can be run in modern web browsers — it is a low-level assembly-like language with a compact binary format that runs with near-native performance and provides languages such as C/C++ and Rust with a compilation target so that they can run on the web. It is also designed to run alongside JavaScript, allowing both to work together.&lt;br /&gt;
&lt;br /&gt;
=='''Scope'''==&lt;br /&gt;
&lt;br /&gt;
Major browsers support the WebAssembly standard which can be used to implement performance-sensitive sandboxed applications. Servo is a new, experimental browser that supports synchronously compiling and executing WebAssembly code, but does not yet support asynchronous compilation. This means that the entire WebAssembly program must be fetched before compilation can begin, which leads to longer time loading pages that run WebAssembly programs than in other web browsers. The goal of this work is to support compiling WebAssembly programs asynchronously so compilation can begin while the program is still being fetched from the network.&lt;br /&gt;
&lt;br /&gt;
The scope of this milestone was to complete the initial steps mentioned [https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project here]. The subsequent steps mentioned [https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project here] are to be done for the final project.&lt;br /&gt;
&lt;br /&gt;
The steps for the &amp;lt;b&amp;gt;OSS project&amp;lt;/b&amp;gt; are as follows:&lt;br /&gt;
&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
&lt;br /&gt;
* Create a rust JS::StreamConsumer wrapper that stores a pointer to the object and has methods for consumeChunk, streamEnd, streamError, and noteResponseURLs.&lt;br /&gt;
* Implement an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches ConsumeStreamCallback that initiates the streaming web assembly compilation then creates a wrapper for the stream consumer and stores it in the Response object&lt;br /&gt;
* Implement an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches ReportStreamErrorCallback and reports an error with the error! macro&lt;br /&gt;
* Lastly, call InitStreamConsumerCallback in new_rt_and_cx with the two new functions as arguments, described in the specifications&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Steps.png|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The steps for the &amp;lt;b&amp;gt;final project&amp;lt;/b&amp;gt; are as follows:&lt;br /&gt;
&lt;br /&gt;
* Binding runnable dispatching:&lt;br /&gt;
* Pass network task source into new_rt_and_cx functions&lt;br /&gt;
* Create rust JS::Runnable wrapper that stores a pointer to the object and has a run method that calls the new C function passing the stored pointer&lt;br /&gt;
* Create an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches DispatchToEventLoopCallback that casts the closure argument to a boxed network task source, wraps the runnable pointer in the new struct, and uses the network task source to queue a task that calls the run method of the wrapper&lt;br /&gt;
* Call InitDispatchToEventLoop in new_rt_and_cx_with_parent passing the new function and the boxed network task source as the closure argument /blob/b2f83932fe9d361face14efd03f2465b9262e687/mozjs/js/src/jsapi.h#L2475) in new-rt_and_cx_with_parent passing the new function&lt;br /&gt;
&lt;br /&gt;
* Add a stream consumer wrapper field to Response, and call the streamEnd method in Response::finish&lt;br /&gt;
* Add a stream_chunk method to Response and call it from FetchContext::process_response_chunk; this should invoke the consumeChunk method of the stream consumer wrapper if it exists.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Untitled Diagram.png|center]]&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern'''==&lt;br /&gt;
Design patterns are not applicable as our task involved just implementation of methods. However, the Implementation section below provides details of the steps as why it was implemented, the way it was implemented&lt;br /&gt;
&lt;br /&gt;
=='''Implementation'''==&lt;br /&gt;
The following steps were followed to meet the project requirements as per this [https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project github page].&lt;br /&gt;
&lt;br /&gt;
===OSS Project (Initial Steps)===&lt;br /&gt;
&lt;br /&gt;
===Step 1===&lt;br /&gt;
&lt;br /&gt;
We have implemented a Stream Consumer structure which has the methods for consumeChunk, streamEnd, streamError, and noteResponseURLs based on the Stream Consumer class implemented in the Mozilla Spider Monkey module. &lt;br /&gt;
&lt;br /&gt;
[[File:IS1-1.png]]&lt;br /&gt;
&lt;br /&gt;
The note_response_urls function takes optional arguments as input, if nothing is passed it calls the underlying JS function with null ptr in place of the URLs. &lt;br /&gt;
&lt;br /&gt;
[[File:IS1-2.png]]&lt;br /&gt;
&lt;br /&gt;
===Step 2===&lt;br /&gt;
&lt;br /&gt;
We implemented the consume stream function which checks if a response extracted from the source is valid and returns an appropriate boolean value. The function checks if the response has a valid mime type, is CORS- origin type and has an ok status. if the source cannot be extracted we throw a dom exception and return false.&lt;br /&gt;
&lt;br /&gt;
[[File:IS2-1.png]]&lt;br /&gt;
&lt;br /&gt;
This step checks if the response type is of &amp;quot;default&amp;quot;, &amp;quot;cors&amp;quot; or &amp;quot;basic&amp;quot; type. This step checks the status code of the repsonse. It throws an error if the response is not OK ie. the status is not between 200 and 299.&lt;br /&gt;
&lt;br /&gt;
[[File:IS2-2.png]]&lt;br /&gt;
&lt;br /&gt;
These steps check if the response is locked. If the response is locked, it is not accessible and it throws a type error. If the response's body is already consumed, there is no need to process the response again. The function raises a corresponding type error. &lt;br /&gt;
&lt;br /&gt;
[[File:IS2-3-1.png]]&lt;br /&gt;
&lt;br /&gt;
===Step 3===&lt;br /&gt;
&lt;br /&gt;
The implementation of the ReportStreamErrorCallback function to retrieve and report errors during stream compilation, CompileError, or TypeError in case of invalid Mime type and unprocessable stream.&lt;br /&gt;
&lt;br /&gt;
[[File:IS3.png]]&lt;br /&gt;
&lt;br /&gt;
===Step 4===&lt;br /&gt;
&lt;br /&gt;
The implementation of InitStreamConsumerCallback in new_rt_and_cx_with_parent function. We call the Consume Stream callback added in step 2  and the Report Stream Error Callback added in Step 3 in  new runtime environment.&lt;br /&gt;
&lt;br /&gt;
[[File:IS4.png]]&lt;br /&gt;
&lt;br /&gt;
===Final Project (Subsequent Steps)===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Step 2===&lt;br /&gt;
&lt;br /&gt;
We added a Stream Consumer object defined in the initial steps to the Response structure.&lt;br /&gt;
&lt;br /&gt;
[[File:add_stream_consumer_to_response.png]]&lt;br /&gt;
&lt;br /&gt;
In the Repsonse::finish() method we called the stream_end() function using the Stream Consumer object we recently added.&lt;br /&gt;
&lt;br /&gt;
[[File:add_stream_end_to_finish.png]]&lt;br /&gt;
&lt;br /&gt;
===Step 3===&lt;br /&gt;
&lt;br /&gt;
=='''Testing'''==&lt;br /&gt;
&lt;br /&gt;
The code added in the initial steps (scope) is not expected to have any change in behavior on its own. We loaded https://wasm.bootcss.com/demo/Tanks/ to verify that there is no change in behavior due to our changes. &lt;br /&gt;
&lt;br /&gt;
In addition, we have tested our implementation against the servo-provided automated test suite using `./mach test-wpt tests/wpt/web-platform-tests/wasm/webapi` command.&lt;br /&gt;
The following image is the output of the said command:&lt;br /&gt;
&lt;br /&gt;
[[File:Serv_tests.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Following are the steps to compile the implementation to check for any broken code:&lt;br /&gt;
&lt;br /&gt;
# Install the pre-requisites required for servo as mentioned [https://github.com/servo/servo/blob/master/README.md here] &lt;br /&gt;
# Run the following commands&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; &lt;br /&gt;
  cd&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 git clone https://github.com/Akash-Pateria/servo&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 cd servo&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 git checkout -b origin/async-wasm-compilation-initial&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach fmt&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach test-tidy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach build -d&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will see that the servo build is successful and no errors are reported.&lt;br /&gt;
&lt;br /&gt;
=='''Pull Request'''==&lt;br /&gt;
&lt;br /&gt;
===OSS Project (Initial Steps)===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/servo/servo/pull/24563 Pull Request 1] [https://github.com/servo/servo/pull/24653 Pull Request 2]&lt;br /&gt;
&lt;br /&gt;
===Final Project (Subsequent Steps)===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/servo/servo/pull/24757 Pull Request 1] [https://github.com/servo/servo/pull/24977 Pull Request 2]&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/book&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://rustbyexample.com/&amp;lt;br&amp;gt;&lt;br /&gt;
7.    https://webassembly.org/&amp;lt;br&amp;gt;&lt;br /&gt;
8.    https://developer.mozilla.org/en-US/docs/WebAssembly&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rrastog3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Add_stream_end_to_finish.png&amp;diff=130056</id>
		<title>File:Add stream end to finish.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Add_stream_end_to_finish.png&amp;diff=130056"/>
		<updated>2019-12-06T17:32:53Z</updated>

		<summary type="html">&lt;p&gt;Rrastog3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Rrastog3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Add_stream_consumer_to_response.png&amp;diff=130055</id>
		<title>File:Add stream consumer to response.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Add_stream_consumer_to_response.png&amp;diff=130055"/>
		<updated>2019-12-06T17:32:24Z</updated>

		<summary type="html">&lt;p&gt;Rrastog3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Rrastog3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_M1950._Support_Asynchronous_Web_Assembly_Compilation&amp;diff=130054</id>
		<title>CSC/ECE 517 Fall 2019 - M1950. Support Asynchronous Web Assembly Compilation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_M1950._Support_Asynchronous_Web_Assembly_Compilation&amp;diff=130054"/>
		<updated>2019-12-06T17:31:58Z</updated>

		<summary type="html">&lt;p&gt;Rrastog3: /* Step 2 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Servo is a prototype web browser engine written in the [https://en.wikipedia.org/wiki/Rust_(programming_language) Rust] language. Servo is a new, experimental browser that supports synchronously compiling and executing WebAssembly code, but does not yet support asynchronous compilation. This means that the entire WebAssembly program must be fetched before compilation can begin, which leads to longer time loading pages that run WebAssembly programs than in other web browsers. The goal of the project is to support compiling WebAssembly programs asynchronously so compilation can begin while the program is still being fetched from the network.&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo]Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in [https://www.rust-lang.org/ Rust] language. The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc. &lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[https://doc.rust-lang.org/book/index.html Rust] is an open source systems programming language developed by Mozilla. Servo is written in Rust. The main purpose behind its design is to be thread safe and concurrent. The emphasis is also on speed, safety and control of memory layout.&lt;br /&gt;
&lt;br /&gt;
===Web Assembly===&lt;br /&gt;
&lt;br /&gt;
[https://webassembly.org/ WebAssembly] is a new type of code that can be run in modern web browsers — it is a low-level assembly-like language with a compact binary format that runs with near-native performance and provides languages such as C/C++ and Rust with a compilation target so that they can run on the web. It is also designed to run alongside JavaScript, allowing both to work together.&lt;br /&gt;
&lt;br /&gt;
=='''Scope'''==&lt;br /&gt;
&lt;br /&gt;
Major browsers support the WebAssembly standard which can be used to implement performance-sensitive sandboxed applications. Servo is a new, experimental browser that supports synchronously compiling and executing WebAssembly code, but does not yet support asynchronous compilation. This means that the entire WebAssembly program must be fetched before compilation can begin, which leads to longer time loading pages that run WebAssembly programs than in other web browsers. The goal of this work is to support compiling WebAssembly programs asynchronously so compilation can begin while the program is still being fetched from the network.&lt;br /&gt;
&lt;br /&gt;
The scope of this milestone was to complete the initial steps mentioned [https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project here]. The subsequent steps mentioned [https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project here] are to be done for the final project.&lt;br /&gt;
&lt;br /&gt;
The steps for the &amp;lt;b&amp;gt;OSS project&amp;lt;/b&amp;gt; are as follows:&lt;br /&gt;
&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
&lt;br /&gt;
* Create a rust JS::StreamConsumer wrapper that stores a pointer to the object and has methods for consumeChunk, streamEnd, streamError, and noteResponseURLs.&lt;br /&gt;
* Implement an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches ConsumeStreamCallback that initiates the streaming web assembly compilation then creates a wrapper for the stream consumer and stores it in the Response object&lt;br /&gt;
* Implement an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches ReportStreamErrorCallback and reports an error with the error! macro&lt;br /&gt;
* Lastly, call InitStreamConsumerCallback in new_rt_and_cx with the two new functions as arguments, described in the specifications&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Steps.png|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The steps for the &amp;lt;b&amp;gt;final project&amp;lt;/b&amp;gt; are as follows:&lt;br /&gt;
&lt;br /&gt;
* Binding runnable dispatching:&lt;br /&gt;
* Pass network task source into new_rt_and_cx functions&lt;br /&gt;
* Create rust JS::Runnable wrapper that stores a pointer to the object and has a run method that calls the new C function passing the stored pointer&lt;br /&gt;
* Create an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches DispatchToEventLoopCallback that casts the closure argument to a boxed network task source, wraps the runnable pointer in the new struct, and uses the network task source to queue a task that calls the run method of the wrapper&lt;br /&gt;
* Call InitDispatchToEventLoop in new_rt_and_cx_with_parent passing the new function and the boxed network task source as the closure argument /blob/b2f83932fe9d361face14efd03f2465b9262e687/mozjs/js/src/jsapi.h#L2475) in new-rt_and_cx_with_parent passing the new function&lt;br /&gt;
&lt;br /&gt;
* Add a stream consumer wrapper field to Response, and call the streamEnd method in Response::finish&lt;br /&gt;
* Add a stream_chunk method to Response and call it from FetchContext::process_response_chunk; this should invoke the consumeChunk method of the stream consumer wrapper if it exists.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Untitled Diagram.png|center]]&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern'''==&lt;br /&gt;
Design patterns are not applicable as our task involved just implementation of methods. However, the Implementation section below provides details of the steps as why it was implemented, the way it was implemented&lt;br /&gt;
&lt;br /&gt;
=='''Implementation'''==&lt;br /&gt;
The following steps were followed to meet the project requirements as per this [https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project github page].&lt;br /&gt;
&lt;br /&gt;
===OSS Project (Initial Steps)===&lt;br /&gt;
&lt;br /&gt;
===Step 1===&lt;br /&gt;
&lt;br /&gt;
We have implemented a Stream Consumer structure which has the methods for consumeChunk, streamEnd, streamError, and noteResponseURLs based on the Stream Consumer class implemented in the Mozilla Spider Monkey module. &lt;br /&gt;
&lt;br /&gt;
[[File:IS1-1.png]]&lt;br /&gt;
&lt;br /&gt;
The note_response_urls function takes optional arguments as input, if nothing is passed it calls the underlying JS function with null ptr in place of the URLs. &lt;br /&gt;
&lt;br /&gt;
[[File:IS1-2.png]]&lt;br /&gt;
&lt;br /&gt;
===Step 2===&lt;br /&gt;
&lt;br /&gt;
We implemented the consume stream function which checks if a response extracted from the source is valid and returns an appropriate boolean value. The function checks if the response has a valid mime type, is CORS- origin type and has an ok status. if the source cannot be extracted we throw a dom exception and return false.&lt;br /&gt;
&lt;br /&gt;
[[File:IS2-1.png]]&lt;br /&gt;
&lt;br /&gt;
This step checks if the response type is of &amp;quot;default&amp;quot;, &amp;quot;cors&amp;quot; or &amp;quot;basic&amp;quot; type. This step checks the status code of the repsonse. It throws an error if the response is not OK ie. the status is not between 200 and 299.&lt;br /&gt;
&lt;br /&gt;
[[File:IS2-2.png]]&lt;br /&gt;
&lt;br /&gt;
These steps check if the response is locked. If the response is locked, it is not accessible and it throws a type error. If the response's body is already consumed, there is no need to process the response again. The function raises a corresponding type error. &lt;br /&gt;
&lt;br /&gt;
[[File:IS2-3-1.png]]&lt;br /&gt;
&lt;br /&gt;
===Step 3===&lt;br /&gt;
&lt;br /&gt;
The implementation of the ReportStreamErrorCallback function to retrieve and report errors during stream compilation, CompileError, or TypeError in case of invalid Mime type and unprocessable stream.&lt;br /&gt;
&lt;br /&gt;
[[File:IS3.png]]&lt;br /&gt;
&lt;br /&gt;
===Step 4===&lt;br /&gt;
&lt;br /&gt;
The implementation of InitStreamConsumerCallback in new_rt_and_cx_with_parent function. We call the Consume Stream callback added in step 2  and the Report Stream Error Callback added in Step 3 in  new runtime environment.&lt;br /&gt;
&lt;br /&gt;
[[File:IS4.png]]&lt;br /&gt;
&lt;br /&gt;
===Final Project (Subsequent Steps)===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Step 2===&lt;br /&gt;
&lt;br /&gt;
We added a Stream Consumer object defined in the initial steps to the Response structure.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the Repsonse::finish() method we called the stream_end() function using the Stream Consumer object we recently added.&lt;br /&gt;
&lt;br /&gt;
===Step 3===&lt;br /&gt;
&lt;br /&gt;
=='''Testing'''==&lt;br /&gt;
&lt;br /&gt;
The code added in the initial steps (scope) is not expected to have any change in behavior on its own. We loaded https://wasm.bootcss.com/demo/Tanks/ to verify that there is no change in behavior due to our changes. &lt;br /&gt;
&lt;br /&gt;
In addition, we have tested our implementation against the servo-provided automated test suite using `./mach test-wpt tests/wpt/web-platform-tests/wasm/webapi` command.&lt;br /&gt;
The following image is the output of the said command:&lt;br /&gt;
&lt;br /&gt;
[[File:Serv_tests.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Following are the steps to compile the implementation to check for any broken code:&lt;br /&gt;
&lt;br /&gt;
# Install the pre-requisites required for servo as mentioned [https://github.com/servo/servo/blob/master/README.md here] &lt;br /&gt;
# Run the following commands&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; &lt;br /&gt;
  cd&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 git clone https://github.com/Akash-Pateria/servo&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 cd servo&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 git checkout -b origin/async-wasm-compilation-initial&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach fmt&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach test-tidy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach build -d&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will see that the servo build is successful and no errors are reported.&lt;br /&gt;
&lt;br /&gt;
=='''Pull Request'''==&lt;br /&gt;
&lt;br /&gt;
===OSS Project (Initial Steps)===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/servo/servo/pull/24563 Pull Request 1] [https://github.com/servo/servo/pull/24653 Pull Request 2]&lt;br /&gt;
&lt;br /&gt;
===Final Project (Subsequent Steps)===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/servo/servo/pull/24757 Pull Request 1] [https://github.com/servo/servo/pull/24977 Pull Request 2]&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/book&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://rustbyexample.com/&amp;lt;br&amp;gt;&lt;br /&gt;
7.    https://webassembly.org/&amp;lt;br&amp;gt;&lt;br /&gt;
8.    https://developer.mozilla.org/en-US/docs/WebAssembly&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rrastog3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_M1950._Support_Asynchronous_Web_Assembly_Compilation&amp;diff=130048</id>
		<title>CSC/ECE 517 Fall 2019 - M1950. Support Asynchronous Web Assembly Compilation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_M1950._Support_Asynchronous_Web_Assembly_Compilation&amp;diff=130048"/>
		<updated>2019-12-06T17:21:21Z</updated>

		<summary type="html">&lt;p&gt;Rrastog3: /* Final Project (Subsequent Steps) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Servo is a prototype web browser engine written in the [https://en.wikipedia.org/wiki/Rust_(programming_language) Rust] language. Servo is a new, experimental browser that supports synchronously compiling and executing WebAssembly code, but does not yet support asynchronous compilation. This means that the entire WebAssembly program must be fetched before compilation can begin, which leads to longer time loading pages that run WebAssembly programs than in other web browsers. The goal of the project is to support compiling WebAssembly programs asynchronously so compilation can begin while the program is still being fetched from the network.&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo]Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in [https://www.rust-lang.org/ Rust] language. The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc. &lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[https://doc.rust-lang.org/book/index.html Rust] is an open source systems programming language developed by Mozilla. Servo is written in Rust. The main purpose behind its design is to be thread safe and concurrent. The emphasis is also on speed, safety and control of memory layout.&lt;br /&gt;
&lt;br /&gt;
===Web Assembly===&lt;br /&gt;
&lt;br /&gt;
[https://webassembly.org/ WebAssembly] is a new type of code that can be run in modern web browsers — it is a low-level assembly-like language with a compact binary format that runs with near-native performance and provides languages such as C/C++ and Rust with a compilation target so that they can run on the web. It is also designed to run alongside JavaScript, allowing both to work together.&lt;br /&gt;
&lt;br /&gt;
=='''Scope'''==&lt;br /&gt;
&lt;br /&gt;
Major browsers support the WebAssembly standard which can be used to implement performance-sensitive sandboxed applications. Servo is a new, experimental browser that supports synchronously compiling and executing WebAssembly code, but does not yet support asynchronous compilation. This means that the entire WebAssembly program must be fetched before compilation can begin, which leads to longer time loading pages that run WebAssembly programs than in other web browsers. The goal of this work is to support compiling WebAssembly programs asynchronously so compilation can begin while the program is still being fetched from the network.&lt;br /&gt;
&lt;br /&gt;
The scope of this milestone was to complete the initial steps mentioned [https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project here]. The subsequent steps mentioned [https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project here] are to be done for the final project.&lt;br /&gt;
&lt;br /&gt;
The steps for the &amp;lt;b&amp;gt;OSS project&amp;lt;/b&amp;gt; are as follows:&lt;br /&gt;
&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
&lt;br /&gt;
* Create a rust JS::StreamConsumer wrapper that stores a pointer to the object and has methods for consumeChunk, streamEnd, streamError, and noteResponseURLs.&lt;br /&gt;
* Implement an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches ConsumeStreamCallback that initiates the streaming web assembly compilation then creates a wrapper for the stream consumer and stores it in the Response object&lt;br /&gt;
* Implement an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches ReportStreamErrorCallback and reports an error with the error! macro&lt;br /&gt;
* Lastly, call InitStreamConsumerCallback in new_rt_and_cx with the two new functions as arguments, described in the specifications&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Steps.png|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The steps for the &amp;lt;b&amp;gt;final project&amp;lt;/b&amp;gt; are as follows:&lt;br /&gt;
&lt;br /&gt;
* Binding runnable dispatching:&lt;br /&gt;
* Pass network task source into new_rt_and_cx functions&lt;br /&gt;
* Create rust JS::Runnable wrapper that stores a pointer to the object and has a run method that calls the new C function passing the stored pointer&lt;br /&gt;
* Create an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches DispatchToEventLoopCallback that casts the closure argument to a boxed network task source, wraps the runnable pointer in the new struct, and uses the network task source to queue a task that calls the run method of the wrapper&lt;br /&gt;
* Call InitDispatchToEventLoop in new_rt_and_cx_with_parent passing the new function and the boxed network task source as the closure argument /blob/b2f83932fe9d361face14efd03f2465b9262e687/mozjs/js/src/jsapi.h#L2475) in new-rt_and_cx_with_parent passing the new function&lt;br /&gt;
&lt;br /&gt;
* Add a stream consumer wrapper field to Response, and call the streamEnd method in Response::finish&lt;br /&gt;
* Add a stream_chunk method to Response and call it from FetchContext::process_response_chunk; this should invoke the consumeChunk method of the stream consumer wrapper if it exists.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Untitled Diagram.png|center]]&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern'''==&lt;br /&gt;
Design patterns are not applicable as our task involved just implementation of methods. However, the Implementation section below provides details of the steps as why it was implemented, the way it was implemented&lt;br /&gt;
&lt;br /&gt;
=='''Implementation'''==&lt;br /&gt;
The following steps were followed to meet the project requirements as per this [https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project github page].&lt;br /&gt;
&lt;br /&gt;
===OSS Project (Initial Steps)===&lt;br /&gt;
&lt;br /&gt;
===Step 1===&lt;br /&gt;
&lt;br /&gt;
We have implemented a Stream Consumer structure which has the methods for consumeChunk, streamEnd, streamError, and noteResponseURLs based on the Stream Consumer class implemented in the Mozilla Spider Monkey module. &lt;br /&gt;
&lt;br /&gt;
[[File:IS1-1.png]]&lt;br /&gt;
&lt;br /&gt;
The note_response_urls function takes optional arguments as input, if nothing is passed it calls the underlying JS function with null ptr in place of the URLs. &lt;br /&gt;
&lt;br /&gt;
[[File:IS1-2.png]]&lt;br /&gt;
&lt;br /&gt;
===Step 2===&lt;br /&gt;
&lt;br /&gt;
We implemented the consume stream function which checks if a response extracted from the source is valid and returns an appropriate boolean value. The function checks if the response has a valid mime type, is CORS- origin type and has an ok status. if the source cannot be extracted we throw a dom exception and return false.&lt;br /&gt;
&lt;br /&gt;
[[File:IS2-1.png]]&lt;br /&gt;
&lt;br /&gt;
This step checks if the response type is of &amp;quot;default&amp;quot;, &amp;quot;cors&amp;quot; or &amp;quot;basic&amp;quot; type. This step checks the status code of the repsonse. It throws an error if the response is not OK ie. the status is not between 200 and 299.&lt;br /&gt;
&lt;br /&gt;
[[File:IS2-2.png]]&lt;br /&gt;
&lt;br /&gt;
These steps check if the response is locked. If the response is locked, it is not accessible and it throws a type error. If the response's body is already consumed, there is no need to process the response again. The function raises a corresponding type error. &lt;br /&gt;
&lt;br /&gt;
[[File:IS2-3-1.png]]&lt;br /&gt;
&lt;br /&gt;
===Step 3===&lt;br /&gt;
&lt;br /&gt;
The implementation of the ReportStreamErrorCallback function to retrieve and report errors during stream compilation, CompileError, or TypeError in case of invalid Mime type and unprocessable stream.&lt;br /&gt;
&lt;br /&gt;
[[File:IS3.png]]&lt;br /&gt;
&lt;br /&gt;
===Step 4===&lt;br /&gt;
&lt;br /&gt;
The implementation of InitStreamConsumerCallback in new_rt_and_cx_with_parent function. We call the Consume Stream callback added in step 2  and the Report Stream Error Callback added in Step 3 in  new runtime environment.&lt;br /&gt;
&lt;br /&gt;
[[File:IS4.png]]&lt;br /&gt;
&lt;br /&gt;
===Final Project (Subsequent Steps)===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Step 2===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Step 3===&lt;br /&gt;
&lt;br /&gt;
=='''Testing'''==&lt;br /&gt;
&lt;br /&gt;
The code added in the initial steps (scope) is not expected to have any change in behavior on its own. We loaded https://wasm.bootcss.com/demo/Tanks/ to verify that there is no change in behavior due to our changes. &lt;br /&gt;
&lt;br /&gt;
In addition, we have tested our implementation against the servo-provided automated test suite using `./mach test-wpt tests/wpt/web-platform-tests/wasm/webapi` command.&lt;br /&gt;
The following image is the output of the said command:&lt;br /&gt;
&lt;br /&gt;
[[File:Serv_tests.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Following are the steps to compile the implementation to check for any broken code:&lt;br /&gt;
&lt;br /&gt;
# Install the pre-requisites required for servo as mentioned [https://github.com/servo/servo/blob/master/README.md here] &lt;br /&gt;
# Run the following commands&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; &lt;br /&gt;
  cd&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 git clone https://github.com/Akash-Pateria/servo&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 cd servo&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 git checkout -b origin/async-wasm-compilation-initial&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach fmt&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach test-tidy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach build -d&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will see that the servo build is successful and no errors are reported.&lt;br /&gt;
&lt;br /&gt;
=='''Pull Request'''==&lt;br /&gt;
&lt;br /&gt;
===OSS Project (Initial Steps)===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/servo/servo/pull/24563 Pull Request 1] [https://github.com/servo/servo/pull/24653 Pull Request 2]&lt;br /&gt;
&lt;br /&gt;
===Final Project (Subsequent Steps)===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/servo/servo/pull/24757 Pull Request 1] [https://github.com/servo/servo/pull/24977 Pull Request 2]&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/book&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://rustbyexample.com/&amp;lt;br&amp;gt;&lt;br /&gt;
7.    https://webassembly.org/&amp;lt;br&amp;gt;&lt;br /&gt;
8.    https://developer.mozilla.org/en-US/docs/WebAssembly&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rrastog3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_M1950._Support_Asynchronous_Web_Assembly_Compilation&amp;diff=130047</id>
		<title>CSC/ECE 517 Fall 2019 - M1950. Support Asynchronous Web Assembly Compilation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_M1950._Support_Asynchronous_Web_Assembly_Compilation&amp;diff=130047"/>
		<updated>2019-12-06T17:19:04Z</updated>

		<summary type="html">&lt;p&gt;Rrastog3: /* Scope */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Servo is a prototype web browser engine written in the [https://en.wikipedia.org/wiki/Rust_(programming_language) Rust] language. Servo is a new, experimental browser that supports synchronously compiling and executing WebAssembly code, but does not yet support asynchronous compilation. This means that the entire WebAssembly program must be fetched before compilation can begin, which leads to longer time loading pages that run WebAssembly programs than in other web browsers. The goal of the project is to support compiling WebAssembly programs asynchronously so compilation can begin while the program is still being fetched from the network.&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo]Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in [https://www.rust-lang.org/ Rust] language. The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc. &lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[https://doc.rust-lang.org/book/index.html Rust] is an open source systems programming language developed by Mozilla. Servo is written in Rust. The main purpose behind its design is to be thread safe and concurrent. The emphasis is also on speed, safety and control of memory layout.&lt;br /&gt;
&lt;br /&gt;
===Web Assembly===&lt;br /&gt;
&lt;br /&gt;
[https://webassembly.org/ WebAssembly] is a new type of code that can be run in modern web browsers — it is a low-level assembly-like language with a compact binary format that runs with near-native performance and provides languages such as C/C++ and Rust with a compilation target so that they can run on the web. It is also designed to run alongside JavaScript, allowing both to work together.&lt;br /&gt;
&lt;br /&gt;
=='''Scope'''==&lt;br /&gt;
&lt;br /&gt;
Major browsers support the WebAssembly standard which can be used to implement performance-sensitive sandboxed applications. Servo is a new, experimental browser that supports synchronously compiling and executing WebAssembly code, but does not yet support asynchronous compilation. This means that the entire WebAssembly program must be fetched before compilation can begin, which leads to longer time loading pages that run WebAssembly programs than in other web browsers. The goal of this work is to support compiling WebAssembly programs asynchronously so compilation can begin while the program is still being fetched from the network.&lt;br /&gt;
&lt;br /&gt;
The scope of this milestone was to complete the initial steps mentioned [https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project here]. The subsequent steps mentioned [https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project here] are to be done for the final project.&lt;br /&gt;
&lt;br /&gt;
The steps for the &amp;lt;b&amp;gt;OSS project&amp;lt;/b&amp;gt; are as follows:&lt;br /&gt;
&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
&lt;br /&gt;
* Create a rust JS::StreamConsumer wrapper that stores a pointer to the object and has methods for consumeChunk, streamEnd, streamError, and noteResponseURLs.&lt;br /&gt;
* Implement an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches ConsumeStreamCallback that initiates the streaming web assembly compilation then creates a wrapper for the stream consumer and stores it in the Response object&lt;br /&gt;
* Implement an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches ReportStreamErrorCallback and reports an error with the error! macro&lt;br /&gt;
* Lastly, call InitStreamConsumerCallback in new_rt_and_cx with the two new functions as arguments, described in the specifications&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Steps.png|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The steps for the &amp;lt;b&amp;gt;final project&amp;lt;/b&amp;gt; are as follows:&lt;br /&gt;
&lt;br /&gt;
* Binding runnable dispatching:&lt;br /&gt;
* Pass network task source into new_rt_and_cx functions&lt;br /&gt;
* Create rust JS::Runnable wrapper that stores a pointer to the object and has a run method that calls the new C function passing the stored pointer&lt;br /&gt;
* Create an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches DispatchToEventLoopCallback that casts the closure argument to a boxed network task source, wraps the runnable pointer in the new struct, and uses the network task source to queue a task that calls the run method of the wrapper&lt;br /&gt;
* Call InitDispatchToEventLoop in new_rt_and_cx_with_parent passing the new function and the boxed network task source as the closure argument /blob/b2f83932fe9d361face14efd03f2465b9262e687/mozjs/js/src/jsapi.h#L2475) in new-rt_and_cx_with_parent passing the new function&lt;br /&gt;
&lt;br /&gt;
* Add a stream consumer wrapper field to Response, and call the streamEnd method in Response::finish&lt;br /&gt;
* Add a stream_chunk method to Response and call it from FetchContext::process_response_chunk; this should invoke the consumeChunk method of the stream consumer wrapper if it exists.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Untitled Diagram.png|center]]&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern'''==&lt;br /&gt;
Design patterns are not applicable as our task involved just implementation of methods. However, the Implementation section below provides details of the steps as why it was implemented, the way it was implemented&lt;br /&gt;
&lt;br /&gt;
=='''Implementation'''==&lt;br /&gt;
The following steps were followed to meet the project requirements as per this [https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project github page].&lt;br /&gt;
&lt;br /&gt;
===OSS Project (Initial Steps)===&lt;br /&gt;
&lt;br /&gt;
===Step 1===&lt;br /&gt;
&lt;br /&gt;
We have implemented a Stream Consumer structure which has the methods for consumeChunk, streamEnd, streamError, and noteResponseURLs based on the Stream Consumer class implemented in the Mozilla Spider Monkey module. &lt;br /&gt;
&lt;br /&gt;
[[File:IS1-1.png]]&lt;br /&gt;
&lt;br /&gt;
The note_response_urls function takes optional arguments as input, if nothing is passed it calls the underlying JS function with null ptr in place of the URLs. &lt;br /&gt;
&lt;br /&gt;
[[File:IS1-2.png]]&lt;br /&gt;
&lt;br /&gt;
===Step 2===&lt;br /&gt;
&lt;br /&gt;
We implemented the consume stream function which checks if a response extracted from the source is valid and returns an appropriate boolean value. The function checks if the response has a valid mime type, is CORS- origin type and has an ok status. if the source cannot be extracted we throw a dom exception and return false.&lt;br /&gt;
&lt;br /&gt;
[[File:IS2-1.png]]&lt;br /&gt;
&lt;br /&gt;
This step checks if the response type is of &amp;quot;default&amp;quot;, &amp;quot;cors&amp;quot; or &amp;quot;basic&amp;quot; type. This step checks the status code of the repsonse. It throws an error if the response is not OK ie. the status is not between 200 and 299.&lt;br /&gt;
&lt;br /&gt;
[[File:IS2-2.png]]&lt;br /&gt;
&lt;br /&gt;
These steps check if the response is locked. If the response is locked, it is not accessible and it throws a type error. If the response's body is already consumed, there is no need to process the response again. The function raises a corresponding type error. &lt;br /&gt;
&lt;br /&gt;
[[File:IS2-3-1.png]]&lt;br /&gt;
&lt;br /&gt;
===Step 3===&lt;br /&gt;
&lt;br /&gt;
The implementation of the ReportStreamErrorCallback function to retrieve and report errors during stream compilation, CompileError, or TypeError in case of invalid Mime type and unprocessable stream.&lt;br /&gt;
&lt;br /&gt;
[[File:IS3.png]]&lt;br /&gt;
&lt;br /&gt;
===Step 4===&lt;br /&gt;
&lt;br /&gt;
The implementation of InitStreamConsumerCallback in new_rt_and_cx_with_parent function. We call the Consume Stream callback added in step 2  and the Report Stream Error Callback added in Step 3 in  new runtime environment.&lt;br /&gt;
&lt;br /&gt;
[[File:IS4.png]]&lt;br /&gt;
&lt;br /&gt;
===Final Project (Subsequent Steps)===&lt;br /&gt;
&lt;br /&gt;
=='''Testing'''==&lt;br /&gt;
&lt;br /&gt;
The code added in the initial steps (scope) is not expected to have any change in behavior on its own. We loaded https://wasm.bootcss.com/demo/Tanks/ to verify that there is no change in behavior due to our changes. &lt;br /&gt;
&lt;br /&gt;
In addition, we have tested our implementation against the servo-provided automated test suite using `./mach test-wpt tests/wpt/web-platform-tests/wasm/webapi` command.&lt;br /&gt;
The following image is the output of the said command:&lt;br /&gt;
&lt;br /&gt;
[[File:Serv_tests.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Following are the steps to compile the implementation to check for any broken code:&lt;br /&gt;
&lt;br /&gt;
# Install the pre-requisites required for servo as mentioned [https://github.com/servo/servo/blob/master/README.md here] &lt;br /&gt;
# Run the following commands&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; &lt;br /&gt;
  cd&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 git clone https://github.com/Akash-Pateria/servo&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 cd servo&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 git checkout -b origin/async-wasm-compilation-initial&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach fmt&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach test-tidy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach build -d&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will see that the servo build is successful and no errors are reported.&lt;br /&gt;
&lt;br /&gt;
=='''Pull Request'''==&lt;br /&gt;
&lt;br /&gt;
===OSS Project (Initial Steps)===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/servo/servo/pull/24563 Pull Request 1] [https://github.com/servo/servo/pull/24653 Pull Request 2]&lt;br /&gt;
&lt;br /&gt;
===Final Project (Subsequent Steps)===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/servo/servo/pull/24757 Pull Request 1] [https://github.com/servo/servo/pull/24977 Pull Request 2]&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/book&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://rustbyexample.com/&amp;lt;br&amp;gt;&lt;br /&gt;
7.    https://webassembly.org/&amp;lt;br&amp;gt;&lt;br /&gt;
8.    https://developer.mozilla.org/en-US/docs/WebAssembly&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rrastog3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_M1950._Support_Asynchronous_Web_Assembly_Compilation&amp;diff=130046</id>
		<title>CSC/ECE 517 Fall 2019 - M1950. Support Asynchronous Web Assembly Compilation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_M1950._Support_Asynchronous_Web_Assembly_Compilation&amp;diff=130046"/>
		<updated>2019-12-06T17:17:33Z</updated>

		<summary type="html">&lt;p&gt;Rrastog3: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Servo is a prototype web browser engine written in the [https://en.wikipedia.org/wiki/Rust_(programming_language) Rust] language. Servo is a new, experimental browser that supports synchronously compiling and executing WebAssembly code, but does not yet support asynchronous compilation. This means that the entire WebAssembly program must be fetched before compilation can begin, which leads to longer time loading pages that run WebAssembly programs than in other web browsers. The goal of the project is to support compiling WebAssembly programs asynchronously so compilation can begin while the program is still being fetched from the network.&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo]Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in [https://www.rust-lang.org/ Rust] language. The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc. &lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[https://doc.rust-lang.org/book/index.html Rust] is an open source systems programming language developed by Mozilla. Servo is written in Rust. The main purpose behind its design is to be thread safe and concurrent. The emphasis is also on speed, safety and control of memory layout.&lt;br /&gt;
&lt;br /&gt;
===Web Assembly===&lt;br /&gt;
&lt;br /&gt;
[https://webassembly.org/ WebAssembly] is a new type of code that can be run in modern web browsers — it is a low-level assembly-like language with a compact binary format that runs with near-native performance and provides languages such as C/C++ and Rust with a compilation target so that they can run on the web. It is also designed to run alongside JavaScript, allowing both to work together.&lt;br /&gt;
&lt;br /&gt;
=='''Scope'''==&lt;br /&gt;
&lt;br /&gt;
Major browsers support the WebAssembly standard which can be used to implement performance-sensitive sandboxed applications. Servo is a new, experimental browser that supports synchronously compiling and executing WebAssembly code, but does not yet support asynchronous compilation. This means that the entire WebAssembly program must be fetched before compilation can begin, which leads to longer time loading pages that run WebAssembly programs than in other web browsers. The goal of this work is to support compiling WebAssembly programs asynchronously so compilation can begin while the program is still being fetched from the network.&lt;br /&gt;
&lt;br /&gt;
The scope of this milestone was to complete the initial steps mentioned [https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project here]. The subsequent steps mentioned [https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project here] are to be done for the final project.&lt;br /&gt;
&lt;br /&gt;
The steps for the OSS project are as follows:&lt;br /&gt;
&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
&lt;br /&gt;
* Create a rust JS::StreamConsumer wrapper that stores a pointer to the object and has methods for consumeChunk, streamEnd, streamError, and noteResponseURLs.&lt;br /&gt;
* Implement an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches ConsumeStreamCallback that initiates the streaming web assembly compilation then creates a wrapper for the stream consumer and stores it in the Response object&lt;br /&gt;
* Implement an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches ReportStreamErrorCallback and reports an error with the error! macro&lt;br /&gt;
* Lastly, call InitStreamConsumerCallback in new_rt_and_cx with the two new functions as arguments, described in the specifications&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Steps.png|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The steps for the final project are as follows:&lt;br /&gt;
&lt;br /&gt;
* Binding runnable dispatching:&lt;br /&gt;
* Pass network task source into new_rt_and_cx functions&lt;br /&gt;
* Create rust JS::Runnable wrapper that stores a pointer to the object and has a run method that calls the new C function passing the stored pointer&lt;br /&gt;
* Create an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches DispatchToEventLoopCallback that casts the closure argument to a boxed network task source, wraps the runnable pointer in the new struct, and uses the network task source to queue a task that calls the run method of the wrapper&lt;br /&gt;
* Call InitDispatchToEventLoop in new_rt_and_cx_with_parent passing the new function and the boxed network task source as the closure argument /blob/b2f83932fe9d361face14efd03f2465b9262e687/mozjs/js/src/jsapi.h#L2475) in new-rt_and_cx_with_parent passing the new function&lt;br /&gt;
&lt;br /&gt;
* Add a stream consumer wrapper field to Response, and call the streamEnd method in Response::finish&lt;br /&gt;
* Add a stream_chunk method to Response and call it from FetchContext::process_response_chunk; this should invoke the consumeChunk method of the stream consumer wrapper if it exists.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Untitled Diagram.png|center]]&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern'''==&lt;br /&gt;
Design patterns are not applicable as our task involved just implementation of methods. However, the Implementation section below provides details of the steps as why it was implemented, the way it was implemented&lt;br /&gt;
&lt;br /&gt;
=='''Implementation'''==&lt;br /&gt;
The following steps were followed to meet the project requirements as per this [https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project github page].&lt;br /&gt;
&lt;br /&gt;
===OSS Project (Initial Steps)===&lt;br /&gt;
&lt;br /&gt;
===Step 1===&lt;br /&gt;
&lt;br /&gt;
We have implemented a Stream Consumer structure which has the methods for consumeChunk, streamEnd, streamError, and noteResponseURLs based on the Stream Consumer class implemented in the Mozilla Spider Monkey module. &lt;br /&gt;
&lt;br /&gt;
[[File:IS1-1.png]]&lt;br /&gt;
&lt;br /&gt;
The note_response_urls function takes optional arguments as input, if nothing is passed it calls the underlying JS function with null ptr in place of the URLs. &lt;br /&gt;
&lt;br /&gt;
[[File:IS1-2.png]]&lt;br /&gt;
&lt;br /&gt;
===Step 2===&lt;br /&gt;
&lt;br /&gt;
We implemented the consume stream function which checks if a response extracted from the source is valid and returns an appropriate boolean value. The function checks if the response has a valid mime type, is CORS- origin type and has an ok status. if the source cannot be extracted we throw a dom exception and return false.&lt;br /&gt;
&lt;br /&gt;
[[File:IS2-1.png]]&lt;br /&gt;
&lt;br /&gt;
This step checks if the response type is of &amp;quot;default&amp;quot;, &amp;quot;cors&amp;quot; or &amp;quot;basic&amp;quot; type. This step checks the status code of the repsonse. It throws an error if the response is not OK ie. the status is not between 200 and 299.&lt;br /&gt;
&lt;br /&gt;
[[File:IS2-2.png]]&lt;br /&gt;
&lt;br /&gt;
These steps check if the response is locked. If the response is locked, it is not accessible and it throws a type error. If the response's body is already consumed, there is no need to process the response again. The function raises a corresponding type error. &lt;br /&gt;
&lt;br /&gt;
[[File:IS2-3-1.png]]&lt;br /&gt;
&lt;br /&gt;
===Step 3===&lt;br /&gt;
&lt;br /&gt;
The implementation of the ReportStreamErrorCallback function to retrieve and report errors during stream compilation, CompileError, or TypeError in case of invalid Mime type and unprocessable stream.&lt;br /&gt;
&lt;br /&gt;
[[File:IS3.png]]&lt;br /&gt;
&lt;br /&gt;
===Step 4===&lt;br /&gt;
&lt;br /&gt;
The implementation of InitStreamConsumerCallback in new_rt_and_cx_with_parent function. We call the Consume Stream callback added in step 2  and the Report Stream Error Callback added in Step 3 in  new runtime environment.&lt;br /&gt;
&lt;br /&gt;
[[File:IS4.png]]&lt;br /&gt;
&lt;br /&gt;
===Final Project (Subsequent Steps)===&lt;br /&gt;
&lt;br /&gt;
=='''Testing'''==&lt;br /&gt;
&lt;br /&gt;
The code added in the initial steps (scope) is not expected to have any change in behavior on its own. We loaded https://wasm.bootcss.com/demo/Tanks/ to verify that there is no change in behavior due to our changes. &lt;br /&gt;
&lt;br /&gt;
In addition, we have tested our implementation against the servo-provided automated test suite using `./mach test-wpt tests/wpt/web-platform-tests/wasm/webapi` command.&lt;br /&gt;
The following image is the output of the said command:&lt;br /&gt;
&lt;br /&gt;
[[File:Serv_tests.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Following are the steps to compile the implementation to check for any broken code:&lt;br /&gt;
&lt;br /&gt;
# Install the pre-requisites required for servo as mentioned [https://github.com/servo/servo/blob/master/README.md here] &lt;br /&gt;
# Run the following commands&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; &lt;br /&gt;
  cd&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 git clone https://github.com/Akash-Pateria/servo&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 cd servo&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 git checkout -b origin/async-wasm-compilation-initial&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach fmt&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach test-tidy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach build -d&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will see that the servo build is successful and no errors are reported.&lt;br /&gt;
&lt;br /&gt;
=='''Pull Request'''==&lt;br /&gt;
&lt;br /&gt;
===OSS Project (Initial Steps)===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/servo/servo/pull/24563 Pull Request 1] [https://github.com/servo/servo/pull/24653 Pull Request 2]&lt;br /&gt;
&lt;br /&gt;
===Final Project (Subsequent Steps)===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/servo/servo/pull/24757 Pull Request 1] [https://github.com/servo/servo/pull/24977 Pull Request 2]&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/book&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://rustbyexample.com/&amp;lt;br&amp;gt;&lt;br /&gt;
7.    https://webassembly.org/&amp;lt;br&amp;gt;&lt;br /&gt;
8.    https://developer.mozilla.org/en-US/docs/WebAssembly&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rrastog3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_M1950._Support_Asynchronous_Web_Assembly_Compilation&amp;diff=130043</id>
		<title>CSC/ECE 517 Fall 2019 - M1950. Support Asynchronous Web Assembly Compilation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_M1950._Support_Asynchronous_Web_Assembly_Compilation&amp;diff=130043"/>
		<updated>2019-12-06T17:16:44Z</updated>

		<summary type="html">&lt;p&gt;Rrastog3: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Servo is a prototype web browser engine written in the [https://en.wikipedia.org/wiki/Rust_(programming_language) Rust] language. Servo is a new, experimental browser that supports synchronously compiling and executing WebAssembly code, but does not yet support asynchronous compilation. This means that the entire WebAssembly program must be fetched before compilation can begin, which leads to longer time loading pages that run WebAssembly programs than in other web browsers. The goal of the project is to support compiling WebAssembly programs asynchronously so compilation can begin while the program is still being fetched from the network.&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo]Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in [https://www.rust-lang.org/ Rust] language. The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc. &lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[https://doc.rust-lang.org/book/index.html Rust] is an open source systems programming language developed by Mozilla. Servo is written in Rust. The main purpose behind its design is to be thread safe and concurrent. The emphasis is also on speed, safety and control of memory layout.&lt;br /&gt;
&lt;br /&gt;
===Web Assembly===&lt;br /&gt;
&lt;br /&gt;
[https://webassembly.org/ WebAssembly] is a new type of code that can be run in modern web browsers — it is a low-level assembly-like language with a compact binary format that runs with near-native performance and provides languages such as C/C++ and Rust with a compilation target so that they can run on the web. It is also designed to run alongside JavaScript, allowing both to work together.&lt;br /&gt;
&lt;br /&gt;
=='''Scope'''==&lt;br /&gt;
&lt;br /&gt;
Major browsers support the WebAssembly standard which can be used to implement performance-sensitive sandboxed applications. Servo is a new, experimental browser that supports synchronously compiling and executing WebAssembly code, but does not yet support asynchronous compilation. This means that the entire WebAssembly program must be fetched before compilation can begin, which leads to longer time loading pages that run WebAssembly programs than in other web browsers. The goal of this work is to support compiling WebAssembly programs asynchronously so compilation can begin while the program is still being fetched from the network.&lt;br /&gt;
&lt;br /&gt;
The scope of this milestone was to complete the initial steps mentioned [https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project here]. The subsequent steps mentioned [https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project here] are to be done for the final project.&lt;br /&gt;
&lt;br /&gt;
The steps for the OSS project are as follows:&lt;br /&gt;
&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
&lt;br /&gt;
* Create a rust JS::StreamConsumer wrapper that stores a pointer to the object and has methods for consumeChunk, streamEnd, streamError, and noteResponseURLs.&lt;br /&gt;
* Implement an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches ConsumeStreamCallback that initiates the streaming web assembly compilation then creates a wrapper for the stream consumer and stores it in the Response object&lt;br /&gt;
* Implement an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches ReportStreamErrorCallback and reports an error with the error! macro&lt;br /&gt;
* Lastly, call InitStreamConsumerCallback in new_rt_and_cx with the two new functions as arguments, described in the specifications&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Steps.png|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The steps for the final project are as follows:&lt;br /&gt;
&lt;br /&gt;
* Binding runnable dispatching:&lt;br /&gt;
* Pass network task source into new_rt_and_cx functions&lt;br /&gt;
* Create rust JS::Runnable wrapper that stores a pointer to the object and has a run method that calls the new C function passing the stored pointer&lt;br /&gt;
* Create an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches DispatchToEventLoopCallback that casts the closure argument to a boxed network task source, wraps the runnable pointer in the new struct, and uses the network task source to queue a task that calls the run method of the wrapper&lt;br /&gt;
* Call InitDispatchToEventLoop in new_rt_and_cx_with_parent passing the new function and the boxed network task source as the closure argument /blob/b2f83932fe9d361face14efd03f2465b9262e687/mozjs/js/src/jsapi.h#L2475) in new-rt_and_cx_with_parent passing the new function&lt;br /&gt;
&lt;br /&gt;
* Add a stream consumer wrapper field to Response, and call the streamEnd method in Response::finish&lt;br /&gt;
* Add a stream_chunk method to Response and call it from FetchContext::process_response_chunk; this should invoke the consumeChunk method of the stream consumer wrapper if it exists.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Untitled Diagram.png|center]]&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern'''==&lt;br /&gt;
Design patterns are not applicable as our task involved just implementation of methods. However, the Implementation section below provides details of the steps as why it was implemented, the way it was implemented&lt;br /&gt;
&lt;br /&gt;
=='''Implementation'''==&lt;br /&gt;
The following steps were followed to meet the project requirements as per this [https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project github page].&lt;br /&gt;
&lt;br /&gt;
===OSS Project (Initial Steps)===&lt;br /&gt;
&lt;br /&gt;
===Step 1===&lt;br /&gt;
&lt;br /&gt;
We have implemented a Stream Consumer structure which has the methods for consumeChunk, streamEnd, streamError, and noteResponseURLs based on the Stream Consumer class implemented in the Mozilla Spider Monkey module. &lt;br /&gt;
&lt;br /&gt;
[[File:IS1-1.png]]&lt;br /&gt;
&lt;br /&gt;
The note_response_urls function takes optional arguments as input, if nothing is passed it calls the underlying JS function with null ptr in place of the URLs. &lt;br /&gt;
&lt;br /&gt;
[[File:IS1-2.png]]&lt;br /&gt;
&lt;br /&gt;
===Step 2===&lt;br /&gt;
&lt;br /&gt;
We implemented the consume stream function which checks if a response extracted from the source is valid and returns an appropriate boolean value. The function checks if the response has a valid mime type, is CORS- origin type and has an ok status. if the source cannot be extracted we throw a dom exception and return false.&lt;br /&gt;
&lt;br /&gt;
[[File:IS2-1.png]]&lt;br /&gt;
&lt;br /&gt;
This step checks if the response type is of &amp;quot;default&amp;quot;, &amp;quot;cors&amp;quot; or &amp;quot;basic&amp;quot; type. This step checks the status code of the repsonse. It throws an error if the response is not OK ie. the status is not between 200 and 299.&lt;br /&gt;
&lt;br /&gt;
[[File:IS2-2.png]]&lt;br /&gt;
&lt;br /&gt;
These steps check if the response is locked. If the response is locked, it is not accessible and it throws a type error. If the response's body is already consumed, there is no need to process the response again. The function raises a corresponding type error. &lt;br /&gt;
&lt;br /&gt;
[[File:IS2-3-1.png]]&lt;br /&gt;
&lt;br /&gt;
===Step 3===&lt;br /&gt;
&lt;br /&gt;
The implementation of the ReportStreamErrorCallback function to retrieve and report errors during stream compilation, CompileError, or TypeError in case of invalid Mime type and unprocessable stream.&lt;br /&gt;
&lt;br /&gt;
[[File:IS3.png]]&lt;br /&gt;
&lt;br /&gt;
===Step 4===&lt;br /&gt;
&lt;br /&gt;
The implementation of InitStreamConsumerCallback in new_rt_and_cx_with_parent function. We call the Consume Stream callback added in step 2  and the Report Stream Error Callback added in Step 3 in  new runtime environment.&lt;br /&gt;
&lt;br /&gt;
[[File:IS4.png]]&lt;br /&gt;
&lt;br /&gt;
===Final Project (Subsequent Steps)===&lt;br /&gt;
&lt;br /&gt;
=='''Testing'''==&lt;br /&gt;
&lt;br /&gt;
The code added in the initial steps (scope) is not expected to have any change in behavior on its own. We loaded https://wasm.bootcss.com/demo/Tanks/ to verify that there is no change in behavior due to our changes. &lt;br /&gt;
&lt;br /&gt;
In addition, we have tested our implementation against the servo-provided automated test suite using `./mach test-wpt tests/wpt/web-platform-tests/wasm/webapi` command.&lt;br /&gt;
The following image is the output of the said command:&lt;br /&gt;
&lt;br /&gt;
[[File:Serv_tests.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Following are the steps to compile the implementation to check for any broken code:&lt;br /&gt;
&lt;br /&gt;
# Install the pre-requisites required for servo as mentioned [https://github.com/servo/servo/blob/master/README.md here] &lt;br /&gt;
# Run the following commands&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; &lt;br /&gt;
  cd&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 git clone https://github.com/Akash-Pateria/servo&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 cd servo&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 git checkout -b origin/async-wasm-compilation-initial&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach fmt&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach test-tidy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach build -d&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will see that the servo build is successful and no errors are reported.&lt;br /&gt;
&lt;br /&gt;
=='''Pull Request'''==&lt;br /&gt;
&lt;br /&gt;
===OSS Project (Initial Steps)===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/servo/servo/pull/24563 Pull Request 1] [https://github.com/servo/servo/pull/24653 Pull Request 2]&lt;br /&gt;
&lt;br /&gt;
===Final Project (Subsequent Steps)===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/servo/servo/pull/24757 Pull Request 1] [https://github.com/servo/servo/pull/24977 Pull Request 2]&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/book&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://rustbyexample.com/&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rrastog3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_M1950._Support_Asynchronous_Web_Assembly_Compilation&amp;diff=130042</id>
		<title>CSC/ECE 517 Fall 2019 - M1950. Support Asynchronous Web Assembly Compilation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_M1950._Support_Asynchronous_Web_Assembly_Compilation&amp;diff=130042"/>
		<updated>2019-12-06T17:13:21Z</updated>

		<summary type="html">&lt;p&gt;Rrastog3: /* Pull Request */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Servo is a prototype web browser engine written in the [https://en.wikipedia.org/wiki/Rust_(programming_language) Rust] language. Servo is a new, experimental browser that supports synchronously compiling and executing WebAssembly code, but does not yet support asynchronous compilation. This means that the entire WebAssembly program must be fetched before compilation can begin, which leads to longer time loading pages that run WebAssembly programs than in other web browsers. The goal of the project is to support compiling WebAssembly programs asynchronously so compilation can begin while the program is still being fetched from the network.&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo]Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in [https://www.rust-lang.org/ Rust] language. The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc. &lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[https://doc.rust-lang.org/book/index.html Rust] is an open source systems programming language developed by Mozilla. Servo is written in Rust. The main purpose behind its design is to be thread safe and concurrent. The emphasis is also on speed, safety and control of memory layout.&lt;br /&gt;
&lt;br /&gt;
=='''Scope'''==&lt;br /&gt;
&lt;br /&gt;
Major browsers support the WebAssembly standard which can be used to implement performance-sensitive sandboxed applications. Servo is a new, experimental browser that supports synchronously compiling and executing WebAssembly code, but does not yet support asynchronous compilation. This means that the entire WebAssembly program must be fetched before compilation can begin, which leads to longer time loading pages that run WebAssembly programs than in other web browsers. The goal of this work is to support compiling WebAssembly programs asynchronously so compilation can begin while the program is still being fetched from the network.&lt;br /&gt;
&lt;br /&gt;
The scope of this milestone was to complete the initial steps mentioned [https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project here]. The subsequent steps mentioned [https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project here] are to be done for the final project.&lt;br /&gt;
&lt;br /&gt;
The steps for the OSS project are as follows:&lt;br /&gt;
&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
&lt;br /&gt;
* Create a rust JS::StreamConsumer wrapper that stores a pointer to the object and has methods for consumeChunk, streamEnd, streamError, and noteResponseURLs.&lt;br /&gt;
* Implement an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches ConsumeStreamCallback that initiates the streaming web assembly compilation then creates a wrapper for the stream consumer and stores it in the Response object&lt;br /&gt;
* Implement an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches ReportStreamErrorCallback and reports an error with the error! macro&lt;br /&gt;
* Lastly, call InitStreamConsumerCallback in new_rt_and_cx with the two new functions as arguments, described in the specifications&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Steps.png|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The steps for the final project are as follows:&lt;br /&gt;
&lt;br /&gt;
* Binding runnable dispatching:&lt;br /&gt;
* Pass network task source into new_rt_and_cx functions&lt;br /&gt;
* Create rust JS::Runnable wrapper that stores a pointer to the object and has a run method that calls the new C function passing the stored pointer&lt;br /&gt;
* Create an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches DispatchToEventLoopCallback that casts the closure argument to a boxed network task source, wraps the runnable pointer in the new struct, and uses the network task source to queue a task that calls the run method of the wrapper&lt;br /&gt;
* Call InitDispatchToEventLoop in new_rt_and_cx_with_parent passing the new function and the boxed network task source as the closure argument /blob/b2f83932fe9d361face14efd03f2465b9262e687/mozjs/js/src/jsapi.h#L2475) in new-rt_and_cx_with_parent passing the new function&lt;br /&gt;
&lt;br /&gt;
* Add a stream consumer wrapper field to Response, and call the streamEnd method in Response::finish&lt;br /&gt;
* Add a stream_chunk method to Response and call it from FetchContext::process_response_chunk; this should invoke the consumeChunk method of the stream consumer wrapper if it exists.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Untitled Diagram.png|center]]&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern'''==&lt;br /&gt;
Design patterns are not applicable as our task involved just implementation of methods. However, the Implementation section below provides details of the steps as why it was implemented, the way it was implemented&lt;br /&gt;
&lt;br /&gt;
=='''Implementation'''==&lt;br /&gt;
The following steps were followed to meet the project requirements as per this [https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project github page].&lt;br /&gt;
&lt;br /&gt;
===OSS Project (Initial Steps)===&lt;br /&gt;
&lt;br /&gt;
===Step 1===&lt;br /&gt;
&lt;br /&gt;
We have implemented a Stream Consumer structure which has the methods for consumeChunk, streamEnd, streamError, and noteResponseURLs based on the Stream Consumer class implemented in the Mozilla Spider Monkey module. &lt;br /&gt;
&lt;br /&gt;
[[File:IS1-1.png]]&lt;br /&gt;
&lt;br /&gt;
The note_response_urls function takes optional arguments as input, if nothing is passed it calls the underlying JS function with null ptr in place of the URLs. &lt;br /&gt;
&lt;br /&gt;
[[File:IS1-2.png]]&lt;br /&gt;
&lt;br /&gt;
===Step 2===&lt;br /&gt;
&lt;br /&gt;
We implemented the consume stream function which checks if a response extracted from the source is valid and returns an appropriate boolean value. The function checks if the response has a valid mime type, is CORS- origin type and has an ok status. if the source cannot be extracted we throw a dom exception and return false.&lt;br /&gt;
&lt;br /&gt;
[[File:IS2-1.png]]&lt;br /&gt;
&lt;br /&gt;
This step checks if the response type is of &amp;quot;default&amp;quot;, &amp;quot;cors&amp;quot; or &amp;quot;basic&amp;quot; type. This step checks the status code of the repsonse. It throws an error if the response is not OK ie. the status is not between 200 and 299.&lt;br /&gt;
&lt;br /&gt;
[[File:IS2-2.png]]&lt;br /&gt;
&lt;br /&gt;
These steps check if the response is locked. If the response is locked, it is not accessible and it throws a type error. If the response's body is already consumed, there is no need to process the response again. The function raises a corresponding type error. &lt;br /&gt;
&lt;br /&gt;
[[File:IS2-3-1.png]]&lt;br /&gt;
&lt;br /&gt;
===Step 3===&lt;br /&gt;
&lt;br /&gt;
The implementation of the ReportStreamErrorCallback function to retrieve and report errors during stream compilation, CompileError, or TypeError in case of invalid Mime type and unprocessable stream.&lt;br /&gt;
&lt;br /&gt;
[[File:IS3.png]]&lt;br /&gt;
&lt;br /&gt;
===Step 4===&lt;br /&gt;
&lt;br /&gt;
The implementation of InitStreamConsumerCallback in new_rt_and_cx_with_parent function. We call the Consume Stream callback added in step 2  and the Report Stream Error Callback added in Step 3 in  new runtime environment.&lt;br /&gt;
&lt;br /&gt;
[[File:IS4.png]]&lt;br /&gt;
&lt;br /&gt;
===Final Project (Subsequent Steps)===&lt;br /&gt;
&lt;br /&gt;
=='''Testing'''==&lt;br /&gt;
&lt;br /&gt;
The code added in the initial steps (scope) is not expected to have any change in behavior on its own. We loaded https://wasm.bootcss.com/demo/Tanks/ to verify that there is no change in behavior due to our changes. &lt;br /&gt;
&lt;br /&gt;
In addition, we have tested our implementation against the servo-provided automated test suite using `./mach test-wpt tests/wpt/web-platform-tests/wasm/webapi` command.&lt;br /&gt;
The following image is the output of the said command:&lt;br /&gt;
&lt;br /&gt;
[[File:Serv_tests.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Following are the steps to compile the implementation to check for any broken code:&lt;br /&gt;
&lt;br /&gt;
# Install the pre-requisites required for servo as mentioned [https://github.com/servo/servo/blob/master/README.md here] &lt;br /&gt;
# Run the following commands&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; &lt;br /&gt;
  cd&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 git clone https://github.com/Akash-Pateria/servo&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 cd servo&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 git checkout -b origin/async-wasm-compilation-initial&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach fmt&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach test-tidy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach build -d&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will see that the servo build is successful and no errors are reported.&lt;br /&gt;
&lt;br /&gt;
=='''Pull Request'''==&lt;br /&gt;
&lt;br /&gt;
===OSS Project (Initial Steps)===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/servo/servo/pull/24563 Pull Request 1] [https://github.com/servo/servo/pull/24653 Pull Request 2]&lt;br /&gt;
&lt;br /&gt;
===Final Project (Subsequent Steps)===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/servo/servo/pull/24757 Pull Request 1] [https://github.com/servo/servo/pull/24977 Pull Request 2]&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/book&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://rustbyexample.com/&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rrastog3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_M1950._Support_Asynchronous_Web_Assembly_Compilation&amp;diff=130041</id>
		<title>CSC/ECE 517 Fall 2019 - M1950. Support Asynchronous Web Assembly Compilation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_M1950._Support_Asynchronous_Web_Assembly_Compilation&amp;diff=130041"/>
		<updated>2019-12-06T17:12:57Z</updated>

		<summary type="html">&lt;p&gt;Rrastog3: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Servo is a prototype web browser engine written in the [https://en.wikipedia.org/wiki/Rust_(programming_language) Rust] language. Servo is a new, experimental browser that supports synchronously compiling and executing WebAssembly code, but does not yet support asynchronous compilation. This means that the entire WebAssembly program must be fetched before compilation can begin, which leads to longer time loading pages that run WebAssembly programs than in other web browsers. The goal of the project is to support compiling WebAssembly programs asynchronously so compilation can begin while the program is still being fetched from the network.&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo]Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in [https://www.rust-lang.org/ Rust] language. The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc. &lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[https://doc.rust-lang.org/book/index.html Rust] is an open source systems programming language developed by Mozilla. Servo is written in Rust. The main purpose behind its design is to be thread safe and concurrent. The emphasis is also on speed, safety and control of memory layout.&lt;br /&gt;
&lt;br /&gt;
=='''Scope'''==&lt;br /&gt;
&lt;br /&gt;
Major browsers support the WebAssembly standard which can be used to implement performance-sensitive sandboxed applications. Servo is a new, experimental browser that supports synchronously compiling and executing WebAssembly code, but does not yet support asynchronous compilation. This means that the entire WebAssembly program must be fetched before compilation can begin, which leads to longer time loading pages that run WebAssembly programs than in other web browsers. The goal of this work is to support compiling WebAssembly programs asynchronously so compilation can begin while the program is still being fetched from the network.&lt;br /&gt;
&lt;br /&gt;
The scope of this milestone was to complete the initial steps mentioned [https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project here]. The subsequent steps mentioned [https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project here] are to be done for the final project.&lt;br /&gt;
&lt;br /&gt;
The steps for the OSS project are as follows:&lt;br /&gt;
&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
&lt;br /&gt;
* Create a rust JS::StreamConsumer wrapper that stores a pointer to the object and has methods for consumeChunk, streamEnd, streamError, and noteResponseURLs.&lt;br /&gt;
* Implement an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches ConsumeStreamCallback that initiates the streaming web assembly compilation then creates a wrapper for the stream consumer and stores it in the Response object&lt;br /&gt;
* Implement an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches ReportStreamErrorCallback and reports an error with the error! macro&lt;br /&gt;
* Lastly, call InitStreamConsumerCallback in new_rt_and_cx with the two new functions as arguments, described in the specifications&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Steps.png|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The steps for the final project are as follows:&lt;br /&gt;
&lt;br /&gt;
* Binding runnable dispatching:&lt;br /&gt;
* Pass network task source into new_rt_and_cx functions&lt;br /&gt;
* Create rust JS::Runnable wrapper that stores a pointer to the object and has a run method that calls the new C function passing the stored pointer&lt;br /&gt;
* Create an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches DispatchToEventLoopCallback that casts the closure argument to a boxed network task source, wraps the runnable pointer in the new struct, and uses the network task source to queue a task that calls the run method of the wrapper&lt;br /&gt;
* Call InitDispatchToEventLoop in new_rt_and_cx_with_parent passing the new function and the boxed network task source as the closure argument /blob/b2f83932fe9d361face14efd03f2465b9262e687/mozjs/js/src/jsapi.h#L2475) in new-rt_and_cx_with_parent passing the new function&lt;br /&gt;
&lt;br /&gt;
* Add a stream consumer wrapper field to Response, and call the streamEnd method in Response::finish&lt;br /&gt;
* Add a stream_chunk method to Response and call it from FetchContext::process_response_chunk; this should invoke the consumeChunk method of the stream consumer wrapper if it exists.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Untitled Diagram.png|center]]&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern'''==&lt;br /&gt;
Design patterns are not applicable as our task involved just implementation of methods. However, the Implementation section below provides details of the steps as why it was implemented, the way it was implemented&lt;br /&gt;
&lt;br /&gt;
=='''Implementation'''==&lt;br /&gt;
The following steps were followed to meet the project requirements as per this [https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project github page].&lt;br /&gt;
&lt;br /&gt;
===OSS Project (Initial Steps)===&lt;br /&gt;
&lt;br /&gt;
===Step 1===&lt;br /&gt;
&lt;br /&gt;
We have implemented a Stream Consumer structure which has the methods for consumeChunk, streamEnd, streamError, and noteResponseURLs based on the Stream Consumer class implemented in the Mozilla Spider Monkey module. &lt;br /&gt;
&lt;br /&gt;
[[File:IS1-1.png]]&lt;br /&gt;
&lt;br /&gt;
The note_response_urls function takes optional arguments as input, if nothing is passed it calls the underlying JS function with null ptr in place of the URLs. &lt;br /&gt;
&lt;br /&gt;
[[File:IS1-2.png]]&lt;br /&gt;
&lt;br /&gt;
===Step 2===&lt;br /&gt;
&lt;br /&gt;
We implemented the consume stream function which checks if a response extracted from the source is valid and returns an appropriate boolean value. The function checks if the response has a valid mime type, is CORS- origin type and has an ok status. if the source cannot be extracted we throw a dom exception and return false.&lt;br /&gt;
&lt;br /&gt;
[[File:IS2-1.png]]&lt;br /&gt;
&lt;br /&gt;
This step checks if the response type is of &amp;quot;default&amp;quot;, &amp;quot;cors&amp;quot; or &amp;quot;basic&amp;quot; type. This step checks the status code of the repsonse. It throws an error if the response is not OK ie. the status is not between 200 and 299.&lt;br /&gt;
&lt;br /&gt;
[[File:IS2-2.png]]&lt;br /&gt;
&lt;br /&gt;
These steps check if the response is locked. If the response is locked, it is not accessible and it throws a type error. If the response's body is already consumed, there is no need to process the response again. The function raises a corresponding type error. &lt;br /&gt;
&lt;br /&gt;
[[File:IS2-3-1.png]]&lt;br /&gt;
&lt;br /&gt;
===Step 3===&lt;br /&gt;
&lt;br /&gt;
The implementation of the ReportStreamErrorCallback function to retrieve and report errors during stream compilation, CompileError, or TypeError in case of invalid Mime type and unprocessable stream.&lt;br /&gt;
&lt;br /&gt;
[[File:IS3.png]]&lt;br /&gt;
&lt;br /&gt;
===Step 4===&lt;br /&gt;
&lt;br /&gt;
The implementation of InitStreamConsumerCallback in new_rt_and_cx_with_parent function. We call the Consume Stream callback added in step 2  and the Report Stream Error Callback added in Step 3 in  new runtime environment.&lt;br /&gt;
&lt;br /&gt;
[[File:IS4.png]]&lt;br /&gt;
&lt;br /&gt;
===Final Project (Subsequent Steps)===&lt;br /&gt;
&lt;br /&gt;
=='''Testing'''==&lt;br /&gt;
&lt;br /&gt;
The code added in the initial steps (scope) is not expected to have any change in behavior on its own. We loaded https://wasm.bootcss.com/demo/Tanks/ to verify that there is no change in behavior due to our changes. &lt;br /&gt;
&lt;br /&gt;
In addition, we have tested our implementation against the servo-provided automated test suite using `./mach test-wpt tests/wpt/web-platform-tests/wasm/webapi` command.&lt;br /&gt;
The following image is the output of the said command:&lt;br /&gt;
&lt;br /&gt;
[[File:Serv_tests.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Following are the steps to compile the implementation to check for any broken code:&lt;br /&gt;
&lt;br /&gt;
# Install the pre-requisites required for servo as mentioned [https://github.com/servo/servo/blob/master/README.md here] &lt;br /&gt;
# Run the following commands&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; &lt;br /&gt;
  cd&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 git clone https://github.com/Akash-Pateria/servo&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 cd servo&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 git checkout -b origin/async-wasm-compilation-initial&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach fmt&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach test-tidy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach build -d&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will see that the servo build is successful and no errors are reported.&lt;br /&gt;
&lt;br /&gt;
=='''Pull Request'''==&lt;br /&gt;
&lt;br /&gt;
OSS Project (Initial Steps):&lt;br /&gt;
&lt;br /&gt;
[https://github.com/servo/servo/pull/24563 Pull Request 1] [https://github.com/servo/servo/pull/24653 Pull Request 2]&lt;br /&gt;
&lt;br /&gt;
Final Project (Subsequent Steps):&lt;br /&gt;
&lt;br /&gt;
[https://github.com/servo/servo/pull/24757 Pull Request 1] [https://github.com/servo/servo/pull/24977 Pull Request 2]&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/book&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://rustbyexample.com/&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rrastog3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_M1950._Support_Asynchronous_Web_Assembly_Compilation&amp;diff=130040</id>
		<title>CSC/ECE 517 Fall 2019 - M1950. Support Asynchronous Web Assembly Compilation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_M1950._Support_Asynchronous_Web_Assembly_Compilation&amp;diff=130040"/>
		<updated>2019-12-06T17:11:41Z</updated>

		<summary type="html">&lt;p&gt;Rrastog3: /* Pull Request */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Servo is a prototype web browser engine written in the [https://en.wikipedia.org/wiki/Rust_(programming_language) Rust] language. Servo is a new, experimental browser that supports synchronously compiling and executing WebAssembly code, but does not yet support asynchronous compilation. This means that the entire WebAssembly program must be fetched before compilation can begin, which leads to longer time loading pages that run WebAssembly programs than in other web browsers. The goal of the project is to support compiling WebAssembly programs asynchronously so compilation can begin while the program is still being fetched from the network.&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo]Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in [https://www.rust-lang.org/ Rust] language. The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc. &lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[https://doc.rust-lang.org/book/index.html Rust] is an open source systems programming language developed by Mozilla. Servo is written in Rust. The main purpose behind its design is to be thread safe and concurrent. The emphasis is also on speed, safety and control of memory layout.&lt;br /&gt;
&lt;br /&gt;
=='''Scope'''==&lt;br /&gt;
&lt;br /&gt;
Major browsers support the WebAssembly standard which can be used to implement performance-sensitive sandboxed applications. Servo is a new, experimental browser that supports synchronously compiling and executing WebAssembly code, but does not yet support asynchronous compilation. This means that the entire WebAssembly program must be fetched before compilation can begin, which leads to longer time loading pages that run WebAssembly programs than in other web browsers. The goal of this work is to support compiling WebAssembly programs asynchronously so compilation can begin while the program is still being fetched from the network.&lt;br /&gt;
&lt;br /&gt;
The scope of this milestone was to complete the initial steps mentioned [https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project here]. The subsequent steps mentioned [https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project here] are to be done for the final project.&lt;br /&gt;
&lt;br /&gt;
The steps for the OSS project are as follows:&lt;br /&gt;
&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
&lt;br /&gt;
* Create a rust JS::StreamConsumer wrapper that stores a pointer to the object and has methods for consumeChunk, streamEnd, streamError, and noteResponseURLs.&lt;br /&gt;
* Implement an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches ConsumeStreamCallback that initiates the streaming web assembly compilation then creates a wrapper for the stream consumer and stores it in the Response object&lt;br /&gt;
* Implement an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches ReportStreamErrorCallback and reports an error with the error! macro&lt;br /&gt;
* Lastly, call InitStreamConsumerCallback in new_rt_and_cx with the two new functions as arguments, described in the specifications&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Steps.png|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The steps for the final project are as follows:&lt;br /&gt;
&lt;br /&gt;
* Binding runnable dispatching:&lt;br /&gt;
* Pass network task source into new_rt_and_cx functions&lt;br /&gt;
* Create rust JS::Runnable wrapper that stores a pointer to the object and has a run method that calls the new C function passing the stored pointer&lt;br /&gt;
* Create an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches DispatchToEventLoopCallback that casts the closure argument to a boxed network task source, wraps the runnable pointer in the new struct, and uses the network task source to queue a task that calls the run method of the wrapper&lt;br /&gt;
* Call InitDispatchToEventLoop in new_rt_and_cx_with_parent passing the new function and the boxed network task source as the closure argument /blob/b2f83932fe9d361face14efd03f2465b9262e687/mozjs/js/src/jsapi.h#L2475) in new-rt_and_cx_with_parent passing the new function&lt;br /&gt;
&lt;br /&gt;
* Add a stream consumer wrapper field to Response, and call the streamEnd method in Response::finish&lt;br /&gt;
* Add a stream_chunk method to Response and call it from FetchContext::process_response_chunk; this should invoke the consumeChunk method of the stream consumer wrapper if it exists.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Untitled Diagram.png|center]]&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern'''==&lt;br /&gt;
Design patterns are not applicable as our task involved just implementation of methods. However, the Implementation section below provides details of the steps as why it was implemented, the way it was implemented&lt;br /&gt;
&lt;br /&gt;
=='''Implementation'''==&lt;br /&gt;
The following steps were followed to meet the project requirements as per this [https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project github page].&lt;br /&gt;
&lt;br /&gt;
===Step 1===&lt;br /&gt;
&lt;br /&gt;
We have implemented a Stream Consumer structure which has the methods for consumeChunk, streamEnd, streamError, and noteResponseURLs based on the Stream Consumer class implemented in the Mozilla Spider Monkey module. &lt;br /&gt;
&lt;br /&gt;
[[File:IS1-1.png]]&lt;br /&gt;
&lt;br /&gt;
The note_response_urls function takes optional arguments as input, if nothing is passed it calls the underlying JS function with null ptr in place of the URLs. &lt;br /&gt;
&lt;br /&gt;
[[File:IS1-2.png]]&lt;br /&gt;
&lt;br /&gt;
===Step 2===&lt;br /&gt;
&lt;br /&gt;
We implemented the consume stream function which checks if a response extracted from the source is valid and returns an appropriate boolean value. The function checks if the response has a valid mime type, is CORS- origin type and has an ok status. if the source cannot be extracted we throw a dom exception and return false.&lt;br /&gt;
&lt;br /&gt;
[[File:IS2-1.png]]&lt;br /&gt;
&lt;br /&gt;
This step checks if the response type is of &amp;quot;default&amp;quot;, &amp;quot;cors&amp;quot; or &amp;quot;basic&amp;quot; type. This step checks the status code of the repsonse. It throws an error if the response is not OK ie. the status is not between 200 and 299.&lt;br /&gt;
&lt;br /&gt;
[[File:IS2-2.png]]&lt;br /&gt;
&lt;br /&gt;
These steps check if the response is locked. If the response is locked, it is not accessible and it throws a type error. If the response's body is already consumed, there is no need to process the response again. The function raises a corresponding type error. &lt;br /&gt;
&lt;br /&gt;
[[File:IS2-3-1.png]]&lt;br /&gt;
&lt;br /&gt;
===Step 3===&lt;br /&gt;
&lt;br /&gt;
The implementation of the ReportStreamErrorCallback function to retrieve and report errors during stream compilation, CompileError, or TypeError in case of invalid Mime type and unprocessable stream.&lt;br /&gt;
&lt;br /&gt;
[[File:IS3.png]]&lt;br /&gt;
&lt;br /&gt;
===Step 4===&lt;br /&gt;
&lt;br /&gt;
The implementation of InitStreamConsumerCallback in new_rt_and_cx_with_parent function. We call the Consume Stream callback added in step 2  and the Report Stream Error Callback added in Step 3 in  new runtime environment.&lt;br /&gt;
&lt;br /&gt;
[[File:IS4.png]]&lt;br /&gt;
&lt;br /&gt;
=='''Testing'''==&lt;br /&gt;
&lt;br /&gt;
The code added in the initial steps (scope) is not expected to have any change in behavior on its own. We loaded https://wasm.bootcss.com/demo/Tanks/ to verify that there is no change in behavior due to our changes. &lt;br /&gt;
&lt;br /&gt;
In addition, we have tested our implementation against the servo-provided automated test suite using `./mach test-wpt tests/wpt/web-platform-tests/wasm/webapi` command.&lt;br /&gt;
The following image is the output of the said command:&lt;br /&gt;
&lt;br /&gt;
[[File:Serv_tests.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Following are the steps to compile the implementation to check for any broken code:&lt;br /&gt;
&lt;br /&gt;
# Install the pre-requisites required for servo as mentioned [https://github.com/servo/servo/blob/master/README.md here] &lt;br /&gt;
# Run the following commands&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; &lt;br /&gt;
  cd&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 git clone https://github.com/Akash-Pateria/servo&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 cd servo&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 git checkout -b origin/async-wasm-compilation-initial&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach fmt&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach test-tidy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach build -d&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will see that the servo build is successful and no errors are reported.&lt;br /&gt;
&lt;br /&gt;
=='''Pull Request'''==&lt;br /&gt;
&lt;br /&gt;
OSS Project (Initial Steps):&lt;br /&gt;
&lt;br /&gt;
[https://github.com/servo/servo/pull/24563 Pull Request 1] [https://github.com/servo/servo/pull/24653 Pull Request 2]&lt;br /&gt;
&lt;br /&gt;
Final Project (Subsequent Steps):&lt;br /&gt;
&lt;br /&gt;
[https://github.com/servo/servo/pull/24757 Pull Request 1] [https://github.com/servo/servo/pull/24977 Pull Request 2]&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/book&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://rustbyexample.com/&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rrastog3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_M1950._Support_Asynchronous_Web_Assembly_Compilation&amp;diff=130039</id>
		<title>CSC/ECE 517 Fall 2019 - M1950. Support Asynchronous Web Assembly Compilation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_M1950._Support_Asynchronous_Web_Assembly_Compilation&amp;diff=130039"/>
		<updated>2019-12-06T17:11:19Z</updated>

		<summary type="html">&lt;p&gt;Rrastog3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Servo is a prototype web browser engine written in the [https://en.wikipedia.org/wiki/Rust_(programming_language) Rust] language. Servo is a new, experimental browser that supports synchronously compiling and executing WebAssembly code, but does not yet support asynchronous compilation. This means that the entire WebAssembly program must be fetched before compilation can begin, which leads to longer time loading pages that run WebAssembly programs than in other web browsers. The goal of the project is to support compiling WebAssembly programs asynchronously so compilation can begin while the program is still being fetched from the network.&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo]Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in [https://www.rust-lang.org/ Rust] language. The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc. &lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[https://doc.rust-lang.org/book/index.html Rust] is an open source systems programming language developed by Mozilla. Servo is written in Rust. The main purpose behind its design is to be thread safe and concurrent. The emphasis is also on speed, safety and control of memory layout.&lt;br /&gt;
&lt;br /&gt;
=='''Scope'''==&lt;br /&gt;
&lt;br /&gt;
Major browsers support the WebAssembly standard which can be used to implement performance-sensitive sandboxed applications. Servo is a new, experimental browser that supports synchronously compiling and executing WebAssembly code, but does not yet support asynchronous compilation. This means that the entire WebAssembly program must be fetched before compilation can begin, which leads to longer time loading pages that run WebAssembly programs than in other web browsers. The goal of this work is to support compiling WebAssembly programs asynchronously so compilation can begin while the program is still being fetched from the network.&lt;br /&gt;
&lt;br /&gt;
The scope of this milestone was to complete the initial steps mentioned [https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project here]. The subsequent steps mentioned [https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project here] are to be done for the final project.&lt;br /&gt;
&lt;br /&gt;
The steps for the OSS project are as follows:&lt;br /&gt;
&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
&lt;br /&gt;
* Create a rust JS::StreamConsumer wrapper that stores a pointer to the object and has methods for consumeChunk, streamEnd, streamError, and noteResponseURLs.&lt;br /&gt;
* Implement an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches ConsumeStreamCallback that initiates the streaming web assembly compilation then creates a wrapper for the stream consumer and stores it in the Response object&lt;br /&gt;
* Implement an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches ReportStreamErrorCallback and reports an error with the error! macro&lt;br /&gt;
* Lastly, call InitStreamConsumerCallback in new_rt_and_cx with the two new functions as arguments, described in the specifications&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Steps.png|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The steps for the final project are as follows:&lt;br /&gt;
&lt;br /&gt;
* Binding runnable dispatching:&lt;br /&gt;
* Pass network task source into new_rt_and_cx functions&lt;br /&gt;
* Create rust JS::Runnable wrapper that stores a pointer to the object and has a run method that calls the new C function passing the stored pointer&lt;br /&gt;
* Create an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches DispatchToEventLoopCallback that casts the closure argument to a boxed network task source, wraps the runnable pointer in the new struct, and uses the network task source to queue a task that calls the run method of the wrapper&lt;br /&gt;
* Call InitDispatchToEventLoop in new_rt_and_cx_with_parent passing the new function and the boxed network task source as the closure argument /blob/b2f83932fe9d361face14efd03f2465b9262e687/mozjs/js/src/jsapi.h#L2475) in new-rt_and_cx_with_parent passing the new function&lt;br /&gt;
&lt;br /&gt;
* Add a stream consumer wrapper field to Response, and call the streamEnd method in Response::finish&lt;br /&gt;
* Add a stream_chunk method to Response and call it from FetchContext::process_response_chunk; this should invoke the consumeChunk method of the stream consumer wrapper if it exists.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Untitled Diagram.png|center]]&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern'''==&lt;br /&gt;
Design patterns are not applicable as our task involved just implementation of methods. However, the Implementation section below provides details of the steps as why it was implemented, the way it was implemented&lt;br /&gt;
&lt;br /&gt;
=='''Implementation'''==&lt;br /&gt;
The following steps were followed to meet the project requirements as per this [https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project github page].&lt;br /&gt;
&lt;br /&gt;
===Step 1===&lt;br /&gt;
&lt;br /&gt;
We have implemented a Stream Consumer structure which has the methods for consumeChunk, streamEnd, streamError, and noteResponseURLs based on the Stream Consumer class implemented in the Mozilla Spider Monkey module. &lt;br /&gt;
&lt;br /&gt;
[[File:IS1-1.png]]&lt;br /&gt;
&lt;br /&gt;
The note_response_urls function takes optional arguments as input, if nothing is passed it calls the underlying JS function with null ptr in place of the URLs. &lt;br /&gt;
&lt;br /&gt;
[[File:IS1-2.png]]&lt;br /&gt;
&lt;br /&gt;
===Step 2===&lt;br /&gt;
&lt;br /&gt;
We implemented the consume stream function which checks if a response extracted from the source is valid and returns an appropriate boolean value. The function checks if the response has a valid mime type, is CORS- origin type and has an ok status. if the source cannot be extracted we throw a dom exception and return false.&lt;br /&gt;
&lt;br /&gt;
[[File:IS2-1.png]]&lt;br /&gt;
&lt;br /&gt;
This step checks if the response type is of &amp;quot;default&amp;quot;, &amp;quot;cors&amp;quot; or &amp;quot;basic&amp;quot; type. This step checks the status code of the repsonse. It throws an error if the response is not OK ie. the status is not between 200 and 299.&lt;br /&gt;
&lt;br /&gt;
[[File:IS2-2.png]]&lt;br /&gt;
&lt;br /&gt;
These steps check if the response is locked. If the response is locked, it is not accessible and it throws a type error. If the response's body is already consumed, there is no need to process the response again. The function raises a corresponding type error. &lt;br /&gt;
&lt;br /&gt;
[[File:IS2-3-1.png]]&lt;br /&gt;
&lt;br /&gt;
===Step 3===&lt;br /&gt;
&lt;br /&gt;
The implementation of the ReportStreamErrorCallback function to retrieve and report errors during stream compilation, CompileError, or TypeError in case of invalid Mime type and unprocessable stream.&lt;br /&gt;
&lt;br /&gt;
[[File:IS3.png]]&lt;br /&gt;
&lt;br /&gt;
===Step 4===&lt;br /&gt;
&lt;br /&gt;
The implementation of InitStreamConsumerCallback in new_rt_and_cx_with_parent function. We call the Consume Stream callback added in step 2  and the Report Stream Error Callback added in Step 3 in  new runtime environment.&lt;br /&gt;
&lt;br /&gt;
[[File:IS4.png]]&lt;br /&gt;
&lt;br /&gt;
=='''Testing'''==&lt;br /&gt;
&lt;br /&gt;
The code added in the initial steps (scope) is not expected to have any change in behavior on its own. We loaded https://wasm.bootcss.com/demo/Tanks/ to verify that there is no change in behavior due to our changes. &lt;br /&gt;
&lt;br /&gt;
In addition, we have tested our implementation against the servo-provided automated test suite using `./mach test-wpt tests/wpt/web-platform-tests/wasm/webapi` command.&lt;br /&gt;
The following image is the output of the said command:&lt;br /&gt;
&lt;br /&gt;
[[File:Serv_tests.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Following are the steps to compile the implementation to check for any broken code:&lt;br /&gt;
&lt;br /&gt;
# Install the pre-requisites required for servo as mentioned [https://github.com/servo/servo/blob/master/README.md here] &lt;br /&gt;
# Run the following commands&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; &lt;br /&gt;
  cd&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 git clone https://github.com/Akash-Pateria/servo&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 cd servo&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 git checkout -b origin/async-wasm-compilation-initial&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach fmt&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach test-tidy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach build -d&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will see that the servo build is successful and no errors are reported.&lt;br /&gt;
&lt;br /&gt;
=='''Pull Request'''==&lt;br /&gt;
&lt;br /&gt;
OSS Project (Initial Steps):&lt;br /&gt;
&lt;br /&gt;
[https://github.com/servo/servo/pull/24563 Pull Request 1] [https://github.com/servo/servo/pull/24653 Pull Request 2]&lt;br /&gt;
&lt;br /&gt;
Final Project (Subsequent Steps):&lt;br /&gt;
&lt;br /&gt;
[https://github.com/servo/servo/pull/24757 Pull Request 1] [https://github.com/servo/servo/pull/24977 Pull Request 2]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/book&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://rustbyexample.com/&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rrastog3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_M1950._Support_Asynchronous_Web_Assembly_Compilation&amp;diff=128334</id>
		<title>CSC/ECE 517 Fall 2019 - M1950. Support Asynchronous Web Assembly Compilation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_M1950._Support_Asynchronous_Web_Assembly_Compilation&amp;diff=128334"/>
		<updated>2019-11-11T00:38:41Z</updated>

		<summary type="html">&lt;p&gt;Rrastog3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Servo is a prototype web browser engine written in the [https://en.wikipedia.org/wiki/Rust_(programming_language) Rust] language. Servo is a new, experimental browser that supports synchronously compiling and executing WebAssembly code, but does not yet support asynchronous compilation. This means that the entire WebAssembly program must be fetched before compilation can begin, which leads to longer time loading pages that run WebAssembly programs than in other web browsers. The goal of the project is to support compiling WebAssembly programs asynchronously so compilation can begin while the program is still being fetched from the network.&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo]Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in [https://www.rust-lang.org/ Rust] language. The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc. &lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[https://doc.rust-lang.org/book/index.html Rust] is an open source systems programming language developed by Mozilla. Servo is written in Rust. The main purpose behind it's design is to be thread safe and concurrent. The emphasis is also on speed, safety and control of memory layout.&lt;br /&gt;
&lt;br /&gt;
=='''Scope'''==&lt;br /&gt;
&lt;br /&gt;
Major browsers support the WebAssembly standard which can be used to implement performance-sensitive sandboxed applications. Servo is a new, experimental browser that supports synchronously compiling and executing WebAssembly code, but does not yet support asynchronous compilation. This means that the entire WebAssembly program must be fetched before compilation can begin, which leads to longer time loading pages that run WebAssembly programs than in other web browsers. The goal of this work is to support compiling WebAssembly programs asynchronously so compilation can begin while the program is still being fetched from the network.&lt;br /&gt;
&lt;br /&gt;
The scope of this milestone was to complete the initial steps mentioned [https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project here]. The subsequent steps mentioned [https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project here] are to be done for the final project.&lt;br /&gt;
&lt;br /&gt;
The steps are as follows:&lt;br /&gt;
&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
&lt;br /&gt;
* Create a rust JS::StreamConsumer wrapper that stores a pointer to the object and has methods for consumeChunk, streamEnd, streamError, and noteResponseURLs.&lt;br /&gt;
* Implement an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches ConsumeStreamCallback that initiates the streaming webassembly compilation then creates a wrapper for the stream consumer and stores it in the Response object&lt;br /&gt;
* Implement an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches ReportStreamErrorCallback and reports an error with the error! macro&lt;br /&gt;
* Lastly, call InitStreamConsumerCallback in new_rt_and_cx with the two new functions as arguments, described in the specifications&lt;br /&gt;
&lt;br /&gt;
The steps involved in the project scope are depicted below:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Steps.png|center]]&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern'''==&lt;br /&gt;
Design patterns are not applicable as our task involved just implementation of methods. However, the Implementation section below provides details of the steps as why it was implemented, the way it was implemented&lt;br /&gt;
&lt;br /&gt;
=='''Implementation'''==&lt;br /&gt;
The following steps were followed to meet the project requirements as per this [https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project github page].&lt;br /&gt;
&lt;br /&gt;
===Step 1===&lt;br /&gt;
&lt;br /&gt;
We have implemented a Stream Consumer structure which has the methods for consumeChunk, streamEnd, streamError, and noteResponseURLs based on the Stream Consumer class implemented in the Mozilla Spider Monkey module. &lt;br /&gt;
&lt;br /&gt;
[[File:IS1-1.png]]&lt;br /&gt;
&lt;br /&gt;
The note_response_urls function takes optional arguments as input, if nothing is passed it calls the underlying JS function with null ptr in place of the URLs. &lt;br /&gt;
&lt;br /&gt;
[[File:IS1-2.png]]&lt;br /&gt;
&lt;br /&gt;
===Step 2===&lt;br /&gt;
&lt;br /&gt;
We implemented the consume stream function which checks if a response extracted from the source is valid and returns an appropriate boolean value. The function checks if the response has a valid mime type, is CORS- origin type and has an ok status. if the source cannot be extracted we throw a dom exception and return false.&lt;br /&gt;
&lt;br /&gt;
[[File:IS2-1.png]]&lt;br /&gt;
&lt;br /&gt;
This step checks if the response type is of &amp;quot;default&amp;quot;, &amp;quot;cors&amp;quot; or &amp;quot;basic&amp;quot; type. This step checks the status code of the repsonse. It throws an error if the response is not OK ie. the status is not between 200 and 299.&lt;br /&gt;
&lt;br /&gt;
[[File:IS2-2.png]]&lt;br /&gt;
&lt;br /&gt;
These steps check if the response is locked. If the response is locked, it is not accessible and it throws a type error. If the response's body is already consumed, there is no need to process the response again. The function raises a corresponding type error. &lt;br /&gt;
&lt;br /&gt;
[[File:IS2-3-1.png]]&lt;br /&gt;
&lt;br /&gt;
===Step 3===&lt;br /&gt;
&lt;br /&gt;
The implementation of the ReportStreamErrorCallback function to retrieve and report errors during stream compilation, CompileError, or TypeError in case of invalid Mime type and unprocessable stream.&lt;br /&gt;
&lt;br /&gt;
[[File:IS3.png]]&lt;br /&gt;
&lt;br /&gt;
===Step 4===&lt;br /&gt;
&lt;br /&gt;
The implementation of InitStreamConsumerCallback in new_rt_and_cx_with_parent function. We call the Consume Stream callback added in step 2  and the Report Stream Error Callback added in Step 3 in  new runtime environment.&lt;br /&gt;
&lt;br /&gt;
[[File:IS4.png]]&lt;br /&gt;
&lt;br /&gt;
=='''Testing'''==&lt;br /&gt;
&lt;br /&gt;
The code added in the initial steps(scope) is not expected to have any change in behavior on its own. We loaded https://wasm.bootcss.com/demo/Tanks/ to verify that there is no change in behavior due to our changes. &lt;br /&gt;
&lt;br /&gt;
In addition, we have tested our implementation against the servo-provided automated test suite using `./mach test-wpt tests/wpt/web-platform-tests/wasm/webapi` command.&lt;br /&gt;
The following image is the output of the said command:&lt;br /&gt;
&lt;br /&gt;
[[File:Serv_tests.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Following are the steps to compile the implementation to check for any broken code:&lt;br /&gt;
&lt;br /&gt;
# Install the pre-requisites required for servo as mentioned [https://github.com/servo/servo/blob/master/README.md here] &lt;br /&gt;
# Run the following commands&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; &lt;br /&gt;
  cd&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 git clone https://github.com/Akash-Pateria/servo&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 cd servo&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 git checkout -b origin/async-wasm-compilation-initial&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach fmt&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach test-tidy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach build -d&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will see that the servo build is successful and no errors are reported.&lt;br /&gt;
&lt;br /&gt;
=='''Pull Request'''==&lt;br /&gt;
&lt;br /&gt;
Here is our [https://github.com/servo/servo/pull/24563 pull request] which has been merged in Servo master branch. We have raised [https://github.com/servo/servo/pull/24653 another pull request](currently in review state), containing the implementation of the remaining initial steps.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/book&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://rustbyexample.com/&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rrastog3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_M1950._Support_Asynchronous_Web_Assembly_Compilation&amp;diff=128237</id>
		<title>CSC/ECE 517 Fall 2019 - M1950. Support Asynchronous Web Assembly Compilation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_M1950._Support_Asynchronous_Web_Assembly_Compilation&amp;diff=128237"/>
		<updated>2019-11-10T22:46:29Z</updated>

		<summary type="html">&lt;p&gt;Rrastog3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Servo is a prototype web browser engine written in the [https://en.wikipedia.org/wiki/Rust_(programming_language) Rust] language. Servo is a new, experimental browser that supports synchronously compiling and executing WebAssembly code, but does not yet support asynchronous compilation. This means that the entire WebAssembly program must be fetched before compilation can begin, which leads to longer time loading pages that run WebAssembly programs than in other web browsers. The goal of the project is to support compiling WebAssembly programs asynchronously so compilation can begin while the program is still being fetched from the network.&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo]Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in [https://www.rust-lang.org/ Rust] language. The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc. &lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[https://doc.rust-lang.org/book/index.html Rust] is an open source systems programming language developed by Mozilla. Servo is written in Rust. The main purpose behind it's design is to be thread safe and concurrent. The emphasis is also on speed, safety and control of memory layout.&lt;br /&gt;
&lt;br /&gt;
=='''Scope'''==&lt;br /&gt;
&lt;br /&gt;
Major browsers support the WebAssembly standard which can be used to implement performance-sensitive sandboxed applications. Servo is a new, experimental browser that supports synchronously compiling and executing WebAssembly code, but does not yet support asynchronous compilation. This means that the entire WebAssembly program must be fetched before compilation can begin, which leads to longer time loading pages that run WebAssembly programs than in other web browsers. The goal of this work is to support compiling WebAssembly programs asynchronously so compilation can begin while the program is still being fetched from the network.&lt;br /&gt;
&lt;br /&gt;
The scope of this milestone was to complete the initial steps mentioned [https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project here]. The subsequent steps mentioned [https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project here] are to be done for the final project.&lt;br /&gt;
&lt;br /&gt;
The steps are as follows:&lt;br /&gt;
&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
&lt;br /&gt;
* Create a rust JS::StreamConsumer wrapper that stores a pointer to the object and has methods for consumeChunk, streamEnd, streamError, and noteResponseURLs.&lt;br /&gt;
* Implement an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches ConsumeStreamCallback that initiates the streaming webassembly compilation then creates a wrapper for the stream consumer and stores it in the Response object&lt;br /&gt;
* Implement an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches ReportStreamErrorCallback and reports an error with the error! macro&lt;br /&gt;
* Lastly, call InitStreamConsumerCallback in new_rt_and_cx with the two new functions as arguments, described in the specifications&lt;br /&gt;
&lt;br /&gt;
The steps involved in the project scope are depicted below:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Steps.png|center]]&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern'''==&lt;br /&gt;
Design patterns are not applicable as our task involved just implementation of methods. However, the Implementation section below provides details of the steps as why it was implemented, the way it was implemented&lt;br /&gt;
&lt;br /&gt;
=='''Implementation'''==&lt;br /&gt;
The following steps were followed to meet the project requirements as per this [https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project github page].&lt;br /&gt;
&lt;br /&gt;
===Step 1===&lt;br /&gt;
&lt;br /&gt;
We have implemented a Stream Consumer structure which has the methods for consumeChunk, streamEnd, streamError, and noteResponseURLs based on the Stream Consumer class implemented in the Mozilla Spider Monkey module. &lt;br /&gt;
&lt;br /&gt;
[[File:IS1-1.png]]&lt;br /&gt;
&lt;br /&gt;
The note_response_urls function takes optional urls as input, if nothing is passed it calls the underlying JS function with null ptr in place of URL. &lt;br /&gt;
&lt;br /&gt;
[[File:IS1-2.png]]&lt;br /&gt;
&lt;br /&gt;
===Step 2===&lt;br /&gt;
&lt;br /&gt;
We implemented the consume stream function which checks if a response extracted from the source is valid and returns an appropriate boolean value. The function checks if the response has a valid mime type, is CORS- origin type and has an ok status. &lt;br /&gt;
&lt;br /&gt;
[[File:IS2-1.png]]&lt;br /&gt;
&lt;br /&gt;
This step checks if the response type is of &amp;quot;default&amp;quot;, &amp;quot;cors&amp;quot; or &amp;quot;basic&amp;quot; type. This step checks the status code of the repsonse. It throws an error if the response is not OK ie. the status is not between 200 and 299.&lt;br /&gt;
&lt;br /&gt;
[[File:IS2-2.png]]&lt;br /&gt;
&lt;br /&gt;
These steps check if the response is locked. If the response is locked, it is not accessible and it throws a type error. If the response's body is already consumed, there is no need to process the response again. The function raises a corresponding type error. &lt;br /&gt;
&lt;br /&gt;
[[File:IS2-3-1.png]]&lt;br /&gt;
&lt;br /&gt;
===Step 3===&lt;br /&gt;
&lt;br /&gt;
The implementation of the ReportStreamErrorCallback function to retrieve and report errors during stream compilation, CompileError, or TypeError in case of invalid Mime type and unprocessable stream.&lt;br /&gt;
&lt;br /&gt;
[[File:IS3.png]]&lt;br /&gt;
&lt;br /&gt;
===Step 4===&lt;br /&gt;
&lt;br /&gt;
The implementation of InitStreamConsumerCallback in new_rt_and_cx_with_parent function.&lt;br /&gt;
&lt;br /&gt;
[[File:IS4.png]]&lt;br /&gt;
&lt;br /&gt;
=='''Testing'''==&lt;br /&gt;
&lt;br /&gt;
The code added in the initial steps(scope) is not expected to have any change in behavior on its own. We loaded https://wasm.bootcss.com/demo/Tanks/ to verify that there is no change in behavior due to our changes. &lt;br /&gt;
&lt;br /&gt;
In addition, we have tested our implementation against the servo-provided automated test suite using `./mach test-wpt tests/wpt/web-platform-tests/wasm/webapi` command.&lt;br /&gt;
The following image is the output of the said command:&lt;br /&gt;
&lt;br /&gt;
[[File:Serv_tests.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Following are the steps to compile the implementation to check for any broken code:&lt;br /&gt;
&lt;br /&gt;
# Install the pre-requisites required for servo as mentioned [https://github.com/servo/servo/blob/master/README.md here] &lt;br /&gt;
# Run the following commands&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; &lt;br /&gt;
  cd&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 git clone https://github.com/Akash-Pateria/servo&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 cd servo&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 git checkout -b origin/async-wasm-compilation-initial&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach fmt&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach test-tidy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach build -d&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will see that the servo build is successful and no errors are reported.&lt;br /&gt;
&lt;br /&gt;
=='''Pull Request'''==&lt;br /&gt;
&lt;br /&gt;
Here is our [https://github.com/servo/servo/pull/24563 pull request] which has been merged in Servo master branch. We have raised [https://github.com/servo/servo/pull/24653 another pull request](currently in review state), containing the implementation of the remaining initial steps.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/book&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://rustbyexample.com/&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rrastog3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_M1950._Support_Asynchronous_Web_Assembly_Compilation&amp;diff=128236</id>
		<title>CSC/ECE 517 Fall 2019 - M1950. Support Asynchronous Web Assembly Compilation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_M1950._Support_Asynchronous_Web_Assembly_Compilation&amp;diff=128236"/>
		<updated>2019-11-10T22:44:16Z</updated>

		<summary type="html">&lt;p&gt;Rrastog3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Servo is a prototype web browser engine written in the [https://en.wikipedia.org/wiki/Rust_(programming_language) Rust] language. Servo is a new, experimental browser that supports synchronously compiling and executing WebAssembly code, but does not yet support asynchronous compilation. This means that the entire WebAssembly program must be fetched before compilation can begin, which leads to longer time loading pages that run WebAssembly programs than in other web browsers. The goal of the project is to support compiling WebAssembly programs asynchronously so compilation can begin while the program is still being fetched from the network.&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo]Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in [https://www.rust-lang.org/ Rust] language. The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc. &lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[https://doc.rust-lang.org/book/index.html Rust] is an open source systems programming language developed by Mozilla. Servo is written in Rust. The main purpose behind it's design is to be thread safe and concurrent. The emphasis is also on speed, safety and control of memory layout.&lt;br /&gt;
&lt;br /&gt;
=='''Scope'''==&lt;br /&gt;
&lt;br /&gt;
Major browsers support the WebAssembly standard which can be used to implement performance-sensitive sandboxed applications. Servo is a new, experimental browser that supports synchronously compiling and executing WebAssembly code, but does not yet support asynchronous compilation. This means that the entire WebAssembly program must be fetched before compilation can begin, which leads to longer time loading pages that run WebAssembly programs than in other web browsers. The goal of this work is to support compiling WebAssembly programs asynchronously so compilation can begin while the program is still being fetched from the network.&lt;br /&gt;
&lt;br /&gt;
The scope of this milestone was to complete the initial steps mentioned [https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project here]. The subsequent steps mentioned [https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project here] are to be done for the final project.&lt;br /&gt;
&lt;br /&gt;
The steps are as follows:&lt;br /&gt;
&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
&lt;br /&gt;
* Create a rust JS::StreamConsumer wrapper that stores a pointer to the object and has methods for consumeChunk, streamEnd, streamError, and noteResponseURLs.&lt;br /&gt;
* Implement an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches ConsumeStreamCallback that initiates the streaming webassembly compilation then creates a wrapper for the stream consumer and stores it in the Response object&lt;br /&gt;
* Implement an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches ReportStreamErrorCallback and reports an error with the error! macro&lt;br /&gt;
* Lastly, call InitStreamConsumerCallback in new_rt_and_cx with the two new functions as arguments, described in the specifications&lt;br /&gt;
&lt;br /&gt;
The steps involved in the project scope are depicted below:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Steps.png|center]]&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern'''==&lt;br /&gt;
Design patterns are not applicable as our task involved just implementation of methods. However, the Implementation section below provides details of the steps as why it was implemented, the way it was implemented&lt;br /&gt;
&lt;br /&gt;
=='''Implementation'''==&lt;br /&gt;
The following steps were followed to meet the project requirements as per this [https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project github page].&lt;br /&gt;
&lt;br /&gt;
===Step 1===&lt;br /&gt;
&lt;br /&gt;
We have implemented a Stream Consumer structure which has the methods for consumeChunk, streamEnd, streamError, and noteResponseURLs based on the Stream Consumer class implemented in the Mozilla Spider Monkey module. &lt;br /&gt;
&lt;br /&gt;
[[File:IS1-1.png]]&lt;br /&gt;
&lt;br /&gt;
The note_response_urls function takes optional urls as input, if nothing is passed it calls the underlying JS function with null ptr in place of URL. &lt;br /&gt;
&lt;br /&gt;
[[File:IS1-2.png]]&lt;br /&gt;
&lt;br /&gt;
===Step 2===&lt;br /&gt;
&lt;br /&gt;
We implemented the consume stream function which checks if a response extracted from the source is valid and returns an appropriate boolean value. The function checks if the response has a valid mime type, is CORS- origin type and has an ok status. &lt;br /&gt;
&lt;br /&gt;
[[File:IS2-1.png]]&lt;br /&gt;
&lt;br /&gt;
This step checks if the response type is of &amp;quot;default&amp;quot;, &amp;quot;cors&amp;quot; or &amp;quot;basic&amp;quot; type.&lt;br /&gt;
&lt;br /&gt;
[[File:IS2-2.png]]&lt;br /&gt;
&lt;br /&gt;
This step checks the status code of the repsonse. It throws an error if the response is not OK ie. the status is not between 200 and 299.&lt;br /&gt;
&lt;br /&gt;
[[File:IS2-3-1.png]]&lt;br /&gt;
&lt;br /&gt;
===Step 3===&lt;br /&gt;
&lt;br /&gt;
The implementation of the ReportStreamErrorCallback function to retrieve and report errors during stream compilation, CompileError, or TypeError in case of invalid Mime type and unprocessable stream.&lt;br /&gt;
&lt;br /&gt;
[[File:IS3.png]]&lt;br /&gt;
&lt;br /&gt;
===Step 4===&lt;br /&gt;
&lt;br /&gt;
The implementation of InitStreamConsumerCallback in new_rt_and_cx_with_parent function.&lt;br /&gt;
&lt;br /&gt;
[[File:IS4.png]]&lt;br /&gt;
&lt;br /&gt;
=='''Testing'''==&lt;br /&gt;
&lt;br /&gt;
The code added in the initial steps(scope) is not expected to have any change in behavior on its own. We loaded https://wasm.bootcss.com/demo/Tanks/ to verify that there is no change in behavior due to our changes. &lt;br /&gt;
&lt;br /&gt;
In addition, we have tested our implementation against the servo-provided automated test suite using `./mach test-wpt tests/wpt/web-platform-tests/wasm/webapi` command.&lt;br /&gt;
The following image is the output of the said command:&lt;br /&gt;
&lt;br /&gt;
[[File:Serv_tests.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Following are the steps to compile the implementation to check for any broken code:&lt;br /&gt;
&lt;br /&gt;
# Install the pre-requisites required for servo as mentioned [https://github.com/servo/servo/blob/master/README.md here] &lt;br /&gt;
# Run the following commands&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; &lt;br /&gt;
  cd&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 git clone https://github.com/Akash-Pateria/servo&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 cd servo&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 git checkout -b origin/async-wasm-compilation-initial&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach fmt&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach test-tidy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach build -d&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will see that the servo build is successful and no errors are reported.&lt;br /&gt;
&lt;br /&gt;
=='''Pull Request'''==&lt;br /&gt;
&lt;br /&gt;
Here is our [https://github.com/servo/servo/pull/24563 pull request] which has been merged in Servo master branch. We have raised [https://github.com/servo/servo/pull/24653 another pull request](currently in review state), containing the implementation of the remaining initial steps.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/book&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://rustbyexample.com/&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rrastog3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_M1950._Support_Asynchronous_Web_Assembly_Compilation&amp;diff=127945</id>
		<title>CSC/ECE 517 Fall 2019 - M1950. Support Asynchronous Web Assembly Compilation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_M1950._Support_Asynchronous_Web_Assembly_Compilation&amp;diff=127945"/>
		<updated>2019-11-07T03:40:57Z</updated>

		<summary type="html">&lt;p&gt;Rrastog3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Servo is a prototype web browser engine written in the [https://en.wikipedia.org/wiki/Rust_(programming_language) Rust] language. Servo is a new, experimental browser that supports synchronously compiling and executing WebAssembly code, but does not yet support asynchronous compilation. This means that the entire WebAssembly program must be fetched before compilation can begin, which leads to longer time loading pages that run WebAssembly programs than in other web browsers. The goal of the project is to support compiling WebAssembly programs asynchronously so compilation can begin while the program is still being fetched from the network.&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo]Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in [https://www.rust-lang.org/ Rust] language. The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc. &lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[https://doc.rust-lang.org/book/index.html Rust] is an open source systems programming language developed by Mozilla. Servo is written in Rust. The main purpose behind it's design is to be thread safe and concurrent. The emphasis is also on speed, safety and control of memory layout.&lt;br /&gt;
&lt;br /&gt;
=='''Scope'''==&lt;br /&gt;
&lt;br /&gt;
Major browsers support the WebAssembly standard which can be used to implement performance-sensitive sandboxed applications. Servo is a new, experimental browser that supports synchronously compiling and executing WebAssembly code, but does not yet support asynchronous compilation. This means that the entire WebAssembly program must be fetched before compilation can begin, which leads to longer time loading pages that run WebAssembly programs than in other web browsers. The goal of this work is to support compiling WebAssembly programs asynchronously so compilation can begin while the program is still being fetched from the network.&lt;br /&gt;
&lt;br /&gt;
The scope of this milestone was to complete the initial steps mentioned [https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project here]. The subsequent steps mentioned [https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project here] are to be done for the final project.&lt;br /&gt;
&lt;br /&gt;
The steps are as follows:&lt;br /&gt;
&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
&lt;br /&gt;
* Create a rust JS::StreamConsumer wrapper that stores a pointer to the object and has methods for consumeChunk, streamEnd, streamError, and noteResponseURLs.&lt;br /&gt;
* Implement an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches ConsumeStreamCallback that initiates the streaming webassembly compilation then creates a wrapper for the stream consumer and stores it in the Response object&lt;br /&gt;
* Implement an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches ReportStreamErrorCallback and reports an error with the error! macro&lt;br /&gt;
* Lastly, call InitStreamConsumerCallback in new_rt_and_cx with the two new functions as arguments, described in the specifications&lt;br /&gt;
&lt;br /&gt;
The steps involved in the project scope are depicted below:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Steps.png|center]]&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern'''==&lt;br /&gt;
Design patterns are not applicable as our task involved just implementation of methods. However, the Implementation section below provides details of the steps as why it was implemented, the way it was implemented&lt;br /&gt;
&lt;br /&gt;
=='''Implementation'''==&lt;br /&gt;
The following steps were followed to meet the project requirements as per this [https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project github page].&lt;br /&gt;
&lt;br /&gt;
===Step 1===&lt;br /&gt;
&lt;br /&gt;
We created a Stream Consumer structure which has the methods for consumeChunk, streamEnd, streamError, and noteResponseURLs based on the Stream Consumer class implemented in the Mozilla Spider Monkey module. &lt;br /&gt;
&lt;br /&gt;
[[File:IS1-1.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:IS1-2.png]]&lt;br /&gt;
&lt;br /&gt;
===Step 2===&lt;br /&gt;
&lt;br /&gt;
We implemented the consume stream function which checks if a response extracted from the source is valid and returns an appropriate boolean value. The function checks if the response has a valid mime type, is CORS- origin type and has an ok status. &lt;br /&gt;
&lt;br /&gt;
[[File:IS2-1.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:IS2-2.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:IS2-3-1.png]]&lt;br /&gt;
&lt;br /&gt;
===Step 3===&lt;br /&gt;
&lt;br /&gt;
The implementation of the ReportStreamErrorCallback function to retrieve and report errors during stream compilation.&lt;br /&gt;
&lt;br /&gt;
[[File:IS3.png]]&lt;br /&gt;
&lt;br /&gt;
===Step 4===&lt;br /&gt;
&lt;br /&gt;
The implementation of InitStreamConsumerCallback in new_rt_and_cx_with_parent function.&lt;br /&gt;
&lt;br /&gt;
[[File:IS4.png]]&lt;br /&gt;
&lt;br /&gt;
=='''Testing'''==&lt;br /&gt;
&lt;br /&gt;
The code added in the initial steps(scope) is not expected to have any change in behavior on its own. We loaded https://wasm.bootcss.com/demo/Tanks/ to verify that there is no change in behavior due to our changes. &lt;br /&gt;
&lt;br /&gt;
In addition, we have tested our implementation against the servo-provided automated test suite using `./mach test-wpt tests/wpt/web-platform-tests/wasm/webapi` command.&lt;br /&gt;
The following image is the output of the said command:&lt;br /&gt;
&lt;br /&gt;
[[File:Serv_tests.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Following are the steps to compile the implementation to check for any broken code:&lt;br /&gt;
&lt;br /&gt;
# Install the pre-requisites required for servo as mentioned [https://github.com/servo/servo/blob/master/README.md here] &lt;br /&gt;
# Run the following commands&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; &lt;br /&gt;
  cd&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 git clone https://github.com/Akash-Pateria/servo&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 cd servo&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 git checkout -b origin/async-wasm-compilation-initial&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach fmt&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach test-tidy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach build -d&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will see that the servo build is successful and no errors are reported.&lt;br /&gt;
&lt;br /&gt;
=='''Pull Request'''==&lt;br /&gt;
&lt;br /&gt;
Here is our [https://github.com/servo/servo/pull/24563 pull request] which has been merged in Servo master branch. We have raised [https://github.com/servo/servo/pull/24653 another pull request](currently in review state), containing the implementation of the remaining initial steps.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/book&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://rustbyexample.com/&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rrastog3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:IS2-3-1.png&amp;diff=127943</id>
		<title>File:IS2-3-1.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:IS2-3-1.png&amp;diff=127943"/>
		<updated>2019-11-07T03:40:41Z</updated>

		<summary type="html">&lt;p&gt;Rrastog3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Rrastog3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_M1950._Support_Asynchronous_Web_Assembly_Compilation&amp;diff=127938</id>
		<title>CSC/ECE 517 Fall 2019 - M1950. Support Asynchronous Web Assembly Compilation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_M1950._Support_Asynchronous_Web_Assembly_Compilation&amp;diff=127938"/>
		<updated>2019-11-07T03:39:20Z</updated>

		<summary type="html">&lt;p&gt;Rrastog3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Servo is a prototype web browser engine written in the [https://en.wikipedia.org/wiki/Rust_(programming_language) Rust] language. Servo is a new, experimental browser that supports synchronously compiling and executing WebAssembly code, but does not yet support asynchronous compilation. This means that the entire WebAssembly program must be fetched before compilation can begin, which leads to longer time loading pages that run WebAssembly programs than in other web browsers. The goal of the project is to support compiling WebAssembly programs asynchronously so compilation can begin while the program is still being fetched from the network.&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo]Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in [https://www.rust-lang.org/ Rust] language. The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc. &lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[https://doc.rust-lang.org/book/index.html Rust] is an open source systems programming language developed by Mozilla. Servo is written in Rust. The main purpose behind it's design is to be thread safe and concurrent. The emphasis is also on speed, safety and control of memory layout.&lt;br /&gt;
&lt;br /&gt;
=='''Scope'''==&lt;br /&gt;
&lt;br /&gt;
Major browsers support the WebAssembly standard which can be used to implement performance-sensitive sandboxed applications. Servo is a new, experimental browser that supports synchronously compiling and executing WebAssembly code, but does not yet support asynchronous compilation. This means that the entire WebAssembly program must be fetched before compilation can begin, which leads to longer time loading pages that run WebAssembly programs than in other web browsers. The goal of this work is to support compiling WebAssembly programs asynchronously so compilation can begin while the program is still being fetched from the network.&lt;br /&gt;
&lt;br /&gt;
The scope of this milestone was to complete the initial steps mentioned [https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project here]. The subsequent steps mentioned [https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project here] are to be done for the final project.&lt;br /&gt;
&lt;br /&gt;
The steps are as follows:&lt;br /&gt;
&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
&lt;br /&gt;
* Create a rust JS::StreamConsumer wrapper that stores a pointer to the object and has methods for consumeChunk, streamEnd, streamError, and noteResponseURLs.&lt;br /&gt;
* Implement an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches ConsumeStreamCallback that initiates the streaming webassembly compilation then creates a wrapper for the stream consumer and stores it in the Response object&lt;br /&gt;
* Implement an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches ReportStreamErrorCallback and reports an error with the error! macro&lt;br /&gt;
* Lastly, call InitStreamConsumerCallback in new_rt_and_cx with the two new functions as arguments, described in the specifications&lt;br /&gt;
&lt;br /&gt;
The steps involved in the project scope are depicted below:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Steps.png|center]]&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern'''==&lt;br /&gt;
Design patterns are not applicable as our task involved just implementation of methods. However, the Implementation section below provides details of the steps as why it was implemented, the way it was implemented&lt;br /&gt;
&lt;br /&gt;
=='''Implementation'''==&lt;br /&gt;
The following steps were followed to meet the project requirements as per this [https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project github page].&lt;br /&gt;
&lt;br /&gt;
===Step 1===&lt;br /&gt;
&lt;br /&gt;
We created a Stream Consumer structure which has the methods for consumeChunk, streamEnd, streamError, and noteResponseURLs based on the Stream Consumer class implemented in the Mozilla Spider Monkey module. &lt;br /&gt;
&lt;br /&gt;
[[File:IS1-1.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:IS1-2.png]]&lt;br /&gt;
&lt;br /&gt;
===Step 2===&lt;br /&gt;
&lt;br /&gt;
We implemented the consume stream function which checks if a response extracted from the source is valid and returns an appropriate boolean value. The function checks if the response has a valid mime type, is CORS- origin type and has an ok status. &lt;br /&gt;
&lt;br /&gt;
[[File:IS2-1.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:IS2-2.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:IS-3-1.png]]&lt;br /&gt;
&lt;br /&gt;
===Step 3===&lt;br /&gt;
&lt;br /&gt;
The implementation of the ReportStreamErrorCallback function to retrieve and report errors during stream compilation.&lt;br /&gt;
&lt;br /&gt;
[[File:IS3.png]]&lt;br /&gt;
&lt;br /&gt;
===Step 4===&lt;br /&gt;
&lt;br /&gt;
The implementation of InitStreamConsumerCallback in new_rt_and_cx_with_parent function.&lt;br /&gt;
&lt;br /&gt;
[[File:IS4.png]]&lt;br /&gt;
&lt;br /&gt;
=='''Testing'''==&lt;br /&gt;
&lt;br /&gt;
The code added in the initial steps(scope) is not expected to have any change in behavior on its own. We loaded https://wasm.bootcss.com/demo/Tanks/ to verify that there is no change in behavior due to our changes. &lt;br /&gt;
&lt;br /&gt;
In addition, we have tested our implementation against the servo-provided automated test suite using `./mach test-wpt tests/wpt/web-platform-tests/wasm/webapi` command.&lt;br /&gt;
The following image is the output of the said command:&lt;br /&gt;
&lt;br /&gt;
[[File:Serv_tests.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Following are the steps to compile the implementation to check for any broken code:&lt;br /&gt;
&lt;br /&gt;
# Install the pre-requisites required for servo as mentioned [https://github.com/servo/servo/blob/master/README.md here] &lt;br /&gt;
# Run the following commands&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; &lt;br /&gt;
  cd&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 git clone https://github.com/Akash-Pateria/servo&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 cd servo&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 git checkout -b origin/async-wasm-compilation-initial&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach fmt&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach test-tidy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach build -d&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will see that the servo build is successful and no errors are reported.&lt;br /&gt;
&lt;br /&gt;
=='''Pull Request'''==&lt;br /&gt;
&lt;br /&gt;
Here is our [https://github.com/servo/servo/pull/24563 pull request] which has been merged in Servo master branch. We have raised [https://github.com/servo/servo/pull/24653 another pull request](currently in review state), containing the implementation of the remaining initial steps.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/book&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://rustbyexample.com/&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rrastog3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_M1950._Support_Asynchronous_Web_Assembly_Compilation&amp;diff=127933</id>
		<title>CSC/ECE 517 Fall 2019 - M1950. Support Asynchronous Web Assembly Compilation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_M1950._Support_Asynchronous_Web_Assembly_Compilation&amp;diff=127933"/>
		<updated>2019-11-07T03:36:12Z</updated>

		<summary type="html">&lt;p&gt;Rrastog3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Servo is a prototype web browser engine written in the [https://en.wikipedia.org/wiki/Rust_(programming_language) Rust] language. Servo is a new, experimental browser that supports synchronously compiling and executing WebAssembly code, but does not yet support asynchronous compilation. This means that the entire WebAssembly program must be fetched before compilation can begin, which leads to longer time loading pages that run WebAssembly programs than in other web browsers. The goal of the project is to support compiling WebAssembly programs asynchronously so compilation can begin while the program is still being fetched from the network.&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo]Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in [https://www.rust-lang.org/ Rust] language. The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc. &lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[https://doc.rust-lang.org/book/index.html Rust] is an open source systems programming language developed by Mozilla. Servo is written in Rust. The main purpose behind it's design is to be thread safe and concurrent. The emphasis is also on speed, safety and control of memory layout.&lt;br /&gt;
&lt;br /&gt;
=='''Scope'''==&lt;br /&gt;
&lt;br /&gt;
Major browsers support the WebAssembly standard which can be used to implement performance-sensitive sandboxed applications. Servo is a new, experimental browser that supports synchronously compiling and executing WebAssembly code, but does not yet support asynchronous compilation. This means that the entire WebAssembly program must be fetched before compilation can begin, which leads to longer time loading pages that run WebAssembly programs than in other web browsers. The goal of this work is to support compiling WebAssembly programs asynchronously so compilation can begin while the program is still being fetched from the network.&lt;br /&gt;
&lt;br /&gt;
The scope of this milestone was to complete the initial steps mentioned [https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project here]. The subsequent steps mentioned [https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project here] are to be done for the final project.&lt;br /&gt;
&lt;br /&gt;
The steps are as follows:&lt;br /&gt;
&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
&lt;br /&gt;
* Create a rust JS::StreamConsumer wrapper that stores a pointer to the object and has methods for consumeChunk, streamEnd, streamError, and noteResponseURLs.&lt;br /&gt;
* Implement an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches ConsumeStreamCallback that initiates the streaming webassembly compilation then creates a wrapper for the stream consumer and stores it in the Response object&lt;br /&gt;
* Implement an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches ReportStreamErrorCallback and reports an error with the error! macro&lt;br /&gt;
* Lastly, call InitStreamConsumerCallback in new_rt_and_cx with the two new functions as arguments, described in the specifications&lt;br /&gt;
&lt;br /&gt;
The steps involved in the project scope are depicted below:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Steps.png|center]]&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern'''==&lt;br /&gt;
Design patterns are not applicable as our task involved just implementation of methods. However, the Implementation section below provides details of the steps as why it was implemented, the way it was implemented&lt;br /&gt;
&lt;br /&gt;
=='''Implementation'''==&lt;br /&gt;
The following steps were followed to meet the project requirements as per this [https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project github page].&lt;br /&gt;
&lt;br /&gt;
===Step 1===&lt;br /&gt;
&lt;br /&gt;
We created a Stream Consumer structure which has the methods for consumeChunk, streamEnd, streamError, and noteResponseURLs based on the Stream Consumer class implemented in the Mozilla Spider Monkey module. &lt;br /&gt;
&lt;br /&gt;
[[File:IS1-1.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:IS1-2.png]]&lt;br /&gt;
&lt;br /&gt;
===Step 2===&lt;br /&gt;
&lt;br /&gt;
We implemented the consume stream function which checks if a response extracted from the source is valid and returns an appropriate boolean value. The function checks if the response has a valid mime type, is CORS- origin type and has an ok status. &lt;br /&gt;
&lt;br /&gt;
[[File:IS2-1.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:IS2-2.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:IS2-3.1.png]]&lt;br /&gt;
&lt;br /&gt;
===Step 3===&lt;br /&gt;
&lt;br /&gt;
The implementation of the ReportStreamErrorCallback function to retrieve and report errors during stream compilation.&lt;br /&gt;
&lt;br /&gt;
[[File:IS3.png]]&lt;br /&gt;
&lt;br /&gt;
===Step 4===&lt;br /&gt;
&lt;br /&gt;
The implementation of InitStreamConsumerCallback in new_rt_and_cx_with_parent function.&lt;br /&gt;
&lt;br /&gt;
[[File:IS4.png]]&lt;br /&gt;
&lt;br /&gt;
=='''Testing'''==&lt;br /&gt;
&lt;br /&gt;
The code added in the initial steps(scope) is not expected to have any change in behavior on its own. We loaded https://wasm.bootcss.com/demo/Tanks/ to verify that there is no change in behavior due to our changes. &lt;br /&gt;
&lt;br /&gt;
In addition, we have tested our implementation against the servo-provided automated test suite using `./mach test-wpt tests/wpt/web-platform-tests/wasm/webapi` command.&lt;br /&gt;
The following image is the output of the said command:&lt;br /&gt;
&lt;br /&gt;
[[File:Serv_tests.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Following are the steps to compile the implementation to check for any broken code:&lt;br /&gt;
&lt;br /&gt;
# Install the pre-requisites required for servo as mentioned [https://github.com/servo/servo/blob/master/README.md here] &lt;br /&gt;
# Run the following commands&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; &lt;br /&gt;
  cd&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 git clone https://github.com/Akash-Pateria/servo&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 cd servo&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 git checkout -b origin/async-wasm-compilation-initial&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach fmt&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach test-tidy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach build -d&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will see that the servo build is successful and no errors are reported.&lt;br /&gt;
&lt;br /&gt;
=='''Pull Request'''==&lt;br /&gt;
&lt;br /&gt;
Here is our [https://github.com/servo/servo/pull/24563 pull request] which has been merged in Servo master branch. We have raised [https://github.com/servo/servo/pull/24653 another pull request](currently in review state), containing the implementation of the remaining initial steps.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/book&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://rustbyexample.com/&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rrastog3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:IS-3.1.png&amp;diff=127932</id>
		<title>File:IS-3.1.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:IS-3.1.png&amp;diff=127932"/>
		<updated>2019-11-07T03:35:35Z</updated>

		<summary type="html">&lt;p&gt;Rrastog3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Rrastog3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_M1950._Support_Asynchronous_Web_Assembly_Compilation&amp;diff=127931</id>
		<title>CSC/ECE 517 Fall 2019 - M1950. Support Asynchronous Web Assembly Compilation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_M1950._Support_Asynchronous_Web_Assembly_Compilation&amp;diff=127931"/>
		<updated>2019-11-07T03:34:43Z</updated>

		<summary type="html">&lt;p&gt;Rrastog3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Servo is a prototype web browser engine written in the [https://en.wikipedia.org/wiki/Rust_(programming_language) Rust] language. Servo is a new, experimental browser that supports synchronously compiling and executing WebAssembly code, but does not yet support asynchronous compilation. This means that the entire WebAssembly program must be fetched before compilation can begin, which leads to longer time loading pages that run WebAssembly programs than in other web browsers. The goal of the project is to support compiling WebAssembly programs asynchronously so compilation can begin while the program is still being fetched from the network.&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo]Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in [https://www.rust-lang.org/ Rust] language. The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc. &lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[https://doc.rust-lang.org/book/index.html Rust] is an open source systems programming language developed by Mozilla. Servo is written in Rust. The main purpose behind it's design is to be thread safe and concurrent. The emphasis is also on speed, safety and control of memory layout.&lt;br /&gt;
&lt;br /&gt;
=='''Scope'''==&lt;br /&gt;
&lt;br /&gt;
Major browsers support the WebAssembly standard which can be used to implement performance-sensitive sandboxed applications. Servo is a new, experimental browser that supports synchronously compiling and executing WebAssembly code, but does not yet support asynchronous compilation. This means that the entire WebAssembly program must be fetched before compilation can begin, which leads to longer time loading pages that run WebAssembly programs than in other web browsers. The goal of this work is to support compiling WebAssembly programs asynchronously so compilation can begin while the program is still being fetched from the network.&lt;br /&gt;
&lt;br /&gt;
The scope of this milestone was to complete the initial steps mentioned [https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project here]. The subsequent steps mentioned [https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project here] are to be done for the final project.&lt;br /&gt;
&lt;br /&gt;
The steps are as follows:&lt;br /&gt;
&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
&lt;br /&gt;
* Create a rust JS::StreamConsumer wrapper that stores a pointer to the object and has methods for consumeChunk, streamEnd, streamError, and noteResponseURLs.&lt;br /&gt;
* Implement an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches ConsumeStreamCallback that initiates the streaming webassembly compilation then creates a wrapper for the stream consumer and stores it in the Response object&lt;br /&gt;
* Implement an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches ReportStreamErrorCallback and reports an error with the error! macro&lt;br /&gt;
* Lastly, call InitStreamConsumerCallback in new_rt_and_cx with the two new functions as arguments, described in the specifications&lt;br /&gt;
&lt;br /&gt;
The steps involved in the project scope are depicted below:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Steps.png|center]]&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern'''==&lt;br /&gt;
Design patterns are not applicable as our task involved just implementation of methods. However, the Implementation section below provides details of the steps as why it was implemented, the way it was implemented&lt;br /&gt;
&lt;br /&gt;
=='''Implementation'''==&lt;br /&gt;
The following steps were followed to meet the project requirements as per this [https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project github page].&lt;br /&gt;
&lt;br /&gt;
===Step 1===&lt;br /&gt;
&lt;br /&gt;
We created a Stream Consumer structure which has the methods for consumeChunk, streamEnd, streamError, and noteResponseURLs based on the Stream Consumer class implemented in the Mozilla Spider Monkey module. &lt;br /&gt;
&lt;br /&gt;
[[File:IS1-1.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:IS1-2.png]]&lt;br /&gt;
&lt;br /&gt;
===Step 2===&lt;br /&gt;
&lt;br /&gt;
We implemented the consume stream function which checks if a response extracted from the source is valid and returns an appropriate boolean value. The function checks if the response has a valid mime type, is CORS- origin type and has an ok status. &lt;br /&gt;
&lt;br /&gt;
[[File:IS2-1.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:IS2-2.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:IS2-3.png]]&lt;br /&gt;
&lt;br /&gt;
===Step 3===&lt;br /&gt;
&lt;br /&gt;
The implementation of the ReportStreamErrorCallback function to retrieve and report errors during stream compilation.&lt;br /&gt;
&lt;br /&gt;
[[File:IS3.png]]&lt;br /&gt;
&lt;br /&gt;
===Step 4===&lt;br /&gt;
&lt;br /&gt;
The implementation of InitStreamConsumerCallback in new_rt_and_cx_with_parent function.&lt;br /&gt;
&lt;br /&gt;
[[File:IS4.png]]&lt;br /&gt;
&lt;br /&gt;
=='''Testing'''==&lt;br /&gt;
&lt;br /&gt;
The code added in the initial steps(scope) is not expected to have any change in behavior on its own. We loaded https://wasm.bootcss.com/demo/Tanks/ to verify that there is no change in behavior due to our changes. &lt;br /&gt;
&lt;br /&gt;
In addition, we have tested our implementation against the servo-provided automated test suite using `./mach test-wpt tests/wpt/web-platform-tests/wasm/webapi` command.&lt;br /&gt;
The following image is the output of the said command:&lt;br /&gt;
&lt;br /&gt;
[[File:Serv_tests.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Following are the steps to compile the implementation to check for any broken code:&lt;br /&gt;
&lt;br /&gt;
# Install the pre-requisites required for servo as mentioned [https://github.com/servo/servo/blob/master/README.md here] &lt;br /&gt;
# Run the following commands&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; &lt;br /&gt;
  cd&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 git clone https://github.com/Akash-Pateria/servo&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 cd servo&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 git checkout -b origin/async-wasm-compilation-initial&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach fmt&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach test-tidy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach build -d&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will see that the servo build is successful and no errors are reported.&lt;br /&gt;
&lt;br /&gt;
=='''Pull Request'''==&lt;br /&gt;
&lt;br /&gt;
Here is our [https://github.com/servo/servo/pull/24563 pull request] which has been merged in Servo master branch. We have raised [https://github.com/servo/servo/pull/24653 another pull request](currently in review state), containing the implementation of the remaining initial steps.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/book&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://rustbyexample.com/&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rrastog3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_M1950._Support_Asynchronous_Web_Assembly_Compilation&amp;diff=125957</id>
		<title>CSC/ECE 517 Fall 2019 - M1950. Support Asynchronous Web Assembly Compilation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_M1950._Support_Asynchronous_Web_Assembly_Compilation&amp;diff=125957"/>
		<updated>2019-10-28T20:14:51Z</updated>

		<summary type="html">&lt;p&gt;Rrastog3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Servo is a prototype web browser engine written in the [https://en.wikipedia.org/wiki/Rust_(programming_language) Rust] language. Servo is a new, experimental browser that supports synchronously compiling and executing WebAssembly code, but does not yet support asynchronous compilation. This means that the entire WebAssembly program must be fetched before compilation can begin, which leads to longer time loading pages that run WebAssembly programs than in other web browsers. The goal of the project is to support compiling WebAssembly programs asynchronously so compilation can begin while the program is still being fetched from the network.&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo]Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in [https://www.rust-lang.org/ Rust] language. The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc. &lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[https://doc.rust-lang.org/book/index.html Rust] is an open source systems programming language developed by Mozilla. Servo is written in Rust. The main purpose behind it's design is to be thread safe and concurrent. The emphasis is also on speed, safety and control of memory layout.&lt;br /&gt;
&lt;br /&gt;
=='''Scope'''==&lt;br /&gt;
&lt;br /&gt;
The scope of the project was to complete the initial steps mentioned [https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project here].&lt;br /&gt;
&lt;br /&gt;
The steps are as follows:&lt;br /&gt;
&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
* Create a rust JS::StreamConsumer wrapper that stores a pointer to the object and has methods for consumeChunk, streamEnd, streamError, and noteResponseURLs.&lt;br /&gt;
* Implement an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches ConsumeStreamCallback that initiates the streaming webassembly compilation then creates a wrapper for the stream consumer and stores it in the Response object&lt;br /&gt;
* Implement an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches ReportStreamErrorCallback and reports an error with the error! macro&lt;br /&gt;
* Lastly, call InitStreamConsumerCallback in new_rt_and_cx with the two new functions as arguments, described in the specifications&lt;br /&gt;
&lt;br /&gt;
The subsequent steps mentioned [https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project here] are to be done for the final project.&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern'''==&lt;br /&gt;
Design patterns are not applicable as our task involved just implementation of methods. However, the Implementation section below provides details of the steps as why it was implemented, the way it was implemented&lt;br /&gt;
&lt;br /&gt;
=='''Implementation'''==&lt;br /&gt;
The following steps were followed to meet the project requirements as per this [https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project github page].&lt;br /&gt;
&lt;br /&gt;
===Step 1===&lt;br /&gt;
&lt;br /&gt;
We created a Stream Consumer structure which has the methods for consumeChunk, streamEnd, streamError, and noteResponseURLs based on the Stream Consumer class implemented in the Mozilla Spider Monkey module. &lt;br /&gt;
&lt;br /&gt;
[[File:StreamConsumerFunctions.png]]&lt;br /&gt;
&lt;br /&gt;
===Step 2===&lt;br /&gt;
&lt;br /&gt;
We implemented the ReportStreamErrorCallback function to retrieve and report errors during stream compilation.&lt;br /&gt;
&lt;br /&gt;
[[File:ReportErrorCallback.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Step 3===&lt;br /&gt;
&lt;br /&gt;
The implementation of ConsumeStreamCallback and new_rt_and_cx is in progress.&lt;br /&gt;
&lt;br /&gt;
=='''Testing'''==&lt;br /&gt;
&lt;br /&gt;
Unfortunately, the code added in the initial steps(scope) is not expected to have any change in behaviour on its own. The best we can do is to load https://wasm.bootcss.com/demo/Tanks/ and verify that there is no change in behaviour due to our changes.&lt;br /&gt;
&lt;br /&gt;
Eventhough we could not perform any kind of functional tests, we took steps to look out for compilation errors before raising the pull request.&lt;br /&gt;
&lt;br /&gt;
Following are the steps for the same:&lt;br /&gt;
&lt;br /&gt;
# Install the pre-requisites required for servo as mentioned [https://github.com/servo/servo/blob/master/README.md here] &lt;br /&gt;
# Run the following commands&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; &lt;br /&gt;
  cd&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 git clone https://github.com/Akash-Pateria/servo&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 cd servo&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 git checkout -b origin/async-wasm-compilation-initial&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach fmt&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach test-tidy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach build -d&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can see that the servo build is successful and no errors are reported.&lt;br /&gt;
&lt;br /&gt;
=='''Pull Request'''==&lt;br /&gt;
&lt;br /&gt;
Here is our [https://github.com/servo/servo/pull/24563 pull request]. In the PR, you can see all the code snippets added to implement the above-mentioned steps.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/book&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://rustbyexample.com/&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rrastog3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_M1950._Support_Asynchronous_Web_Assembly_Compilation&amp;diff=125956</id>
		<title>CSC/ECE 517 Fall 2019 - M1950. Support Asynchronous Web Assembly Compilation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_M1950._Support_Asynchronous_Web_Assembly_Compilation&amp;diff=125956"/>
		<updated>2019-10-28T20:14:16Z</updated>

		<summary type="html">&lt;p&gt;Rrastog3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Servo is a prototype web browser engine written in the [https://en.wikipedia.org/wiki/Rust_(programming_language) Rust] language. Servo is a new, experimental browser that supports synchronously compiling and executing WebAssembly code, but does not yet support asynchronous compilation. This means that the entire WebAssembly program must be fetched before compilation can begin, which leads to longer time loading pages that run WebAssembly programs than in other web browsers. The goal of the project is to support compiling WebAssembly programs asynchronously so compilation can begin while the program is still being fetched from the network.&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo]Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in [https://www.rust-lang.org/ Rust] language. The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc. &lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[https://doc.rust-lang.org/book/index.html Rust] is an open source systems programming language developed by Mozilla. Servo is written in Rust. The main purpose behind it's design is to be thread safe and concurrent. The emphasis is also on speed, safety and control of memory layout.&lt;br /&gt;
&lt;br /&gt;
=='''Scope'''==&lt;br /&gt;
&lt;br /&gt;
The scope of the project was to complete the initial steps mentioned [https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project here].&lt;br /&gt;
&lt;br /&gt;
The steps are as follows:&lt;br /&gt;
&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
* Create a rust JS::StreamConsumer wrapper that stores a pointer to the object and has methods for consumeChunk, streamEnd, streamError, and noteResponseURLs.&lt;br /&gt;
* Implement an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches ConsumeStreamCallback that initiates the streaming webassembly compilation then creates a wrapper for the stream consumer and stores it in the Response object&lt;br /&gt;
* Implement an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches ReportStreamErrorCallback and reports an error with the error! macro&lt;br /&gt;
* Lastly, call InitStreamConsumerCallback in new_rt_and_cx with the two new functions as arguments, described in the specifications&lt;br /&gt;
&lt;br /&gt;
The subsequent steps mentioned [https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project here] are to be done for the final project.&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern'''==&lt;br /&gt;
Design patterns are not applicable as our task involved just implementation of methods. However, the Implementation section below provides details of the steps as why it was implemented, the way it was implemented&lt;br /&gt;
&lt;br /&gt;
=='''Implementation'''==&lt;br /&gt;
The following steps were followed to meet the project requirements as per this [https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project github page].&lt;br /&gt;
&lt;br /&gt;
===Step 1===&lt;br /&gt;
&lt;br /&gt;
We created a Stream Consumer structure which has the methods for consumeChunk, streamEnd, streamError, and noteResponseURLs based on the Stream Consumer class implemented in the Mozilla Spider Monkey module. &lt;br /&gt;
&lt;br /&gt;
[[File:StreamConsumerFunctions.png]]&lt;br /&gt;
&lt;br /&gt;
===Step 2===&lt;br /&gt;
&lt;br /&gt;
We implemented the ReportStreamErrorCallback function to retrieve and report errors during stream compilation.&lt;br /&gt;
&lt;br /&gt;
[[File:ReportErrorCallback.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Step 3===&lt;br /&gt;
&lt;br /&gt;
The implementation of ConsumeStreamCallback and new_rt_and_cx is in progress and implementation &lt;br /&gt;
&lt;br /&gt;
=='''Testing'''==&lt;br /&gt;
&lt;br /&gt;
Unfortunately, the code added in the initial steps(scope) is not expected to have any change in behaviour on its own. The best we can do is to load https://wasm.bootcss.com/demo/Tanks/ and verify that there is no change in behaviour due to our changes.&lt;br /&gt;
&lt;br /&gt;
Eventhough we could not perform any kind of functional tests, we took steps to look out for compilation errors before raising the pull request.&lt;br /&gt;
&lt;br /&gt;
Following are the steps for the same:&lt;br /&gt;
&lt;br /&gt;
# Install the pre-requisites required for servo as mentioned [https://github.com/servo/servo/blob/master/README.md here] &lt;br /&gt;
# Run the following commands&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; &lt;br /&gt;
  cd&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 git clone https://github.com/Akash-Pateria/servo&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 cd servo&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 git checkout -b origin/async-wasm-compilation-initial&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach fmt&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach test-tidy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach build -d&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can see that the servo build is successful and no errors are reported.&lt;br /&gt;
&lt;br /&gt;
=='''Pull Request'''==&lt;br /&gt;
&lt;br /&gt;
Here is our [https://github.com/servo/servo/pull/24563 pull request]. In the PR, you can see all the code snippets added to implement the above-mentioned steps.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/book&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://rustbyexample.com/&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rrastog3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:ReportErrorCallback.png&amp;diff=125949</id>
		<title>File:ReportErrorCallback.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:ReportErrorCallback.png&amp;diff=125949"/>
		<updated>2019-10-28T19:55:57Z</updated>

		<summary type="html">&lt;p&gt;Rrastog3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Rrastog3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_M1950._Support_Asynchronous_Web_Assembly_Compilation&amp;diff=125948</id>
		<title>CSC/ECE 517 Fall 2019 - M1950. Support Asynchronous Web Assembly Compilation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_M1950._Support_Asynchronous_Web_Assembly_Compilation&amp;diff=125948"/>
		<updated>2019-10-28T19:55:37Z</updated>

		<summary type="html">&lt;p&gt;Rrastog3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Servo is a prototype web browser engine written in the [https://en.wikipedia.org/wiki/Rust_(programming_language) Rust] language. Servo is a new, experimental browser that supports synchronously compiling and executing WebAssembly code, but does not yet support asynchronous compilation. This means that the entire WebAssembly program must be fetched before compilation can begin, which leads to longer time loading pages that run WebAssembly programs than in other web browsers. The goal of the project is to support compiling WebAssembly programs asynchronously so compilation can begin while the program is still being fetched from the network.&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo]Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in [https://www.rust-lang.org/ Rust] language. The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc. &lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[https://doc.rust-lang.org/book/index.html Rust] is an open source systems programming language developed by Mozilla. Servo is written in Rust. The main purpose behind it's design is to be thread safe and concurrent. The emphasis is also on speed, safety and control of memory layout.&lt;br /&gt;
&lt;br /&gt;
=='''Scope'''==&lt;br /&gt;
&lt;br /&gt;
The scope of the project was to complete the initial steps mentioned [https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project here].&lt;br /&gt;
&lt;br /&gt;
The steps are as follows:&lt;br /&gt;
&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
* Create a rust JS::StreamConsumer wrapper that stores a pointer to the object and has methods for consumeChunk, streamEnd, streamError, and noteResponseURLs.&lt;br /&gt;
* Implement an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches ConsumeStreamCallback that initiates the streaming webassembly compilation then creates a wrapper for the stream consumer and stores it in the Response object&lt;br /&gt;
* Implement an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches ReportStreamErrorCallback and reports an error with the error! macro&lt;br /&gt;
* Lastly, call InitStreamConsumerCallback in new_rt_and_cx with the two new functions as arguments, described in the specifications&lt;br /&gt;
&lt;br /&gt;
The subsequent steps mentioned [https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project here] are to be done for the final project.&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern'''==&lt;br /&gt;
Design patterns are not applicable as our task involved just implementation of methods. However, the Implementation section below provides details of the steps as why it was implemented, the way it was implemented&lt;br /&gt;
&lt;br /&gt;
=='''Implementation'''==&lt;br /&gt;
The following steps were followed to meet the project requirements as per this [https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project github page].&lt;br /&gt;
&lt;br /&gt;
===Step 1===&lt;br /&gt;
&lt;br /&gt;
We created a Stream Consumer structure which has the methods for consumeChunk, streamEnd, streamError, and noteResponseURLs based on the Stream Consumer class implemented in the Mozilla Spider Monkey module. &lt;br /&gt;
&lt;br /&gt;
[[File:StreamConsumerFunctions.png]]&lt;br /&gt;
&lt;br /&gt;
===Step 2===&lt;br /&gt;
&lt;br /&gt;
We implemented the ReportStreamErrorCallback function to retrieve and report errors during stream compilation.&lt;br /&gt;
&lt;br /&gt;
[[File:XHRStruct.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Step 3===&lt;br /&gt;
&lt;br /&gt;
Finally, we have implemented the overrideMimeType method according to the [https://xhr.spec.whatwg.org/#the-overridemimetype%28%29-method XHR specifications].&lt;br /&gt;
* If the state is loading or done, we have returned Invalid State Error&lt;br /&gt;
* Then we have parsed the mime passed in the argument&lt;br /&gt;
* If the parsing of mime was successful, we have saved the appropriate values in override_mime_type and override_charset&lt;br /&gt;
&lt;br /&gt;
[[File:overrideMimeType.png]]&lt;br /&gt;
&lt;br /&gt;
=='''Testing'''==&lt;br /&gt;
&lt;br /&gt;
Unfortunately, the code added in the initial steps(scope) is not expected to have any change in behaviour on its own. The best we can do is to load https://wasm.bootcss.com/demo/Tanks/ and verify that there is no change in behaviour due to our changes.&lt;br /&gt;
&lt;br /&gt;
Eventhough we could not perform any kind of functional tests, we took steps to look out for compilation errors before raising the pull request.&lt;br /&gt;
&lt;br /&gt;
Following are the steps for the same:&lt;br /&gt;
&lt;br /&gt;
# Install the pre-requisites required for servo as mentioned [https://github.com/servo/servo/blob/master/README.md here] &lt;br /&gt;
# Run the following commands&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; &lt;br /&gt;
  cd&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 git clone https://github.com/Akash-Pateria/servo&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 cd servo&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 git checkout -b origin/async-wasm-compilation-initial&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach fmt&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach test-tidy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach build -d&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can see that the servo build is successful and no errors are reported.&lt;br /&gt;
&lt;br /&gt;
=='''Pull Request'''==&lt;br /&gt;
&lt;br /&gt;
Here is our [https://github.com/servo/servo/pull/24563 pull request]. In the PR, you can see all the code snippets added to implement the above-mentioned steps.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/book&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://rustbyexample.com/&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rrastog3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_M1950._Support_Asynchronous_Web_Assembly_Compilation&amp;diff=125945</id>
		<title>CSC/ECE 517 Fall 2019 - M1950. Support Asynchronous Web Assembly Compilation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_M1950._Support_Asynchronous_Web_Assembly_Compilation&amp;diff=125945"/>
		<updated>2019-10-28T19:48:47Z</updated>

		<summary type="html">&lt;p&gt;Rrastog3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Servo is a prototype web browser engine written in the [https://en.wikipedia.org/wiki/Rust_(programming_language) Rust] language. Servo is a new, experimental browser that supports synchronously compiling and executing WebAssembly code, but does not yet support asynchronous compilation. This means that the entire WebAssembly program must be fetched before compilation can begin, which leads to longer time loading pages that run WebAssembly programs than in other web browsers. The goal of the project is to support compiling WebAssembly programs asynchronously so compilation can begin while the program is still being fetched from the network.&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo]Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in [https://www.rust-lang.org/ Rust] language. The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc. &lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[https://doc.rust-lang.org/book/index.html Rust] is an open source systems programming language developed by Mozilla. Servo is written in Rust. The main purpose behind it's design is to be thread safe and concurrent. The emphasis is also on speed, safety and control of memory layout.&lt;br /&gt;
&lt;br /&gt;
=='''Scope'''==&lt;br /&gt;
&lt;br /&gt;
The scope of the project was to complete the initial steps mentioned [https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project here].&lt;br /&gt;
&lt;br /&gt;
The steps are as follows:&lt;br /&gt;
&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
* Create a rust JS::StreamConsumer wrapper that stores a pointer to the object and has methods for consumeChunk, streamEnd, streamError, and noteResponseURLs.&lt;br /&gt;
* Implement an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches ConsumeStreamCallback that initiates the streaming webassembly compilation then creates a wrapper for the stream consumer and stores it in the Response object&lt;br /&gt;
* Implement an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches ReportStreamErrorCallback and reports an error with the error! macro&lt;br /&gt;
* Lastly, call InitStreamConsumerCallback in new_rt_and_cx with the two new functions as arguments, described in the specifications&lt;br /&gt;
&lt;br /&gt;
The subsequent steps mentioned [https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project here] are to be done for the final project.&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern'''==&lt;br /&gt;
Design patterns are not applicable as our task involved just implementing a method. However, the Implementation section below provides details of the steps as why it was implemented, the way it was implemented&lt;br /&gt;
&lt;br /&gt;
=='''Implementation'''==&lt;br /&gt;
The following steps were followed to meet the project requirements as per this [https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project github page].&lt;br /&gt;
&lt;br /&gt;
===Step 1===&lt;br /&gt;
&lt;br /&gt;
As we need to implement the overrideMimeType() method, we have uncommented the overrideMimeType() method from the XMLHttpRequest interface (components/script/dom/webidls/XMLHttpRequest.webidl).&lt;br /&gt;
&lt;br /&gt;
[[File:StreamConsumerFunctions.png]]&lt;br /&gt;
&lt;br /&gt;
===Step 2===&lt;br /&gt;
&lt;br /&gt;
As two new fields are necessary for overrideMimeType() method implementation, override_mime_type to store the mime type of the mime passed in the argument and override_charset to store the charset of the mime passed in the argument. &lt;br /&gt;
Hence, we have added two new fields: override_mime_type and override_charset to the XMLHttpRequest structure.&lt;br /&gt;
&lt;br /&gt;
[[File:XHRStruct.png]]&lt;br /&gt;
&lt;br /&gt;
===Step 3===&lt;br /&gt;
&lt;br /&gt;
Finally, we have implemented the overrideMimeType method according to the [https://xhr.spec.whatwg.org/#the-overridemimetype%28%29-method XHR specifications].&lt;br /&gt;
* If the state is loading or done, we have returned Invalid State Error&lt;br /&gt;
* Then we have parsed the mime passed in the argument&lt;br /&gt;
* If the parsing of mime was successful, we have saved the appropriate values in override_mime_type and override_charset&lt;br /&gt;
&lt;br /&gt;
[[File:overrideMimeType.png]]&lt;br /&gt;
&lt;br /&gt;
=='''Testing'''==&lt;br /&gt;
&lt;br /&gt;
Unfortunately, the code added in the initial steps(scope) is not expected to have any change in behaviour on its own. The best we can do is to load https://wasm.bootcss.com/demo/Tanks/ and verify that there is no change in behaviour due to our changes.&lt;br /&gt;
&lt;br /&gt;
Eventhough we could not perform any kind of functional tests, we took steps to look out for compilation errors before raising the pull request.&lt;br /&gt;
&lt;br /&gt;
Following are the steps for the same:&lt;br /&gt;
&lt;br /&gt;
# Install the pre-requisites required for servo as mentioned [https://github.com/servo/servo/blob/master/README.md here] &lt;br /&gt;
# Run the following commands&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; &lt;br /&gt;
  cd&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 git clone https://github.com/Akash-Pateria/servo&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 cd servo&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 git checkout -b origin/async-wasm-compilation-initial&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach fmt&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach test-tidy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach build -d&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can see that the servo build is successful and no errors are reported.&lt;br /&gt;
&lt;br /&gt;
=='''Pull Request'''==&lt;br /&gt;
&lt;br /&gt;
Here is our [https://github.com/servo/servo/pull/24563 pull request]. In the PR, you can see all the code snippets added to implement the above-mentioned steps.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/book&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://rustbyexample.com/&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rrastog3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:StreamConsumerFunctions.png&amp;diff=125944</id>
		<title>File:StreamConsumerFunctions.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:StreamConsumerFunctions.png&amp;diff=125944"/>
		<updated>2019-10-28T19:47:53Z</updated>

		<summary type="html">&lt;p&gt;Rrastog3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Rrastog3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_M1950._Support_Asynchronous_Web_Assembly_Compilation&amp;diff=125937</id>
		<title>CSC/ECE 517 Fall 2019 - M1950. Support Asynchronous Web Assembly Compilation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_M1950._Support_Asynchronous_Web_Assembly_Compilation&amp;diff=125937"/>
		<updated>2019-10-28T19:40:58Z</updated>

		<summary type="html">&lt;p&gt;Rrastog3: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Servo is a prototype web browser engine written in the [https://en.wikipedia.org/wiki/Rust_(programming_language) Rust] language. Servo is a new, experimental browser that supports synchronously compiling and executing WebAssembly code, but does not yet support asynchronous compilation. This means that the entire WebAssembly program must be fetched before compilation can begin, which leads to longer time loading pages that run WebAssembly programs than in other web browsers. The goal of the project is to support compiling WebAssembly programs asynchronously so compilation can begin while the program is still being fetched from the network.&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo]Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in [https://www.rust-lang.org/ Rust] language. The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc. &lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[https://doc.rust-lang.org/book/index.html Rust] is an open source systems programming language developed by Mozilla. Servo is written in Rust. The main purpose behind it's design is to be thread safe and concurrent. The emphasis is also on speed, safety and control of memory layout.&lt;br /&gt;
&lt;br /&gt;
=='''Scope'''==&lt;br /&gt;
&lt;br /&gt;
The scope of the project was to complete the initial steps mentioned [https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project here].&lt;br /&gt;
&lt;br /&gt;
The steps are as follows:&lt;br /&gt;
&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
* Create a rust JS::StreamConsumer wrapper that stores a pointer to the object and has methods for consumeChunk, streamEnd, streamError, and noteResponseURLs.&lt;br /&gt;
* Implement an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches ConsumeStreamCallback that initiates the streaming webassembly compilation then creates a wrapper for the stream consumer and stores it in the Response object&lt;br /&gt;
* Implement an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches ReportStreamErrorCallback and reports an error with the error! macro&lt;br /&gt;
* Lastly, call InitStreamConsumerCallback in new_rt_and_cx with the two new functions as arguments, described in the specifications&lt;br /&gt;
&lt;br /&gt;
The subsequent steps mentioned [https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project here] are to be done for the final project.&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern'''==&lt;br /&gt;
Design patterns are not applicable as our task involved just implementing a method. However, the Implementation section below provides details of the steps as why it was implemented, the way it was implemented&lt;br /&gt;
&lt;br /&gt;
=='''Implementation'''==&lt;br /&gt;
The following steps were followed to meet the project requirements as per this [https://github.com/servo/servo/wiki/Implement-support-for-missing-XMLHttpRequest-APIs github page].&lt;br /&gt;
&lt;br /&gt;
===Step 1===&lt;br /&gt;
&lt;br /&gt;
As we need to implement the overrideMimeType() method, we have uncommented the overrideMimeType() method from the XMLHttpRequest interface (components/script/dom/webidls/XMLHttpRequest.webidl).&lt;br /&gt;
&lt;br /&gt;
[[File:Uncomment-overrideMimeType.png]]&lt;br /&gt;
&lt;br /&gt;
===Step 2===&lt;br /&gt;
&lt;br /&gt;
As two new fields are necessary for overrideMimeType() method implementation, override_mime_type to store the mime type of the mime passed in the argument and override_charset to store the charset of the mime passed in the argument. &lt;br /&gt;
Hence, we have added two new fields: override_mime_type and override_charset to the XMLHttpRequest structure.&lt;br /&gt;
&lt;br /&gt;
[[File:XHRStruct.png]]&lt;br /&gt;
&lt;br /&gt;
===Step 3===&lt;br /&gt;
&lt;br /&gt;
Finally, we have implemented the overrideMimeType method according to the [https://xhr.spec.whatwg.org/#the-overridemimetype%28%29-method XHR specifications].&lt;br /&gt;
* If the state is loading or done, we have returned Invalid State Error&lt;br /&gt;
* Then we have parsed the mime passed in the argument&lt;br /&gt;
* If the parsing of mime was successful, we have saved the appropriate values in override_mime_type and override_charset&lt;br /&gt;
&lt;br /&gt;
[[File:overrideMimeType.png]]&lt;br /&gt;
&lt;br /&gt;
=='''Testing'''==&lt;br /&gt;
&lt;br /&gt;
Unfortunately, the code added in the initial steps(scope) is not expected to have any change in behaviour on its own. The best we can do is to load https://wasm.bootcss.com/demo/Tanks/ and verify that there is no change in behaviour due to our changes.&lt;br /&gt;
&lt;br /&gt;
Eventhough we could not perform any kind of functional tests, we took steps to look out for compilation errors before raising the pull request.&lt;br /&gt;
&lt;br /&gt;
Following are the steps for the same:&lt;br /&gt;
&lt;br /&gt;
# Install the pre-requisites required for servo as mentioned [https://github.com/servo/servo/blob/master/README.md here] &lt;br /&gt;
# Run the following commands&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; &lt;br /&gt;
  cd&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 git clone https://github.com/Akash-Pateria/servo&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 cd servo&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 git checkout -b origin/async-wasm-compilation-initial&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach fmt&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach test-tidy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach build -d&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Pull Request'''==&lt;br /&gt;
&lt;br /&gt;
Here is our [https://github.com/servo/servo/pull/24563 pull request]. In the PR, you can see all the code snippets added to implement the above-mentioned steps.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/book&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://rustbyexample.com/&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rrastog3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_M1950._Support_Asynchronous_Web_Assembly_Compilation&amp;diff=125935</id>
		<title>CSC/ECE 517 Fall 2019 - M1950. Support Asynchronous Web Assembly Compilation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_M1950._Support_Asynchronous_Web_Assembly_Compilation&amp;diff=125935"/>
		<updated>2019-10-28T19:38:44Z</updated>

		<summary type="html">&lt;p&gt;Rrastog3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Servo is a prototype web browser engine written in the [https://en.wikipedia.org/wiki/Rust_(programming_language) Rust] language. Servo is a new, experimental browser that supports synchronously compiling and executing WebAssembly code, but does not yet support asynchronous compilation. This means that the entire WebAssembly program must be fetched before compilation can begin, which leads to longer time loading pages that run WebAssembly programs than in other web browsers. The goal of the project is to support compiling WebAssembly programs asynchronously so compilation can begin while the program is still being fetched from the network.&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo]Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in [https://www.rust-lang.org/ Rust] language. The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc. &lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[https://doc.rust-lang.org/book/index.html Rust] is an open source systems programming language developed by Mozilla. Servo is written in Rust. The main purpose behind it's design is to be thread safe and concurrent. The emphasis is also on speed, safety and control of memory layout.&lt;br /&gt;
&lt;br /&gt;
=='''Scope'''==&lt;br /&gt;
&lt;br /&gt;
The scope of the project was to complete the initial steps mentioned [https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project here].&lt;br /&gt;
&lt;br /&gt;
The steps are as follows:&lt;br /&gt;
&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
* Create a rust JS::StreamConsumer wrapper that stores a pointer to the object and has methods for consumeChunk, streamEnd, streamError, and noteResponseURLs.&lt;br /&gt;
* Implement an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches ConsumeStreamCallback that initiates the streaming webassembly compilation then creates a wrapper for the stream consumer and stores it in the Response object&lt;br /&gt;
* Implement an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches ReportStreamErrorCallback and reports an error with the error! macro&lt;br /&gt;
* Lastly, call InitStreamConsumerCallback in new_rt_and_cx with the two new functions as arguments, described in the specifications&lt;br /&gt;
&lt;br /&gt;
The subsequent steps mentioned [https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project here] are to be done for the final project.&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern'''==&lt;br /&gt;
Design patterns are not applicable as our task involved just implementing a method. However, the Implementation section below provides details of the steps as why it was implemented, the way it was implemented&lt;br /&gt;
&lt;br /&gt;
=='''Implementation'''==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Testing'''==&lt;br /&gt;
&lt;br /&gt;
Unfortunately, the code added in the initial steps(scope) is not expected to have any change in behaviour on its own. The best we can do is to load https://wasm.bootcss.com/demo/Tanks/ and verify that there is no change in behaviour due to our changes.&lt;br /&gt;
&lt;br /&gt;
Eventhough we could not perform any kind of functional tests, we took steps to look out for compilation errors before raising the pull request.&lt;br /&gt;
&lt;br /&gt;
Following are the steps for the same:&lt;br /&gt;
&lt;br /&gt;
# Install the pre-requisites required for servo as mentioned [https://github.com/servo/servo/blob/master/README.md here] &lt;br /&gt;
# Run the following commands&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; &lt;br /&gt;
  cd&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 git clone https://github.com/Akash-Pateria/servo&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 cd servo&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 git checkout -b origin/async-wasm-compilation-initial&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach fmt&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach test-tidy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach build -d&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Pull Request'''==&lt;br /&gt;
&lt;br /&gt;
Here is our [https://github.com/servo/servo/pull/24563 pull request]. In the PR, you can see all the code snippets added to implement the above-mentioned steps.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/book&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://rustbyexample.com/&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rrastog3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_M1950._Support_Asynchronous_Web_Assembly_Compilation&amp;diff=125922</id>
		<title>CSC/ECE 517 Fall 2019 - M1950. Support Asynchronous Web Assembly Compilation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_M1950._Support_Asynchronous_Web_Assembly_Compilation&amp;diff=125922"/>
		<updated>2019-10-28T19:13:05Z</updated>

		<summary type="html">&lt;p&gt;Rrastog3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Servo is a prototype web browser engine written in the [https://en.wikipedia.org/wiki/Rust_(programming_language) Rust] language. Servo is a new, experimental browser that supports synchronously compiling and executing WebAssembly code, but does not yet support asynchronous compilation. This means that the entire WebAssembly program must be fetched before compilation can begin, which leads to longer time loading pages that run WebAssembly programs than in other web browsers. The goal of the project is to support compiling WebAssembly programs asynchronously so compilation can begin while the program is still being fetched from the network.&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo]Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in [https://www.rust-lang.org/ Rust] language. The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc. &lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[https://doc.rust-lang.org/book/index.html Rust] is an open source systems programming language developed by Mozilla. Servo is written in Rust. The main purpose behind it's design is to be thread safe and concurrent. The emphasis is also on speed, safety and control of memory layout.&lt;br /&gt;
&lt;br /&gt;
=='''Scope'''==&lt;br /&gt;
&lt;br /&gt;
The scope of the project was to complete the initial steps mentioned [https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project here].&lt;br /&gt;
&lt;br /&gt;
The steps are as follows:&lt;br /&gt;
&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
* Create a rust JS::StreamConsumer wrapper that stores a pointer to the object and has methods for consumeChunk, streamEnd, streamError, and noteResponseURLs.&lt;br /&gt;
* Implement an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches ConsumeStreamCallback that initiates the streaming webassembly compilation then creates a wrapper for the stream consumer and stores it in the Response object&lt;br /&gt;
* Implement an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches ReportStreamErrorCallback and reports an error with the error! macro&lt;br /&gt;
* Lastly, call InitStreamConsumerCallback in new_rt_and_cx with the two new functions as arguments, described in the specifications&lt;br /&gt;
&lt;br /&gt;
The subsequent steps mentioned [https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project here] are to be done for the final project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern'''==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Testing'''==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Pull Request'''==&lt;br /&gt;
&lt;br /&gt;
Here is our [https://github.com/servo/servo/pull/24563 pull request]. In the PR, you can see all the code snippets added to implement the above-mentioned steps.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/book&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://rustbyexample.com/&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rrastog3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_M1950._Support_Asynchronous_Web_Assembly_Compilation&amp;diff=125919</id>
		<title>CSC/ECE 517 Fall 2019 - M1950. Support Asynchronous Web Assembly Compilation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_M1950._Support_Asynchronous_Web_Assembly_Compilation&amp;diff=125919"/>
		<updated>2019-10-28T19:10:25Z</updated>

		<summary type="html">&lt;p&gt;Rrastog3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Servo is a prototype web browser engine written in the [https://en.wikipedia.org/wiki/Rust_(programming_language) Rust] language. Servo is a new, experimental browser that supports synchronously compiling and executing WebAssembly code, but does not yet support asynchronous compilation. This means that the entire WebAssembly program must be fetched before compilation can begin, which leads to longer time loading pages that run WebAssembly programs than in other web browsers. The goal of the project is to support compiling WebAssembly programs asynchronously so compilation can begin while the program is still being fetched from the network.&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo]Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in [https://www.rust-lang.org/ Rust] language. The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc. &lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[https://doc.rust-lang.org/book/index.html Rust] is an open source systems programming language developed by Mozilla. Servo is written in Rust. The main purpose behind it's design is to be thread safe and concurrent. The emphasis is also on speed, safety and control of memory layout.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Next we had to create a rust JS::StreamConsumer wrapper that stores a pointer to the object and has methods for consumeChunk, streamEnd, streamError, and noteResponseURLs.&lt;br /&gt;
* Then we had to create an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches ConsumeStreamCallback that initiates the streaming WebAssembly compilation then creates a wrapper for the stream consumer and stores it in the Response object&lt;br /&gt;
* Similarly we had to create an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches ReportStreamErrorCallback and reports an error with the error! macro&lt;br /&gt;
* The final step was to call InitStreamConsumerCallback in new_rt_and_cx with the two new functions as arguments&lt;br /&gt;
&lt;br /&gt;
=='''Scope'''==&lt;br /&gt;
The scope of the project was to complete the initial steps mentioned [https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project here].&lt;br /&gt;
&lt;br /&gt;
The steps are as follows:&lt;br /&gt;
&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
* Create a rust JS::StreamConsumer wrapper that stores a pointer to the object and has methods for consumeChunk, streamEnd, streamError, and noteResponseURLs.&lt;br /&gt;
* Implement an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches ConsumeStreamCallback that initiates the streaming webassembly compilation then creates a wrapper for the stream consumer and stores it in the Response object&lt;br /&gt;
* Implement an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches ReportStreamErrorCallback and reports an error with the error! macro&lt;br /&gt;
* Lastly, call InitStreamConsumerCallback in new_rt_and_cx with the two new functions as arguments, described in the specifications&lt;br /&gt;
&lt;br /&gt;
The subsequent steps mentioned [https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project here] are to be done for the final project.&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern'''==&lt;br /&gt;
&lt;br /&gt;
=='''Testing'''==&lt;br /&gt;
&lt;br /&gt;
=='''Pull Request'''==&lt;br /&gt;
Here is our [https://github.com/servo/servo/pull/24563 pull request]. In the PR, you can see all the code snippets added to implement the above-mentioned steps.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/book&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://rustbyexample.com/&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rrastog3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_M1950._Support_Asynchronous_Web_Assembly_Compilation&amp;diff=125909</id>
		<title>CSC/ECE 517 Fall 2019 - M1950. Support Asynchronous Web Assembly Compilation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_M1950._Support_Asynchronous_Web_Assembly_Compilation&amp;diff=125909"/>
		<updated>2019-10-28T18:46:30Z</updated>

		<summary type="html">&lt;p&gt;Rrastog3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Servo is a prototype web browser engine written in the [https://en.wikipedia.org/wiki/Rust_(programming_language) Rust] language.Servo uses a variety of back-end implementations for drawing graphics depending on the operating system.One of such back-end is only compatible with Android right now, and we want to extend and refactor that back-end to enable on all Linux systems..&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo]Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in [https://www.rust-lang.org/ Rust] language. The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc. &lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[https://doc.rust-lang.org/book/index.html Rust] is an open source systems programming language developed by Mozilla. Servo is written in Rust. The main purpose behind it's design is to be thread safe and concurrent. The emphasis is also on speed, safety and control of memory layout.&lt;br /&gt;
&lt;br /&gt;
=='''Scope'''==&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
* Next we had to create a rust JS::StreamConsumer wrapper that stores a pointer to the object and has methods for consumeChunk, streamEnd, streamError, and noteResponseURLs.&lt;br /&gt;
* Then we had to create an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches ConsumeStreamCallback that initiates the streaming webassembly compilation then creates a wrapper for the stream consumer and stores it in the Response object&lt;br /&gt;
* Similarly we had to create an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches ReportStreamErrorCallback and reports an error with the error! macro&lt;br /&gt;
* The final step was to call InitStreamConsumerCallback in new_rt_and_cx with the two new functions as arguments&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern'''==&lt;br /&gt;
&lt;br /&gt;
=='''Testing'''==&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/book&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://rustbyexample.com/&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rrastog3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_M1950._Support_Asynchronous_Web_Assembly_Compilation&amp;diff=125908</id>
		<title>CSC/ECE 517 Fall 2019 - M1950. Support Asynchronous Web Assembly Compilation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_M1950._Support_Asynchronous_Web_Assembly_Compilation&amp;diff=125908"/>
		<updated>2019-10-28T18:46:08Z</updated>

		<summary type="html">&lt;p&gt;Rrastog3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Servo is a prototype web browser engine written in the [https://en.wikipedia.org/wiki/Rust_(programming_language) Rust] language.Servo uses a variety of back-end implementations for drawing graphics depending on the operating system.One of such back-end is only compatible with Android right now, and we want to extend and refactor that back-end to enable on all Linux systems..&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo]Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in [https://www.rust-lang.org/ Rust] language. The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc. &lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[https://doc.rust-lang.org/book/index.html Rust] is an open source systems programming language developed by Mozilla. Servo is written in Rust. The main purpose behind it's design is to be thread safe and concurrent. The emphasis is also on speed, safety and control of memory layout.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
* Next we had to create a rust JS::StreamConsumer wrapper that stores a pointer to the object and has methods for consumeChunk, streamEnd, streamError, and noteResponseURLs.&lt;br /&gt;
* Then we had to create an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches ConsumeStreamCallback that initiates the streaming webassembly compilation then creates a wrapper for the stream consumer and stores it in the Response object&lt;br /&gt;
* Similarly we had to create an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches ReportStreamErrorCallback and reports an error with the error! macro&lt;br /&gt;
* The final step was to call InitStreamConsumerCallback in new_rt_and_cx with the two new functions as arguments&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern'''==&lt;br /&gt;
&lt;br /&gt;
=='''Testing'''==&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/book&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://rustbyexample.com/&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rrastog3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_M1950._Support_Asynchronous_Web_Assembly_Compilation&amp;diff=125907</id>
		<title>CSC/ECE 517 Fall 2019 - M1950. Support Asynchronous Web Assembly Compilation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_M1950._Support_Asynchronous_Web_Assembly_Compilation&amp;diff=125907"/>
		<updated>2019-10-28T18:42:30Z</updated>

		<summary type="html">&lt;p&gt;Rrastog3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Servo is a prototype web browser engine written in the [https://en.wikipedia.org/wiki/Rust_(programming_language) Rust] language.Servo uses a variety of back-end implementations for drawing graphics depending on the operating system.One of such back-end is only compatible with Android right now, and we want to extend and refactor that back-end to enable on all Linux systems..&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo]Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in [https://www.rust-lang.org/ Rust] language. The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc. &lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[https://doc.rust-lang.org/book/index.html Rust] is an open source systems programming language developed by Mozilla. Servo is written in Rust. The main purpose behind it's design is to be thread safe and concurrent. The emphasis is also on speed, safety and control of memory layout.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
* Next we had to create a rust JS::StreamConsumer wrapper that stores a pointer to the object and has methods for consumeChunk, streamEnd, streamError, and noteResponseURLs.&lt;br /&gt;
* Then we had to create an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches ConsumeStreamCallback that initiates the streaming webassembly compilation then creates a wrapper for the stream consumer and stores it in the Response object&lt;br /&gt;
* Similarly we had to create an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches ReportStreamErrorCallback and reports an error with the error! macro&lt;br /&gt;
* The final step was to call InitStreamConsumerCallback in new_rt_and_cx with the two new functions as arguments&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern'''==&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/book&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://rustbyexample.com/&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rrastog3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_M1950._Support_Asynchronous_Web_Assembly_Compilation&amp;diff=125906</id>
		<title>CSC/ECE 517 Fall 2019 - M1950. Support Asynchronous Web Assembly Compilation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_M1950._Support_Asynchronous_Web_Assembly_Compilation&amp;diff=125906"/>
		<updated>2019-10-28T18:41:09Z</updated>

		<summary type="html">&lt;p&gt;Rrastog3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Servo is a prototype web browser engine written in the RUST language.Servo uses a variety of back-end implementations for drawing graphics depending on the operating system.One of such back-end is only compatible with Android right now, and we want to extend and refactor that back-end to enable on all Linux systems..&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo]Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in [https://www.rust-lang.org/ Rust] language. The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc. &lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[https://doc.rust-lang.org/book/index.html Rust] is an open source systems programming language developed by Mozilla. Servo is written in Rust. The main purpose behind it's design is to be thread safe and concurrent. The emphasis is also on speed, safety and control of memory layout.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
* Next we had to create a rust JS::StreamConsumer wrapper that stores a pointer to the object and has methods for consumeChunk, streamEnd, streamError, and noteResponseURLs.&lt;br /&gt;
* Then we had to create an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches ConsumeStreamCallback that initiates the streaming webassembly compilation then creates a wrapper for the stream consumer and stores it in the Response object&lt;br /&gt;
* Similarly we had to create an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches ReportStreamErrorCallback and reports an error with the error! macro&lt;br /&gt;
* The final step was to call InitStreamConsumerCallback in new_rt_and_cx with the two new functions as arguments&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern'''==&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/book&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://rustbyexample.com/&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rrastog3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_M1950._Support_Asynchronous_Web_Assembly_Compilation&amp;diff=125905</id>
		<title>CSC/ECE 517 Fall 2019 - M1950. Support Asynchronous Web Assembly Compilation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_M1950._Support_Asynchronous_Web_Assembly_Compilation&amp;diff=125905"/>
		<updated>2019-10-28T18:36:12Z</updated>

		<summary type="html">&lt;p&gt;Rrastog3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Servo is a prototype web browser engine written in the RUST language.Servo uses a variety of back-end implementations for drawing graphics depending on the operating system.One of such back-end is only compatible with Android right now, and we want to extend and refactor that back-end to enable on all Linux systems..&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
## Servo&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo]Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in [https://www.rust-lang.org/ Rust] language. The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[https://doc.rust-lang.org/book/index.html Rust] is an open source systems programming language developed by Mozilla. Servo is written in Rust. The main purpose behind it's design is to be thread safe and concurrent. The emphasis is also on speed, safety and control of memory layout.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
* Next we had to create a rust JS::StreamConsumer wrapper that stores a pointer to the object and has methods for consumeChunk, streamEnd, streamError, and noteResponseURLs.&lt;br /&gt;
* Then we had to create an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches ConsumeStreamCallback that initiates the streaming webassembly compilation then creates a wrapper for the stream consumer and stores it in the Response object&lt;br /&gt;
* Similarly we had to create an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches ReportStreamErrorCallback and reports an error with the error! macro&lt;br /&gt;
* The final step was to call InitStreamConsumerCallback in new_rt_and_cx with the two new functions as arguments&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern'''==&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/book&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://rustbyexample.com/&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rrastog3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_M1950._Support_Asynchronous_Web_Assembly_Compilation&amp;diff=125904</id>
		<title>CSC/ECE 517 Fall 2019 - M1950. Support Asynchronous Web Assembly Compilation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_M1950._Support_Asynchronous_Web_Assembly_Compilation&amp;diff=125904"/>
		<updated>2019-10-28T18:35:08Z</updated>

		<summary type="html">&lt;p&gt;Rrastog3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Servo is a prototype web browser engine written in the [RUST](http://en.wikipedia.org/wiki/JavaScript) language.Servo uses a variety of back-end implementations for drawing graphics depending on the operating system.One of such back-end is only compatible with Android right now, and we want to extend and refactor that back-end to enable on all Linux systems..&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
## Servo&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo]Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in [https://www.rust-lang.org/ Rust] language. The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[https://doc.rust-lang.org/book/index.html Rust] is an open source systems programming language developed by Mozilla. Servo is written in Rust. The main purpose behind it's design is to be thread safe and concurrent. The emphasis is also on speed, safety and control of memory layout.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
* Next we had to create a rust JS::StreamConsumer wrapper that stores a pointer to the object and has methods for consumeChunk, streamEnd, streamError, and noteResponseURLs.&lt;br /&gt;
* Then we had to create an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches ConsumeStreamCallback that initiates the streaming webassembly compilation then creates a wrapper for the stream consumer and stores it in the Response object&lt;br /&gt;
* Similarly we had to create an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches ReportStreamErrorCallback and reports an error with the error! macro&lt;br /&gt;
* The final step was to call InitStreamConsumerCallback in new_rt_and_cx with the two new functions as arguments&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern'''==&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/stable/book/&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://rustbyexample.com/&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rrastog3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/Mozilla_Refactor_GLES2&amp;diff=125903</id>
		<title>CSC/ECE 517 Fall 2015/Mozilla Refactor GLES2</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/Mozilla_Refactor_GLES2&amp;diff=125903"/>
		<updated>2019-10-28T18:33:14Z</updated>

		<summary type="html">&lt;p&gt;Rrastog3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''' Refactor GLES2 Student Project with SERVO &amp;amp; RUST ''''&lt;br /&gt;
&lt;br /&gt;
Servo is a prototype web browser engine written in the RUST language.Servo uses a variety of back-end implementations for drawing graphics depending on the operating system.One of such back-end is only compatible with Android right now, and we want to extend and refactor that back-end to enable on all Linux systems..&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo]Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in [https://www.rust-lang.org/ Rust] language. The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc. &lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[https://doc.rust-lang.org/book/title-page.html Rust] is an open source systems programming language developed by Mozilla. Servo is written in Rust. The main purpose behind it's design is to be thread safe and concurrent. The emphasis is also on speed, safety and control of memory layout.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
* The next requirement was to build the Rust-layers independently of Servo. For this, we &lt;br /&gt;
* Next, we had to over-ride cargo to use our local copy of Rust-layers, so we had to add a cargo override to it. For this, we created a &amp;lt;code&amp;gt;.cargo&amp;lt;/code&amp;gt; folder in our home directory(same place that servo and Rust-layers reside), and added a &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; file to that folder. The content of that config file is a path to our local Rust-layers.&lt;br /&gt;
    paths = [path/to/rust_layers]&lt;br /&gt;
* Next, we had to add a new command line argument in Servo, which would allow selecting the graphics background (GL or ES2). For this, we made the following changes:&lt;br /&gt;
- We added a command line option which lets the user enter the option &amp;lt;code&amp;gt;-E&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;--es2&amp;lt;/code&amp;gt; if the user wants to set ES2 as the graphic back end option. GL is set by default, hence if the user doesn't give any argument, Gl is selected as the graphic back end option. Example is as below&lt;br /&gt;
    ./mach run [url] -E&lt;br /&gt;
* Next, we had to add a flag in Rust-layers. This change was made in the file [https://github.com/prashantgupta24/rust-layers/blob/master/src/rendergl.rs Rust/src/rendergl.rs] in the &amp;lt;code&amp;gt;RenderContext::new&amp;lt;/code&amp;gt; function. For this, we did the following change:&lt;br /&gt;
- We defined an enum &amp;lt;code&amp;gt;GraphicOption&amp;lt;/code&amp;gt; which defined two options &amp;lt;code&amp;gt;GL&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;ES2&amp;lt;/code&amp;gt; and then based on the boolean value from the servo &amp;lt;code&amp;gt;opts.rs&amp;lt;/code&amp;gt;, we set a variable with the respective enum value &amp;lt;code&amp;gt;GL&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;ES2&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Finally, we had to use the new command line option to pass the selected graphics back-end option to the Rust-layers context which we created in the previous step. For this we made changes to the [https://github.com/prashantgupta24/servo/blob/master/components/compositing/compositor.rs compositor.rs] in Compositing folder which is how Servo interacts with the Rust layers. The command line option is passed through the &amp;lt;code&amp;gt;initialize_compositing&amp;lt;/code&amp;gt; function.&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern'''==&lt;br /&gt;
We attempted to follow good OO practices by implementing the [https://en.wikipedia.org/wiki/Strategy_pattern Strategy design pattern] using Enum. &lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
After making our changes , the user can now dynamically pass in the option of GL or ES2 through the graphic command line option, and this option is passed on through the compositor to the rust layers during initialization. A video demonstration for the code changes is available [https://drive.google.com/file/d/0B9TVPg3YRoHqQUlvQXZkUUJPRzA/view?usp=sharing here]&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/stable/book/&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Refactor-GLES2-student-project&amp;lt;br&amp;gt;&lt;br /&gt;
5.    http://doc.crates.io/guide.html#overriding-dependencies&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://rustbyexample.com/&amp;lt;br&amp;gt;&lt;br /&gt;
7.    http://javarevisited.blogspot.com/2014/11/strategy-design-pattern-in-java-using-Enum-Example.html&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rrastog3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_M1950._Support_Asynchronous_Web_Assembly_Compilation&amp;diff=125902</id>
		<title>CSC/ECE 517 Fall 2019 - M1950. Support Asynchronous Web Assembly Compilation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_M1950._Support_Asynchronous_Web_Assembly_Compilation&amp;diff=125902"/>
		<updated>2019-10-28T18:31:36Z</updated>

		<summary type="html">&lt;p&gt;Rrastog3: Created page with &amp;quot; Servo is a prototype web browser engine written in the [RUST](http://en.wikipedia.org/wiki/JavaScript) language.Servo uses a variety of back-end implementations for drawing grap...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
Servo is a prototype web browser engine written in the [RUST](http://en.wikipedia.org/wiki/JavaScript) language.Servo uses a variety of back-end implementations for drawing graphics depending on the operating system.One of such back-end is only compatible with Android right now, and we want to extend and refactor that back-end to enable on all Linux systems..&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
## Servo&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo]Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in [https://www.rust-lang.org/ Rust] language. The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[http://doc.rust-lang.org/book/README.html Rust] is an open source systems programming language developed by Mozilla. Servo is written in Rust. The main purpose behind it's design is to be thread safe and concurrent. The emphasis is also on speed, safety and control of memory layout.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
* Next we had to create a rust JS::StreamConsumer wrapper that stores a pointer to the object and has methods for consumeChunk, streamEnd, streamError, and noteResponseURLs.&lt;br /&gt;
* Then we had to create an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches ConsumeStreamCallback that initiates the streaming webassembly compilation then creates a wrapper for the stream consumer and stores it in the Response object&lt;br /&gt;
* Similarly we had to create an extern &amp;quot;C&amp;quot; function in script_runtime.rs that matches ReportStreamErrorCallback and reports an error with the error! macro&lt;br /&gt;
* The final step was to call InitStreamConsumerCallback in new_rt_and_cx with the two new functions as arguments&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern'''==&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/stable/book/&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://rustbyexample.com/&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rrastog3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019&amp;diff=125901</id>
		<title>CSC/ECE 517 Fall 2019</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019&amp;diff=125901"/>
		<updated>2019-10-28T18:25:46Z</updated>

		<summary type="html">&lt;p&gt;Rrastog3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* [[CSC/ECE 517 Fall 2019 - Project E1947. Refactor quiz_questionnaire_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2019 - Project E1965. Review report should link to the usual view for reviews]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2019 - E1972. OSS project J. Skellington: Accessing Assignment Rubrics]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2019 - E1961. Email notification to reviewers and instructors]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2019 - E1971. OSS project Finklestein: Instructors &amp;amp; Institutions]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2019 - E1953. Tagging report for student]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2019 - E1955.Write  unit tests for student_task.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2019 - E1954. Auto-generate submission directory names based on assignment names]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2019 - E1958. Two issues related to assignment management]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2019 - E1948. Refactor review_mapping_helper.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2019 - E1959. Intelligent copying of assignments without topics]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2019 - E1968. Fixes for adding members to teams]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2019 - E1969. Fixes for reviews not being available]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2019 - E1951. Remove multiple topics at a time]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2019 - E1957. Time travel Not Allowed..!!! Restrict TAs’ ability to change their own grade + limit file-size upload]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2019 - E1963. Changing assignment participant role]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2019 - E1941. Issues related to topic deadlines]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2019 - E1966. Tabbed_reviews partial file refactor for displaying the alternate view of reviews]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2019 - E1962. Email notification upon account creation]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2019 - E1967. Fix glitches in author feedback]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2019 - E1960. Create new late policy successfully and fixing &amp;quot;Back&amp;quot; link]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2019 - E1939. OSS Project Juniper: Bookmark enhancements]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2019 - M1950. Support Asynchronous Web Assembly Compilation]]&lt;/div&gt;</summary>
		<author><name>Rrastog3</name></author>
	</entry>
</feed>