User Tools

Site Tools


cs330_f2016:tmp

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

cs330_f2016:tmp [2016/10/12 14:30]
wingated
cs330_f2016:tmp [2021/06/30 23:42]
Line 1: Line 1:
-====Objective:​==== 
- 
-This lab is designed to transition our interpreter to a more powerful image processing engine by binding in new data types, high performance primitives, and automatic parallelization of interpretation. 
- 
----- 
-====Pre-requisite:​==== 
- 
-This lab builds on the previous interpreters. ​ In addition, to support the image processing primitives and text rendering primitives, you will need to install the ''​Cairo''​ and ''​Images''​ packages into Julia. ​ This is done using the Julia package management system: 
- 
-''​Pkg.add("​Cairo"​)''​ 
- 
-and 
- 
-''​Pkg.add("​Images"​)''​ 
- 
-**Note:** Julia uses Git as the foundation of their package management system. ​ This can create problems if your system can't access Git using a <​code>​git://</​code>​ protocol -- this is manifest by Julia hanging when trying to install packages. ​ To alleviate this, please check out the following links: 
- 
-[[https://​github.com/​JuliaLang/​julia/​issues/​7005|]] 
- 
-[[https://​github.com/​JuliaLang/​julia/​blob/​master/​README.md#​source-download-and-compilation|]] 
- 
-When I installed my Julia packages, it took a long time, but it worked. ​ Be patient. ​ :) 
- 
----- 
-====Deliverable:​==== 
- 
-For this lab, you will expand the interpreter that we have already built in three ways: with new data types, new high performance primitives, and automatic parallelization. 
- 
-The primary deliverable for this lab is a new Julia module. ​ Your module should export ''​parse'',​ ''​calc'' ​ ''​analyze''​ functions, and three return types, ''​NumVal'',​ ''​ClosureVal'',​ and ''​MatrixVal''​. 
- 
-Your module should be able to do everything that the three previous interpreters. ​ You are welcome to examine the code we developed in class. ​ The ''​CI8.jl''​ module is available on LearningSuite,​ under "​Content -> Julia -> Program analysis"​. 
- 
-Please name your module ''​HPInt''​. 
- 
----- 
-====Description:​==== 
- 
-For this lab, you will implement several new features: 
- 
-  - You must create a new ''​MatrixVal''​ data type. 
-  - You must bind in several new primitives (listed in the grammar below) 
-  - You must put in automatic parallelization statements. 
- 
-Each is discussed in more detail in the following sections. 
- 
-The grammar for our new language is the following: 
- 
-<code BNF> 
-<OWL> ::= number 
-          | (+ <OWL> <OWL> <​OWL>​*) 
-          | (- <OWL> <​OWL>​) 
-          | (* <OWL> <​OWL>​) 
-          | (/ <OWL> <​OWL>​) 
-          | (mod <OWL> <​OWL>​) 
-          | (collatz <​OWL>​) 
-          | (- <​OWL>​) ​     ​ 
-          | id 
-          | (if0 <OWL> <OWL> <​OWL>​) 
-          | (with ( (id <​OWL>​)* ) <​OWL>​) 
-          | (lambda (id*) <​OWL>​) 
-          | (and <OWL> <OWL> <​OWL>​*) 
-          | (<​OWL>​ <​OWL>​*) ​   
-          ​ 
-          # new primitives here 
-          ​ 
-          | (render_text <​string>​ <OWL> <​OWL>​) 
-          | (emboss <​OWL>​) 
-          | (simple_load <​string>​) 
-          | (drop_shadow <​OWL>​) 
-          | (inner_shadow <​OWL>​) 
-          | (min <OWL> <​OWL>​) 
-          | (max <OWL> <​OWL>​) 
-                ​ 
-</​code>​ 
- 
----- 
-===New functions:​=== 
- 
-The new productions in our language map directly to the primitive functions of the same name.  For each, you will need to do the following: 
- 
-  - Create a new node in the AST 
-  - Parse the parameter properly 
-  - Recursively analyze any ''<​OWL>''​ subexpressions 
-  - Implement a calc function for each AST node type 
- 
-We've been through this process several times in class, so we won't belabor it here. 
- 
-You must also ensure that the ''​+'',​ ''​-'',​ ''​*''​ and ''/''​ operators work any combination of ''​NumVal''​ or ''​MatrixVal''​. ​ I showed you my solution to this problem in class, but the reference code does not contain that, because your implementation (using ''​BinOp''​) is likely quite different. 
- 
-A few notes: 
- 
-  - The ''​min,​max,​+,​-,/,​*''​ functions all must work with any combination of ''​NumVal''​ and ''​MatrixVal''​s. 
-  - Remember that when multiplying a MatrixVal by a MatrixVal, we want to use the ''​.*''​ operation (element-wise matrix multiply) instead of ''​*''​ (matrix-matrix multiply). ​ 
- 
-===Error handling:​=== 
- 
-The new primitives create new opportunities for error handling. ​ You should bullet-proof them! 
- 
-In particular, you should carefully check the number and type of all subexpressions and strings. ​ For example, operations such as ''​min''​ or ''​max''​ should operate on ''​NumVal''​ or ''​MatrixVal''​ objects, but should throw an error if handed something like a ''​ClosureVal''​. 
- 
-===Parallelization:​=== 
- 
-We discussed several opportunities for parallelization in class. ​ You must use the proper combination of ''​@spawn''​ and ''​fetch''​ to parallelize as many of the ''​calc''​ functions as possible by spawning for each sub-call to ''​calc''​. ​ You do not need to parallelize the analyze functions. 
- 
  
cs330_f2016/tmp.txt ยท Last modified: 2021/06/30 23:42 (external edit)