Dice Java, but worse David Watkins Khaled Atef Emily Chen Phil - - PowerPoint PPT Presentation

dice
SMART_READER_LITE
LIVE PREVIEW

Dice Java, but worse David Watkins Khaled Atef Emily Chen Phil - - PowerPoint PPT Presentation

Dice Java, but worse David Watkins Khaled Atef Emily Chen Phil Schiffrin Project Manager Testing Wizard Language Guru System Hacker 1 Introduction Dice in a nutshell LETS REVIEW SOME CONCEPTS LLVM Object-Oriented


slide-1
SLIDE 1

Dice

“Java, but worse”

David Watkins Khaled Atef Emily Chen Phil Schiffrin

Project Manager Testing Wizard Language Guru System Hacker

slide-2
SLIDE 2

Introduction

Dice in a nutshell

1

slide-3
SLIDE 3

LET’S REVIEW SOME CONCEPTS LLVM Our backend compiled to LL IR code. This allows for cross-platform code without recompiling the

  • riginal source

Object-Oriented The ability to define

  • bjects, define their

methods, and define private/public scope Multi-Level Inheritance A Person object can have as many children as it wants, but only one parent Arrays Single dimensional arrays as well as arrays defined with expressions placed in the elements Useful Standard Library File, String, and Integer classes defined as closely to the Java Library as possible Useful Error Messages Every single error that the compiler encounters will print a rich error message for the user

slide-4
SLIDE 4

Project Management Timeline

Dice is a big language

2

slide-5
SLIDE 5

5921 Lines of Code

Our compiler was a huge undertaking

47 Custom Emojis

Total success!

109 Issues Closed

526 reduce/reduce conflicts resolved

slide-6
SLIDE 6

3rd Party Software Solutions

Slack The bread and butter for group communications. Github The best solution for

  • ur version control
  • needs. Branches

were key. Ubuntu Utilizing an Ubuntu VM stack gave us much needed consistency.

slide-7
SLIDE 7

Git History

slide-8
SLIDE 8

So how do you speak it?

Dice is a BIG language

3

slide-9
SLIDE 9

Comments Operators Arrays

Syntax

Basics

slide-10
SLIDE 10

Loops if-else/else-if

Syntax

Statements

slide-11
SLIDE 11

Objects Inheritance File IO

Syntax

Objects

slide-12
SLIDE 12

How it’s made

Not featured on Discovery Channel

4

slide-13
SLIDE 13

Implementation

Design

Input.dice Tokens

  • Scanner

AST

  • Parser

SAST

  • Analyzer
  • Scan and Parse Includes

Out.ll

  • Codegen
slide-14
SLIDE 14

Implementation

AST

program includes classes fields constructors methods statements expressions

slide-15
SLIDE 15

Implementation

SAST

program functions statements expressions structures Fields Func_decls* Main Reserved

slide-16
SLIDE 16

Implementation

Structs with Inheritance

Techer Struct int key bool isNerd bool isTecher

Stephen Struct int key bool isNerd bool isTecher bool isTeacher Nerd Struct int key bool isNerd

slide-17
SLIDE 17

Implementation

Virtual Function Table Class Indexes Nerd Techer Stephen Function Indexes isNerd:Nerd isNerd:Nerd isNerd:Stephen isTeacher:Stephen

  • Lookup the void* using function index and class index
  • Casts function pointer to correct function pointer
  • Makes function calls with original parameters
slide-18
SLIDE 18

Implementation

Standard Library

String Class Includes methods for comparison of strings and

  • btaining the length

Integer Class Get the string representation of integers File Class Open, close, read, and write to a file

slide-19
SLIDE 19

Pretty Printing SAST/AST in JSON Tokens

Implementation

Compiler Flags

slide-20
SLIDE 20

TDD

Test driven development saves lives

5

slide-21
SLIDE 21

TDD

From day 1 we made our regression suite. We started with MicroC, then added a test for each bug/feature we could think of

Testing Invalid Code

Making sure our compiler is not only correct, but also finds user errors Testing

Regression Suite

slide-22
SLIDE 22

Testing

Regression Suite

slide-23
SLIDE 23

Time to demo!

Hope you like zoos with small dogs