NUMLANG Dan$Aprahamian Damien$Fensk e+Corbiere$Sahil$Yakmi$Siddhi$Mi6al$Introduction • Designed to make numerical computation easy. • Key Features of this language: o Allows mathematical functions to be entered as literals, manipulated, called, and composed. o Allows computation with matrices and other common mathematical operations. o Arithmetic without loss of precision. o An innovative way of implementing a for loop using match statements. o The language is intended to be suitable for compilation as well as interpreting. The reference implementation is, however, a compiler.Tutorial Introduction to Language • y = [[0, 0, 0], [0, 3, 5]]; • new_y = y[1]; • new_y2 = y[1][1]; • pop<<y>>;y[1][1] = 4; • sub callMe(num x, string list y) {y[1];} • sub call2() {34;} • str2 = "hello";println<<"str2">>; • strList = ["hello", "str"];rm<<strList>>; • str2 = callMe<<4, strList>>; • w = call2<<>>; • w = 43; • x = "hello"; • print<<x>>; • match(w) { cont: w - (w % 10) ? {x = 1;} loop: > 22 ? {x = - 1;} <= 12 % 4 ? pass; done: true ? pass; }Language Implementation • Series of Modules o Scanner/Parser and AST o Static Semantic Checker o Java Source Code Generation (Compiler) o Compilation to Java Byte Code • Tools Used o GitHub o OcamlDebug o Google Docs (Collaborative Code) o GoogleOur files File Lines Role ________________________________________________ Scanner.mll 124 lines Token rules Parser.mly 220 lines CFG Ast.ml 77 lines Types Sast.ml 46 lines Checked types ssc.ml 666 lines Semantic Validity numlangc.ml 276 lines Compiler ________________________________________________ Total 1409 linesSummary/Lessons$Learned • Matrix Like Language capable of o Manipulating functions o Retaining precision of numbers o Making mathematical computation easier with simple syntax • Lessons Learnt o Value of ocamldebug o Ocaml’s value o Resolving reduce/reduce and shift/reduce errors for ambiguous grammar o Importance of resolving scoping issues o How pieces of Compiler fit together • Time Value o Start
View Full Document