cmat final presentation
play

CMAT Final Presentation Language Guru: Michael Berkowitz (meb2235) - PowerPoint PPT Presentation

CMAT Final Presentation Language Guru: Michael Berkowitz (meb2235) Project Manager: Frank Cabada (fc2452) System Architect: Marissa Ojeda (mgo2111) Tester: Daniel Rojas (dhr2119) Introduction What is ? LLVM Vectors


  1. CMAT Final Presentation Language Guru: Michael Berkowitz (meb2235) Project Manager: Frank Cabada (fc2452) System Architect: Marissa Ojeda (mgo2111) Tester: Daniel Rojas (dhr2119)

  2. Introduction

  3. What is ? LLVM Vectors Matrices CMAT compiles to LLVM IR. Vectors are single Matrices are 2-dimensional LLVM is flexible and works dimensional arrays that arrays. We allow many across multiple platforms. hold integers or floats. operations on matrices such as transpose, matrix multiplication, and scalar multiplication. C-Like Exceptions Standard library Our syntax is inspired by C We have errors messages We allow extra math, but some features are that output when a user vector, and matrix inspired by MATLAB. uses incorrect semantic operations. statements.

  4. Timeline

  5. Over 3 months of meetings 5,973 lines of code and tests 273 Git Commits

  6. How did they do it? ● Communication ● 3-4 Weekly Meetings ● TA Advisor Meetings ● Dividing up tasks individually or in pairs ● Committing working code and branching from master ● Ubuntu: same image, same versions

  7. Git History

  8. Let’s start programming in

  9. Comments Conditional Operators /* This is a single-line comment */ == != < <= > >= /*This is a long multiple-line comment */ Logical Operators Primitives ** || ! int, float, bool, void, String, matrix, vector Vector Control Flow | 1 | | 1 | 2 | 3 | 4 | If, else if, else, while, for, return | 1.0 | 2.0 | 3. 5 | v:len Matrix Arithmetic Operators [ 1.0, 2.0; 3.0, 4.0; 5.0, 6.0 ] [ 1, 2, 3; 4, 5, 6; 7, 8, 9 ] + - * / = ++ -- m:rows ; m:cols ; m:tr

  10. Examples of int main() { int main() { float f; float g; float h; int i; int j; f = 5.5; g = 6.0; i=1; h = g+f; print_float(h); while(i < 4) { h = g-f; print_float(h); for(j = 0; j < 3; ++j) { h = g*f; print_float(h); if(i == 1) { print_string("i=1"); } h = g/f; print_float(h); else if(i == 2) { print_string("i=2"); } return 0; else { print_string("i=3"); } } } i = i+1; } return 0; }

  11. #include <stdlib.cmat>; mi = i*mi; mi = mi+mi; int main() { mi = mi - mi; int i; float f; mt = mi*mj; matrix int [2,3] mi; vf = f*vf; matrix int [3,2] mj; vi = vi+vi; matrix int [2,2] mt; vf = vf-vf; Vector vi = mt*vi; vector int [2] vi; return 0; Matrix vector float [2] vf; } Manipulation i=2; f=5.5; vi = |1|2|; vf = |1.1|2.2| ; mi = [ 1,2,3; 4,5,6 ]; mj = [ 1,2; 3,4; 5,6 ];

  12. Compiling in

  13. AST Representation

  14. Standard Library Math functions mod, powi, powf, sin, cos Vector/Matrix functions dot product functions, rotation matrix generation functions Standard IO functions vector and matrix printing functions

  15. Testing

  16. Testing Infrastructure ● Combo of Travis CI and Github ● Set up Travis; runs on every git push ● Alerted by email only on status change ○ working branch → broken ○ broken branch → fixed ● Sorted tests by ○ Component ■ Fail ■ Pass ● NOT test-driven development ○ Too mercurial of a project

  17. Demo

Recommend


More recommend