the fly language
play

The Fly Language Carolyn Sun Hsiang-Ho Lin Shenlong Gu Xin - PowerPoint PPT Presentation

The Fly Language Carolyn Sun Hsiang-Ho Lin Shenlong Gu Xin Xu Introduction - Motivation - Compile down to C++ code - Type inference - Concurrency primitives: thread, channel, signal - Thread-safe container types - Capability


  1. The Fly Language Carolyn Sun Hsiang-Ho Lin Shenlong Gu Xin Xu

  2. Introduction - Motivation - Compile down to C++ code - Type inference - Concurrency primitives: thread, channel, signal - Thread-safe container types - Capability for code to be dispatched and executed across systems - Functional programming features such as lambda and clojure - Network Library

  3. Project Status - 3217 lines of OCaml code - 497 lines of C++ code - 276 git commits - 48 test cases, 1051 lines of test code Basic Concurrency Inter-thread Scanner Lambda, Closure Spring Break Class Array, Map Parser Dispatch Type Inference

  4. Architecture Scanner Ast Sast CodeGen Parser

  5. Type Inference Variables are static typed. Functions are typed according to all kinds of calls that invoked on the functions. Tech: we infer a function result when a function is called with typed parameters.

  6. Closure Each function can be called with some parameters to generate a closure (a function binded with some parameters) Tech: Use a class to hold the variables and functions.

  7. Lambda We support some basic lambda usage. Variables are passed by referrence for the class, map, array. Variables are passed by value for int, float, string. Tech: we keep track of all variables used in the lambda and generate a new function for C++ with these local variables wrapped like clojure.

  8. Dispatch/Exec We can send a function with some parameters to another machine to execute and wait for the result to be returned.

  9. Concurrency: threading

  10. Concurrency: Inter-thread communication Signal Channel

  11. Concurrency: Thread-Safe Containers

  12. Automated Integration Tests - 48 Test cases, 14 for should-fail, 34 for should-pass - Use python script to automate the process - Verifies all the test cases are passed before committing

  13. Team Responsibilities Carolyn Sun: Testing automation, Debug module, Documentation Hsiang-Ho Lin: Compiler Front end, Code generation, C++ Library, Test case creation, Documentation Shenlong Gu: Compiler Front end, Semantics, Code generation, C++ Library, Documentation Xin Xu: Test case creation, Debug module, Documentation

  14. Lesson Learned - Time Management - Start Early - Meet Regularly - Communication - Listen and Share Ideas - Collaboration - Github - Clean Code - Don’t commit broken code - Testing - Automate

  15. Demo

  16. Word Count Server and Client Time str = “This is one of my favorite classes at Columbia”; Client arr = str_split(str); for (i = 0; i < arr.size(); i = i + 1) { con.send("put " + arr.get_at(i)); “put This” } “put is” “put one” con.send(“getalls”); /* get all word counts, sorted by frequency */ Server

  17. Word Count Server and Client Time Client Client Client “put This” “put is” 1 4 s = fly process_msg “put one” Server fly handle_request 2 register s send_back 5 3 6 fly worker worker worker channel

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