21
Bringing Haskell to the World www.fpcomplete.com

Bringing Haskell to the Worldcufp.org/2013/slides/lebovitz.pdf · – Build System – Cloud Base Execution and Deployment • Cloud allows faster product evoluton . FP School of

  • Upload
    others

  • View
    6

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Bringing Haskell to the Worldcufp.org/2013/slides/lebovitz.pdf · – Build System – Cloud Base Execution and Deployment • Cloud allows faster product evoluton . FP School of

Bringing Haskell to the World www.fpcomplete.com

Page 2: Bringing Haskell to the Worldcufp.org/2013/slides/lebovitz.pdf · – Build System – Cloud Base Execution and Deployment • Cloud allows faster product evoluton . FP School of

Experience Report Building Haskell Development and Deployment tools

Gregg Lebovitz Director, Product Management

FP Complete

Page 3: Bringing Haskell to the Worldcufp.org/2013/slides/lebovitz.pdf · – Build System – Cloud Base Execution and Deployment • Cloud allows faster product evoluton . FP School of

Company Goals •  Increase Haskell Adoption •  Make Haskell More Accessible •  Offer Commercial Grade Tools and Support •  Simplify Haskell Deployment •  Support the Haskell Community •  Leverage what the Community Offers

Page 4: Bringing Haskell to the Worldcufp.org/2013/slides/lebovitz.pdf · – Build System – Cloud Base Execution and Deployment • Cloud allows faster product evoluton . FP School of

FP Haskell Center •  Web Front End

–  No Struggle Setup –  Access to Help –  Easy to Integrate with Haskell

•  Haskell Back End –  Project Management –  Provide Developer Feedback –  Build System –  Cloud Base Execution and Deployment

•  Cloud allows faster product evoluton

Page 5: Bringing Haskell to the Worldcufp.org/2013/slides/lebovitz.pdf · – Build System – Cloud Base Execution and Deployment • Cloud allows faster product evoluton . FP School of

FP School of Haskell™

FP Haskell Center™ Non Cloud

FP Haskell Center™ Cloud

Product Roadmap

March 2013

Sept. 2013

Oct. 2013

Dec. 2013

Q1 2014

Professional & Academic

Personal IDE Deployment

Page 6: Bringing Haskell to the Worldcufp.org/2013/slides/lebovitz.pdf · – Build System – Cloud Base Execution and Deployment • Cloud allows faster product evoluton . FP School of

UI •  UI Details

– Backend Implemented in Yesod – Lots of Library Support (conduits, etc) – UI Uses Javascript (using Fay) – Heavy lifting done in Backend

•  Very few Issues surfaced

Page 7: Bringing Haskell to the Worldcufp.org/2013/slides/lebovitz.pdf · – Build System – Cloud Base Execution and Deployment • Cloud allows faster product evoluton . FP School of

Product Goals •  Web Access (initially) •  Live Feedback To Developer •  Point and Click Build Process •  Simple Project Management •  Access to Source Repositories •  Integrated Help and Documentation

Page 8: Bringing Haskell to the Worldcufp.org/2013/slides/lebovitz.pdf · – Build System – Cloud Base Execution and Deployment • Cloud allows faster product evoluton . FP School of

Challenges •  Javascript Coding Issues •  Stable set of libraries •  Compiler Integration (feedback and errors) •  Integrating with git •  Running in the cloud •  Deploying Applications •  Billing system integration

Page 9: Bringing Haskell to the Worldcufp.org/2013/slides/lebovitz.pdf · – Build System – Cloud Base Execution and Deployment • Cloud allows faster product evoluton . FP School of

Stability Issues •  Fay - Javascript

– Eliminated most Javascript issues – Allowed us to focus on features not bugs

•  Create Stackage – Managed by Authors – Packages must be version compatible –  Libraries are vetted, and tested – Commercial Support for Customers

Page 10: Bringing Haskell to the Worldcufp.org/2013/slides/lebovitz.pdf · – Build System – Cloud Base Execution and Deployment • Cloud allows faster product evoluton . FP School of

Code Analysis •  Integrating GHC Via Library

– Access to the Abstract SyntaxTree – Report Errors – Map Source Location to AST –  Locate where Identifiers are Defined – Get Details about Types and Identifiers – Support Auto-complete

•  Do the same for HLint

Page 11: Bringing Haskell to the Worldcufp.org/2013/slides/lebovitz.pdf · – Build System – Cloud Base Execution and Deployment • Cloud allows faster product evoluton . FP School of

Beyond Errors (Future) •  Once You have the Compiler Front End

– Do Syntax Analysis – Recommend Code Improvements – Track Code Execution –  Implement Debugging – Add Profiling Information –  Improve Error Reporting – Understand performance issues

Page 12: Bringing Haskell to the Worldcufp.org/2013/slides/lebovitz.pdf · – Build System – Cloud Base Execution and Deployment • Cloud allows faster product evoluton . FP School of

Responsiveness and Stability •  Challenges

– Do code analysis – Provide Lots of Live User Feedback – But Make the UI “Snappy”

•  Solution – Separate the Web Front End and – Code Analysis Engines

Page 13: Bringing Haskell to the Worldcufp.org/2013/slides/lebovitz.pdf · – Build System – Cloud Base Execution and Deployment • Cloud allows faster product evoluton . FP School of

Separate Processes Front End

Server

User Session

User Session

User Session

Code Analysis GHC API Hlint API

Code Analysis GHC API Hlint API

Code Analysis GHC API Hlint API

Code Engine Compiler Frontend

Page 14: Bringing Haskell to the Worldcufp.org/2013/slides/lebovitz.pdf · – Build System – Cloud Base Execution and Deployment • Cloud allows faster product evoluton . FP School of

Running in the Cloud •  Use LXC to create Isolation Containers

– Each container is a mini machine –  Includes a full runtime environment – Runs required system services – Provides ephemeral storage – Containers can run on shared systems – Share underlying resources to reduce footprint

•  OS, Libraries, and System Services

Page 15: Bringing Haskell to the Worldcufp.org/2013/slides/lebovitz.pdf · – Build System – Cloud Base Execution and Deployment • Cloud allows faster product evoluton . FP School of

Containers Distributed as Needed •  Containers on dedicated and shared systems

Page 16: Bringing Haskell to the Worldcufp.org/2013/slides/lebovitz.pdf · – Build System – Cloud Base Execution and Deployment • Cloud allows faster product evoluton . FP School of

IDE Uses Isolation Containers •  Front End handles requests from IDE •  Initiates a User sandbox container •  Loads Environment from Persistent Storage

–  Includes Active files –  Project Settings –  Previous State Settings

•  User work is Saved to Persistent Storage (S3)

Page 17: Bringing Haskell to the Worldcufp.org/2013/slides/lebovitz.pdf · – Build System – Cloud Base Execution and Deployment • Cloud allows faster product evoluton . FP School of

Managing Projects •  Visual Representation of Projects •  Projects Stored in Git Repositories •  Contains Project Settings/Definition File •  Repo Access Through Haskell gitlib-2

–  Haskell robustness –  Multiple backends

•  Git C library backend •  GitHub C library backend •  IDE Local repository stored in S3 •  Others?

Page 18: Bringing Haskell to the Worldcufp.org/2013/slides/lebovitz.pdf · – Build System – Cloud Base Execution and Deployment • Cloud allows faster product evoluton . FP School of

Building Projects •  IDE Code Generated by Backend Process

–  Uses Active GHC Front End –  Generates Bytecode –  Runs Bytecode in GHC Frontend Container –  Exceptions leave IDE intact

•  Deployment Build System Uses Cabal APIs –  Import existing cabal files –  Preprocess CPP Macros –  Build executables for deployment –  Generate licenses for deployment executables

Page 19: Bringing Haskell to the Worldcufp.org/2013/slides/lebovitz.pdf · – Build System – Cloud Base Execution and Deployment • Cloud allows faster product evoluton . FP School of

Deploying Projects •  Haskell Has No Standard Way To Deploy Apps •  We Constructed A Deployment System

–  Compile Source to Executables •  Haskell Libraries Linked Statically

–  Create Isolation Container –  Install FP Application Server –  Launch Instance (dedicated or shared) –  Load Executable –  Start Configuration Manager –  Use Keter and Chef to Keep Things Running

Page 20: Bringing Haskell to the Worldcufp.org/2013/slides/lebovitz.pdf · – Build System – Cloud Base Execution and Deployment • Cloud allows faster product evoluton . FP School of

Billing •  Billing Processor Provides SOAP APIs

–  Haskell SOAP Library Not Complete –  Processor Supports gsoap

•  Gsoap generates C++ from WSDL Files –  FFI Requires C Bindings –  Must generate Isomorphic mappings to C++ data –  Fortunately all Gsoap data delivered as strings

•  Limitations in GHC, Cabal, Linux made hard

Page 21: Bringing Haskell to the Worldcufp.org/2013/slides/lebovitz.pdf · – Build System – Cloud Base Execution and Deployment • Cloud allows faster product evoluton . FP School of

Summary •  Haskell made development easier

–  Fewer Errors –  Robust Code

•  Our tools reduced our development effort –  Stackage for Compatible Libraries –  Integrated Code Analysis Tools –  Containers used everywhere for running code –  Code, Build and Deploy

•  Haskell requires more commercial libraries –  Billing Engine That Only Talks SOAP