a matrix manipulation language Daisy Chaussee (dac2183) Anthony Kim - - PowerPoint PPT Presentation

a matrix manipulation language
SMART_READER_LITE
LIVE PREVIEW

a matrix manipulation language Daisy Chaussee (dac2183) Anthony Kim - - PowerPoint PPT Presentation

a matrix manipulation language Daisy Chaussee (dac2183) Anthony Kim (ak3703) Rafael Takasu (rgt2108) Ignacio Torras (it2216) INTRODUCTION DARN is a matrix manipulation language with native support for matrix data types. Strongly typed


slide-1
SLIDE 1

Daisy Chaussee (dac2183) Anthony Kim (ak3703) Rafael Takasu (rgt2108) Ignacio Torras (it2216)

a matrix manipulation language

slide-2
SLIDE 2

DARN is a matrix manipulation language with native support for matrix data types.

  • Strongly typed
  • Imperative
  • Supports if/else/for/while flow controls
  • User control and freedom (inspiration from C)
  • Robust matrix-oriented standard library

INTRODUCTION

slide-3
SLIDE 3

TIMELINE

9/28︎ 10/26︎

Project Proposal Scanner & Parser Hello, World LRM Semantic Analysis & Codegen Final Report

11/19︎ 12/20︎ 11/21︎

slide-4
SLIDE 4

LANGUAGE OVERVIEW

Primi%ve ¡Types: ¡ int, ¡float, ¡bool, ¡char, ¡string ¡ Data ¡Types: ¡ 1-­‑D ¡and ¡2-­‑D ¡matrices ¡ Declara%on/Ini%aliza%on: ¡

int a; a = 2; ¡

1D ¡matrix: ¡

int[5] m; m[1] = 0; ¡

2D ¡matrix: ¡

int[5][5] w; w[0][0] = 1; Function Declaration:

int addMatrices(int[] x, int[] y, int len) { /* function */ }

File ¡Extension: ¡ .darn ¡ Operators: ¡ Standard ¡C ¡arithme:c ¡and ¡logical ¡

  • perators ¡

¡ [ ¡] ¡1-­‑D ¡matrix ¡access ¡ [ ¡] ¡[ ¡] ¡2-­‑D ¡matrix ¡access ¡ ¡ % ¡access ¡pointer ¡ %% ¡ # ¡dereference ¡pointer ¡ ++ ¡pointer ¡increment ¡

¡

Control ¡Flow: ¡ if ¡(true) ¡{ ¡ ¡print(x); ¡ } ¡else ¡{ ¡ ¡print(y); ¡ } ¡ ¡ while(x ¡> ¡y) ¡{ ¡ ¡prints(“hello\n”); ¡ } ¡ int ¡i; ¡ for ¡(i= ¡0; ¡I ¡< ¡3; ¡i=i+1) ¡{ ¡ ¡print(x); ¡ } ¡

¡

slide-5
SLIDE 5

BRIEF TUTORIAL

slide-6
SLIDE 6

1 int main() { 2 prints(“Hello, World!\n”); 3 }

HELLO, WORLD

slide-7
SLIDE 7

ARCHITECTURE

Input ︎ File︎ LLVM︎ scanner.mll︎ parser.mly︎ semant.ml︎ codegen.︎ ml︎ AST AST Tokens preprocess.ml︎

slide-8
SLIDE 8
  • test directory contains all tests & test scripts for

compiler, parser, scanner, and compiler_fail tests

  • testing automation program invoked separately for

each directory, such as ./compiler_test.sh

  • success & fail tests included
  • continuous integration with Travis CI

TESTING

slide-9
SLIDE 9

Daisy: make SMART goals & follow through Anthony: power of pair programming, overcome setbacks Rafa: time and communication are valuable, learned to love matrices Nacho: plan ahead, master OCaml early on, work on everything for better understanding

LESSONS LEARNED

slide-10
SLIDE 10

DEMO