ibrahima niang ranjith kumar s. sania arif

17
“Plots on the go” Ibrahima Niang Ranjith Kumar S. Sania Arif

Upload: others

Post on 06-Dec-2021

13 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Ibrahima Niang Ranjith Kumar S. Sania Arif

“Plots on the go”

Ibrahima Niang Ranjith Kumar S. Sania Arif

Page 2: Ibrahima Niang Ranjith Kumar S. Sania Arif

In a nutshell

01

02

03

04 Useful Error MessagesEvery single error that the compiler encounters will print a rich error message for the user

ListsWe have lists for primitive as well as non-primitive data types such as point, string

Built-in function LibrariesBuilt-In functions written and compiled in our own language, have the ability to be included as libraries

C++Our backend compiles down to C++, allowing us to re-use code without re-compiling

Page 3: Ibrahima Niang Ranjith Kumar S. Sania Arif

Project Management175 commits, 3 branches, 25 issues, 2500+ lines of code

Page 4: Ibrahima Niang Ranjith Kumar S. Sania Arif

SyntaxLet’s talk PlOtter

Comments

Primitive data typesLists

Page 5: Ibrahima Niang Ranjith Kumar S. Sania Arif

LoopsConditionals

Page 6: Ibrahima Niang Ranjith Kumar S. Sania Arif

Built-in functions: Primitive

Our building block

LinePrint

PrintXY

Page 7: Ibrahima Niang Ranjith Kumar S. Sania Arif

LibrariesBar Graph

Rectangle

To use:

Page 8: Ibrahima Niang Ranjith Kumar S. Sania Arif

01 02 04

05 06

Scanner

07 08 09

Code GenSed ut perspiciatis

unde omnis iste natus doloremque

Sem Check

Parser

PipelinePlOtter in the making

Tokens

ASTSAST

Input.plt

Input.cpp Input.svg

Page 9: Ibrahima Niang Ranjith Kumar S. Sania Arif

ImplementationAST

Program

MainIncludes Functions

Statements ExpressionsStatements Expressions

Page 10: Ibrahima Niang Ranjith Kumar S. Sania Arif

Semantic Checking

Maintaining a Symbol table

Type Checking

Scoping and visibility

The meat of the compiler

Undeclared, redeclared functions and identifiers

Validation according to language specs

Static, block

Page 11: Ibrahima Niang Ranjith Kumar S. Sania Arif

Error Reporting

Parser: On Error, report error, continue parsing.

Program:

Output:

Program:

Output:

Scanner: On Error, report error, stop scanning.

Page 12: Ibrahima Niang Ranjith Kumar S. Sania Arif

ImplementationCompiler Flags

Pretty Printing from ASTProgram

Page 13: Ibrahima Niang Ranjith Kumar S. Sania Arif

Test Driven DevelopmentNew test for every feature

Goal part 1: Make test passGoal part 2: Fail no other tests

Pass Tests Fail Tests

Proceeded by the word “Pass”

Tests that we know should pass

Proceeded by the word “Fail”

Tests that we know should fail

Page 14: Ibrahima Niang Ranjith Kumar S. Sania Arif

Test SuiteSample Output

.

.

.

.

Script

Page 15: Ibrahima Niang Ranjith Kumar S. Sania Arif

Demo

Page 16: Ibrahima Niang Ranjith Kumar S. Sania Arif

The future of PlOtter

Customizability

Support for math functions

More libraries

Import data from external sources

REPL window for on-the-go compiling

Page 17: Ibrahima Niang Ranjith Kumar S. Sania Arif

Takeaways

Pair Programming saves lives.

OCaml is awesome, give it time.

Use Prof. Edwards’ slides.

Choose teammates wisely, you’ll be stuck with them for the term.Courtesy: Prof. Edwards