The official blog of HHVM, Facebook's virtual machine for running Hack, which began as a fast PHP runtime.
HN commenters point to it as a way to use Hack or run PHP, and note that PHP support ended after the 3.30 release series.
This article is interesting, not just because it's applied on a practical problem at Facebook, but also because it's quite fun to read the theory itself.
1. A Bayesian approach for A/B testing is advocated where noise is handled properly (not through heuristics).
2. Computationally efficiency is addressed through quasi-Monte Carlo.
3. It's practical use is shown through a production ranking system and optimization of a web server.
+ The Expected Improvement acquisition function (Mockus, 1978, Jones, 1998) is used to perform Bayesian optimization of the hyperparameters of a particular model.
+ Intuitively, it is an iterative procedure that picks a new point to fit a function in a sequential manner using the previously picked points.
+ Aside, to play with Gaussian processes, see e.g. https://github.com/fmfn/BayesianOptimization. To summarize, rather than searching for random variables it's searching for random functions.
+ Aside, Bayesian optimization is interesting because it reduces the number of evaluations required and replaces it by assumptions in the form of a (Gaussian Process) prior. See article http://papers.nips.cc/paper/4522-practical-bayesian-optimization-of-machine-learning-algorithms.pdf by Snoek et al where by the way duration of execution time is also taken into consideration.
+ Aside, Bayesian optimization (in this form) does not use derivatives.
+ Aside, rather than ordinary MCMC, the "fit" of the posterior distribution is used to inform the…
We tried to implement an LLVM based JIT compiler for PHP. There's basically two problems: First, LLVM is excruciatingly slow. If I remember correctly, it took more than a minute to compile all the WP functions for a front-page access (this is something like 100k VM instructions translated to LLVM bitcode). Second, LLVM is not great at optimizing the kind of IR that a JIT compiler for a dynamic language emits. It is much more important to perform language-specific optimizations prior to lowering. HHVM basically came to the same conclusion [1]. They lowered vasm to LLVM IR and let LLVM perform additional optimizations and native codegen. The difference was basically noise.
On the other hand, there are projects that do successfully use LLVM for JIT. We now experiment with dynasm, which doesn't optimize, but is fast and much more pleasant to use. libjit looks like another popular option.
[1]: http://hhvm.com/blog/10205/llvm-code-generation-in-hhvm
It's an alternative PHP runtime. It no longer compiles PHP to C++ (it's predecessor hphpc), instead it uses a JIT compiler which gives it better performance over standard PHP, without requiring a compilation step. It's mostly compatible with the standard PHP syntax/stdlib.
It offers an alternative syntax that allows you to give return types of functions, which can give you further speed improvements. There's also a few additional features (for example, it supports similar hinting to the recent ArrayOf RFC).
It's worth checking out, but probably not worth using in production yet - they're working on getting the top 20 frameworks to pass their unit tests in HHVM[0], so there's a good chance your existing apps will run.
[0]: http://www.hhvm.com/blog/2813/we-are-the-98-5-and-the-16
If you ever need to work with PHP, use PHP/Hack developed by Facebook: https://hacklang.org/
It's a compiled language built partially in Rust, being rewritten entirely in Rust, JIT compiled using HHVM: https://hhvm.com/
I don't believe it's compatible with existing PHP codebases, but you could probably convert one over, catching safety issues while you did it.
Hack a modern and highly productive language that's in many ways as nearly sophisticated as Rust. (How many other languages have both opaque and transparent type aliases, for example? https://docs.hhvm.com/hack/types/type-aliases ). It has a mature async/await system, for another example. One feature it's missing is the macro system that Rust has, though.
I'm not sure if this was added to the article after your reply, but the author mentions Hack specifically, along with some caveats about it's adoption, namely that it is currently unkown how widespread Hack will be and how you're basically at Facebook's mercy in regards to the future of the language.
As for adoption, the only stat that I could find was adoption for HHVM[1] (a virtual machine for executing Hack and PHP[2]), but since they list Wikipedia among the HHVM adopters, I'm pretty sure this does not equate to adoption of Hack itself.
[1]:https://github.com/facebook/hhvm/wiki/Users
[2]:http://hhvm.com/
Actually, for a large codebase written in a dynamic language, introducing gradual typing to slowly convert all the dynamic code, into more stable statically type code, can be a quite nice approach (compared to rewriting the whole codebase).
Take for example Facebook and their HHVM[0]. They can run the existing code, and then slowly update the code with types, and write new code with types. The alternative would be years and years of rewriting the whole codebase.
Personally though, I'm more a fan of the type-checking done in languages like Haskell, F# and ML.
[0] http://hhvm.com