Bringing Haskell to the World www.fpcomplete.com Experience Report - - PowerPoint PPT Presentation

bringing haskell to the world
SMART_READER_LITE
LIVE PREVIEW

Bringing Haskell to the World www.fpcomplete.com Experience Report - - PowerPoint PPT Presentation

Bringing Haskell to the World www.fpcomplete.com Experience Report Building Haskell Development and Deployment tools Gregg Lebovitz Director, Product Management FP Complete Company Goals Increase Haskell Adoption Make Haskell More


slide-1
SLIDE 1

Bringing Haskell to the World

www.fpcomplete.com

slide-2
SLIDE 2

Experience Report

Building Haskell Development and Deployment tools

Gregg Lebovitz

Director, Product Management

FP Complete

slide-3
SLIDE 3

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
slide-4
SLIDE 4

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
slide-5
SLIDE 5

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

slide-6
SLIDE 6

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
slide-7
SLIDE 7

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
slide-8
SLIDE 8

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
slide-9
SLIDE 9

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

slide-10
SLIDE 10

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
slide-11
SLIDE 11

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

slide-12
SLIDE 12

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

slide-13
SLIDE 13

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

slide-14
SLIDE 14

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
slide-15
SLIDE 15

Containers Distributed as Needed

  • Containers on dedicated and shared systems
slide-16
SLIDE 16

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)
slide-17
SLIDE 17

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?
slide-18
SLIDE 18

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

slide-19
SLIDE 19

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

slide-20
SLIDE 20

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
slide-21
SLIDE 21

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