18
PL/T Programming Language for Time Supervised by Professor Alfred V. Aho Teaching Assistant: Mr. Yan Zou Laurent Charignon (lc2817): Project Manager Sameer Choudhary (sc3363): System Integrator Imré Frotier de la Messelière (imf2108): Language Guru Tao Song (ts2695): System Architect Abhijeet Tirthgirikar (apt2120): Tester and Validator

PL/T Programming Language for Time

  • Upload
    mariah

  • View
    24

  • Download
    0

Embed Size (px)

DESCRIPTION

PL/T Programming Language for Time. Supervised by Professor Alfred V. Aho Teaching Assistant: Mr. Yan Zou Laurent Charignon (lc2817): Project Manager Sameer Choudhary (sc3363): System Integrator Imré Frotier de la Messelière (imf2108): Language Guru Tao Song (ts2695): System Architect - PowerPoint PPT Presentation

Citation preview

Page 1: PL/T Programming Language for Time

PL/TProgramming Language for Time

Supervised by Professor Alfred V. AhoTeaching Assistant: Mr. Yan Zou

Laurent Charignon (lc2817): Project ManagerSameer Choudhary (sc3363): System Integrator

Imré Frotier de la Messelière (imf2108): Language GuruTao Song (ts2695): System Architect

Abhijeet Tirthgirikar (apt2120): Tester and Validator

Page 2: PL/T Programming Language for Time

Introduction to PL/T

Example ScenarioYou want to make an alarm clock. Set it up to ring at 8:00pm today. You can input “y”to snooze it for another 10 mins. You have to terminate the program to stop the alarmotherwise it will keep on running for an hour. The alarm clock will ring for 1s and wait forinput to snooze for 1s, and it will keep doing that for 1 hour.

Page 3: PL/T Programming Language for Time

Introduction to PL/T (Continued…)

PL/T has following properties:-• Simple and Easy to Learn• Powerful• Robust• Portable• Intuitive• Precise

Page 4: PL/T Programming Language for Time

Sample Programs

void main ( ) { #|5| every 1s{ cout << "hello"; }}

Page 5: PL/T Programming Language for Time

Sample Programs (Continued…)

void countDown(time t) { time n = now(); time p = t;#<n, n+t> every 1s{ cout << p; p = p-1s; }cout<< "Time over!";}

Page 6: PL/T Programming Language for Time

Motivation

• In general purpose programing languages it is difficult to write time based programs

• Requires knowledge of threads• Idea of having time as a primitive data type• To make writing time based general purpose

operations like looping etc. easy

Page 7: PL/T Programming Language for Time

Project Management

What we wanted• Avoid stress by having something working

quickly• Don't have to cross our fingers the last day• Learn new practices

Page 8: PL/T Programming Language for Time

Project Management (Continued…)

What we have actually did• Made some compromises on the scope of the

project when it was needed• Considered the individual comfort as a top priority• Tried several paths when we are blocked• Refactored a lot• Tested the most critical features to feel confident

and avoid this

Page 9: PL/T Programming Language for Time

Important Language syntactic constructs

Time• time t1 = 1h2m5s1i;• time t2 = 1h1m;• t1+t2 => 2h3m5s1i• 2*t2 => 2h2m• t2/2 => 30m30s• t1 < t2 => true• t1 >t2 => false

Page 10: PL/T Programming Language for Time

Important Language syntactic constructs

Time

• time t = now(); cin >> t; cout << t;

• number n = 5; t = NumberToTime(n); n=TimeToNumber(t);

Page 11: PL/T Programming Language for Time

Important Language syntactic constructs

# Loop

• #|5|{ ... }

• #|3| every 1h{ ... }

• time t = now();

• #<t+1h,t+2h>{ ... }

• #<t,t+3h> every 2s{ ... }

Page 12: PL/T Programming Language for Time

Important Language syntactic constructs

# Loop

• #|5|{ ... }

• #|3| every 1h{ ... }

• time t = now();

• #<t+1h,t+2h>{ ... }

• #<t,t+3h> every 2s{ ... }

Page 13: PL/T Programming Language for Time

Compiler Architecture

Fig 1: Architecture Diagram in a nutshell

Page 14: PL/T Programming Language for Time

Compiler Architecture(Continued…)

Fig 2: Detailed Architecture Diagram

Page 15: PL/T Programming Language for Time

Execution (Continued)

1. input.pltvoid main(){time p = 10s;cout << p;}

2. Main.java import java.util.*;import java.lang.*;

class Main{public static void main(String argv[])double d =10000;System.out.println(BIF.intToTime((int)(p)));}

3. Comiler Output

10s

Page 16: PL/T Programming Language for Time

Testing

Unit Testing• JUnit Test Framework• To extensively test AST and

the code it generates• Factory methods to define

complex getCode functions

Functional Testing• Complete test suite of PLT

programs to test the compiler• Same set of PL/T programs

are used to test symbol table• Cucumber JVM - Behavior

driven development• Executes plain-text functional

descriptions as automated tests

Page 17: PL/T Programming Language for Time

Tools Used

• JFlex• CUP• Eclipse• Egit• Cucumber

• http://git-scm.com/• http://docs.oracle.com/javase/tutorial/• http://en.wikipedia.org/wiki/LaTeX• http://www.python.org/• http://cukes.info/images/cuke_logo.png• http://junit.sourceforge.net/ A voir sur

cette page pour reproduir ele logo en texte

• http://www.eclipse.org/• http://www.eclipse.org/egit/ a

decouper• http://www.eclipse.org/mylyn/• http://jflex.de/• http://www.cs.princeton.edu/~appel/

modern/java/CUP/

Page 18: PL/T Programming Language for Time

Conclusions• Communication! The minutes and the meetings matter more than

the code, be sure that everybody knows the status of the project• Have a good morale condition: no rush and focus on building a

prototype early• Keep the iteration shorts and switch roles to maintain a good morale

condition.• Welcome ideas from everyone and discuss it altogether• DVCS is a very important tool, it saves you a great amount of time• Use a set of tools you are confident with, it will matter a lot• Team building matters• Don't hesitate to change your idea• Trust your tests to refactor often and have a maintainable code