Skip to content
0:00 / 0:00

#ocaml#hack#staticanalysis

CUFP 2013: Julien Verlaguet, Facebook: Analyzing PHP statically

CUFP 2013

161 subscribers • 3 videos on Hallway

YouTube
  • Recommended by 4 people: 3 on Hacker News and 1 in engineering communities.
  • Presented by Julien Verlaguet, software engineer at Facebook
  • Linked in the descriptionSlides on cufp.org

Advanced. Deep dive for people who know the field.

5.2K views13 years ago4 recommendations

Programming languagesSystems programmingPHPCompilers and interpretersOCaml and F#

Julien Verlaguet explains how Facebook used OCaml to build static analysis and type inference tools for their massive PHP codebase.

Facebook has a very large PHP code base. At this scale, a dynamic language leads to a challenging situation in terms of tooling. The lack of static knowledge can make simple tasks very time consuming. Something as simple as renaming a method can cause unexpected problems because not all the code paths were captured through testing. In the past few years, Facebook spent time working on pragmatic approaches to improve the tooling around PHP. More recently, we started applying static-analysis and type-inference techniques to PHP. In this talk I will present how we applied these techniques to PHP and how we scaled them for Facebook. Since most of the tools were written in OCaml, they constitute a good example of an industrial scale application using a functional programming language. Julien is a member of the HipHop team. HipHop is a JIT compiler for PHP used at Facebook. Most of my work is focused on static analysis (front-ent work). Slides are here: cufp.org/2013/slides/verlaguet.pdf

Why it's here

4 people recommend this

What people say. Recommended as a great real-world case study of using OCaml and functional programming to build static analysis tools at scale.

u/gallaisin r/ocaml • Recommends

CUFP 2013: Julien Verlaguet, Facebook: Analyzing PHP statically

avsmon Hacker News • Recommends

On “Real World OCaml”

Another cool one from CUFP this year is how Facebook is using OCaml to add incremental type inference to their vast PHP code base. There's (slightly hard to see video) here, but I'm sure Facebook will publicize it more widely when they're ready. link to this video

Xdeson Hacker News • Recommends

On “List of possible changes, updates, additions for PHP 6”

Check out Hack for HHVM012. It's a lot saner than PHP, but it's not documented or well known outside Facebook. 0: Strangle Loop 2013: Keith Adams, Facebook: Taking PHP Seriously link 1: CUFP 2013: Julien Verlaguet, Facebook: Analyzing PHP statically link to this video 2: HHVM and Hack – Can We Expect Them to Replace PHP? link

amirmcon Hacker News • Recommends

On “What it's like to use Haskell”

It's good to hear stories about how FP is being used in industry and I'd like to read more. For those who have an interest in this, I recommend the Commercial Users of Functional Programming workshop ( link ). It's where I first heard about Facebook's use of OCaml to create Hack ( link to this video )

itafromaon Hacker News • Mentions

On “Taking PHP Seriously”

I tried looking for something by way of an official announcement or release (preview or otherwise), but as Keith Adams joked, it's impossible it Google it, and the link URL he referenced is not correct. Someone in the Q&A pointed that out, so he mentioned that there'd be a post about it on the HHVM blog, but there doesn't seem to be anything about it in the last few months (this talk took place in September). Someone asked Keith Adams on Twitter at the end of October, where Adams said there was nothing to announce yet: link The only other thing I could find about it was another talk by Julien Verlaguet (to whom Adams credits the invention of Hack) from October: link to this video

avsmon Hacker News • Mentions

On “Why OCaml, Why Now?”

> Last time I checked, the ability to write Javascript using both languages was of experimental and/or novelty use only (hence the "cupholders"). Facebook uses an OCaml js_of_ocaml-based frontend for a large chunk of their production code editing. Not a great video, but here's the CUFP 2013 talk on the topic: link to this video