gamma ray
play

Gamma Ray By Matthew Maycock, Weiyuan Li, Ben Caimano and Arthy - PowerPoint PPT Presentation

Gamma Ray By Matthew Maycock, Weiyuan Li, Ben Caimano and Arthy Sundaram Agenda Gamma Language Features Ray Compiler Architecture and design. Implementation details. Test-suite and Toolchain Challenges and Lessons learnt Demo The Gamma


  1. Gamma Ray By Matthew Maycock, Weiyuan Li, Ben Caimano and Arthy Sundaram

  2. Agenda Gamma Language Features Ray Compiler Architecture and design. Implementation details. Test-suite and Toolchain Challenges and Lessons learnt Demo

  3. The Gamma Language Elegant and Fully object oriented Primitive types are classes and variables are instances. IO wrappers encapsulated within objects. Secure Private (protected) members are private (protected) to instances. Subclasses cannot override superclass behaviors. Refinement Extend superclass behavior by refinement. Superclass provides hooks to refining types. Dynamic dispatch. Anonymous class Create classes on the fly Akin to Lambda definitions and Java’s anonymous instantiations. A language that has it all...!

  4. Refinement class Account: public: Integer bal Integer interest class NewAccount extends Account: Integer getBalance(): refinement: if (refinable(bonus)) { Integer getBalance.bonus(Integer norm): bal := bal + refine bonus(interest) to Integer; return norm * rewards } return bal Public: Integer rewards

  5. Anonymous classes class Person: protected: String name public: init(String name): super() this.name := name void introduce(): Printer p := system.out Mathew NewJersey p.printString(name) 33 p.printString(refine origin() to String) p.printInteger(refine age() to Integer) main(System sys, String[] args): (new Person("Matthew") { String introduce.origin() { return "New Jersey"; } Integer introduce.age() { return 33; } } ).introduce()

  6. system - IO wrappers class IOTest: public: init(): super() void interact(): Printer p := system.out Integer i := promptInteger("Please enter an integer") p.printString("Integer converted to Float = ") p.printFloat(i.toF() ) p.printString("\n") Integer promptInteger(String msg): prompt(msg) return system.in.scanInteger() main(System system, String[] args): IOTest test := new IOTest() Please enter an Integer: 12 test.interact() Integer converted to Float = 12.0000

  7. From gamma to C Gamma source Build Environment Access & scope checks Scan and Parse Type checking Tag types Abstract Syntax Tree Semantic Analysis Deanonymization SAST Refinement dispatch Methods -> mangled functions Intermediate Representation C-AST Code Generation Preprocess the MACROs Link the builtin functions. Target C

  8. Objects and dynamic dispatch in C

  9. Tool chains and Test suites Tools to inspect what is going on in the compiler: streams shows scanner results, canonize takes space delimited input and produces braced input, inspect/prettify takes input and shows the initial AST, classinfo shows metainfo about all classes (methods, variables, etc) including built ins. We have automated testing from earlier in our development to make sure scanner / parser input remained consistent. We have additional testing facilities via a script to automatically compile and run any gamma source -- showing both the source and the output.

  10. Challenges and Lessons Translating an objected oriented program to a structural language using functional programming language! Design choices - don’t do early optimization (arrays, null, this) Feature subset Prioritizing tasks Scheduling weekly team meetings Most of all: Don’t take too many other classes while taking PLT

  11. DEMO BANK SIMULATION AND N-QUEENS PUZZLE

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend