SlideShare a Scribd company logo
What the HACK is HHVM?
Leong Hean Hong
2014-06-06 @ HackerspaceJB
About
● Web/mobile developer
● Android instructor
● Experienced in developing web services
● Interest in Linux, web, mobile
Agenda
● What is HHVM
● Where does HHVM come from?
● Why use HHVM?
● What is Hack?
● Demo (benchmark test)
What is HHVM?
PHP
Code
Hack
Code
Zend Engine
(Interpreter)
HHVM
HipHop Virtual Machine
● PHP execution engine created by
Facebook
● Convert PHP to bytecode
● Bytecode translated to machine code
at runtime by JIT (just-in-time)
compiler
● Similar to .NET/CLR, Java/JVM
JIT
Once upon a time...
● 2008 - Facebook create HPHPc to convert
PHP to C++
● Performance boost over Zend PHP
● Don’t fully support PHP language
● Deployment includes pushing 1GB+ binary
to multiple servers
● Need to maintain production+debug builds
the story continues...
● 2010 - Facebook decided to build VM for
PHP
● HHVM built on top of HPHPc
● 2013 - Facebook.com started running on
HHVM, replacing HPHPc
Why use HHVM?
● Better performance than Zend PHP
● Nearly full compatibility with PHP 5.4
● 100% support CI, Drupal, Laravel, PHPUnit,
… (http://hhvm.com/frameworks/)
● Supports Hack
Note on using HHVM
● Not available in many Linux repos
○ Installation guide: http://bit.ly/1kP9aWS
○ Some prebuilt packages provided on GitHub (http:
//bit.ly/1oj3SIK)
● Usage with webservers: FastCGI (http://bit.
ly/1xgplGA)
● Installation on Mac is unsupported and
experimental (as of 2014-06-06)
What is Hack?
● Programming language for HHVM
● Can mix PHP
Some of the features
● Static typing
● Generics
● Collections: Vector, Map, Set, Pair
Type Annotation
<?hh
class MyClass {
const int MyConst = 0;
private string $x = '';
public function increment( int $x): int {
$y = $x + 1;
return $y;
}
}
// Source: http://hacklang.org/
Generics
<?hh
class Box<T> {
protected T $data;
public function __construct( T $data) {
$this->data = $data;
}
public function getData(): T {
return $this->data;
}
}
// Source: http://hacklang.org/
Vector
<?hh
// Hack introduces new collection types (Vector, Set and Map).
function test(): int {
// Vector is preferred over array(1, 2, 3)
$vector = Vector {1, 2, 3};
$sum = 0;
foreach ($vector as $val) {
$sum += $val;
}
return $sum;
}
// Source: http://hacklang.org/tutorial/
Demo

More Related Content

What's hot

An Overview of the Open Source Vulkan Driver for Raspberry Pi 4
An Overview of the Open Source Vulkan Driver for Raspberry Pi 4An Overview of the Open Source Vulkan Driver for Raspberry Pi 4
An Overview of the Open Source Vulkan Driver for Raspberry Pi 4
Igalia
 
Nim programming language - DevFest Berlin 2019
Nim programming language -  DevFest Berlin 2019Nim programming language -  DevFest Berlin 2019
Nim programming language - DevFest Berlin 2019
Fred Heath
 
Mono Repo
Mono RepoMono Repo
Mono Repo
Zacky Pickholz
 
Angularjs Workshop Pre-Requisites
Angularjs Workshop Pre-Requisites Angularjs Workshop Pre-Requisites
Angularjs Workshop Pre-Requisites
Houssem Yahiaoui
 
openSUSE Conference 2017 - YaST News
openSUSE Conference 2017 - YaST NewsopenSUSE Conference 2017 - YaST News
openSUSE Conference 2017 - YaST News
lslezak
 
Fixing Gaps. Strengthening the Chromium platform for content blocking
Fixing Gaps. Strengthening the Chromium platform for content blockingFixing Gaps. Strengthening the Chromium platform for content blocking
Fixing Gaps. Strengthening the Chromium platform for content blocking
Igalia
 
Git In One Evening
Git In One EveningGit In One Evening
Git In One Evening
Maxwell Pearl
 
Porting Puppet to OpenBSD
Porting Puppet to OpenBSD Porting Puppet to OpenBSD
Porting Puppet to OpenBSD
Puppet
 
Continuous Deployment of Front-end JavaScript with StriderCD, Github and Sauc...
Continuous Deployment of Front-end JavaScript with StriderCD, Github and Sauc...Continuous Deployment of Front-end JavaScript with StriderCD, Github and Sauc...
Continuous Deployment of Front-end JavaScript with StriderCD, Github and Sauc...niallo
 
How We Bacame a 'Go' Company
How We Bacame a 'Go' CompanyHow We Bacame a 'Go' Company
How We Bacame a 'Go' Company
Luka Napotnik
 
Gutenberg Extended
Gutenberg ExtendedGutenberg Extended
Gutenberg Extended
Sören Wrede
 
Advantages and disadvantages of a monorepo
Advantages and disadvantages of a monorepoAdvantages and disadvantages of a monorepo
Advantages and disadvantages of a monorepo
IanDavidson56
 
Master the Monorepo
Master the MonorepoMaster the Monorepo
Master the Monorepo
Roman Minchyn
 
Monorepo at Pinterest
Monorepo at PinterestMonorepo at Pinterest
Monorepo at Pinterest
Suman Karumuri
 
Beginning python programming
Beginning python programmingBeginning python programming
Beginning python programming
kanteshraj
 
Introduction to Vim 8.0
Introduction to Vim 8.0Introduction to Vim 8.0
Introduction to Vim 8.0
k-takata
 
Bootify Yyour App from Zero to Hero
Bootify Yyour App from Zero to HeroBootify Yyour App from Zero to Hero
Bootify Yyour App from Zero to Hero
EPAM
 
HTML5 on the AGL demo platform with Chromium and WAM (AGL AMM March 2021)
HTML5 on the AGL demo platform with Chromium and WAM (AGL AMM March 2021)HTML5 on the AGL demo platform with Chromium and WAM (AGL AMM March 2021)
HTML5 on the AGL demo platform with Chromium and WAM (AGL AMM March 2021)
Igalia
 

What's hot (20)

Ruxmon.2015-08.-.proxenet
Ruxmon.2015-08.-.proxenetRuxmon.2015-08.-.proxenet
Ruxmon.2015-08.-.proxenet
 
An Overview of the Open Source Vulkan Driver for Raspberry Pi 4
An Overview of the Open Source Vulkan Driver for Raspberry Pi 4An Overview of the Open Source Vulkan Driver for Raspberry Pi 4
An Overview of the Open Source Vulkan Driver for Raspberry Pi 4
 
Nim programming language - DevFest Berlin 2019
Nim programming language -  DevFest Berlin 2019Nim programming language -  DevFest Berlin 2019
Nim programming language - DevFest Berlin 2019
 
Mono Repo
Mono RepoMono Repo
Mono Repo
 
Angularjs Workshop Pre-Requisites
Angularjs Workshop Pre-Requisites Angularjs Workshop Pre-Requisites
Angularjs Workshop Pre-Requisites
 
openSUSE Conference 2017 - YaST News
openSUSE Conference 2017 - YaST NewsopenSUSE Conference 2017 - YaST News
openSUSE Conference 2017 - YaST News
 
Fixing Gaps. Strengthening the Chromium platform for content blocking
Fixing Gaps. Strengthening the Chromium platform for content blockingFixing Gaps. Strengthening the Chromium platform for content blocking
Fixing Gaps. Strengthening the Chromium platform for content blocking
 
Dpc
DpcDpc
Dpc
 
Git In One Evening
Git In One EveningGit In One Evening
Git In One Evening
 
Porting Puppet to OpenBSD
Porting Puppet to OpenBSD Porting Puppet to OpenBSD
Porting Puppet to OpenBSD
 
Continuous Deployment of Front-end JavaScript with StriderCD, Github and Sauc...
Continuous Deployment of Front-end JavaScript with StriderCD, Github and Sauc...Continuous Deployment of Front-end JavaScript with StriderCD, Github and Sauc...
Continuous Deployment of Front-end JavaScript with StriderCD, Github and Sauc...
 
How We Bacame a 'Go' Company
How We Bacame a 'Go' CompanyHow We Bacame a 'Go' Company
How We Bacame a 'Go' Company
 
Gutenberg Extended
Gutenberg ExtendedGutenberg Extended
Gutenberg Extended
 
Advantages and disadvantages of a monorepo
Advantages and disadvantages of a monorepoAdvantages and disadvantages of a monorepo
Advantages and disadvantages of a monorepo
 
Master the Monorepo
Master the MonorepoMaster the Monorepo
Master the Monorepo
 
Monorepo at Pinterest
Monorepo at PinterestMonorepo at Pinterest
Monorepo at Pinterest
 
Beginning python programming
Beginning python programmingBeginning python programming
Beginning python programming
 
Introduction to Vim 8.0
Introduction to Vim 8.0Introduction to Vim 8.0
Introduction to Vim 8.0
 
Bootify Yyour App from Zero to Hero
Bootify Yyour App from Zero to HeroBootify Yyour App from Zero to Hero
Bootify Yyour App from Zero to Hero
 
HTML5 on the AGL demo platform with Chromium and WAM (AGL AMM March 2021)
HTML5 on the AGL demo platform with Chromium and WAM (AGL AMM March 2021)HTML5 on the AGL demo platform with Chromium and WAM (AGL AMM March 2021)
HTML5 on the AGL demo platform with Chromium and WAM (AGL AMM March 2021)
 

Similar to What the HACK is HHVM?

Magento on HHVM. Daniel Sloof
Magento on HHVM. Daniel SloofMagento on HHVM. Daniel Sloof
Magento on HHVM. Daniel Sloof
MeetMagentoNY2014
 
IPC 2013 - High Performance PHP with HipHop
IPC 2013 - High Performance PHP with HipHopIPC 2013 - High Performance PHP with HipHop
IPC 2013 - High Performance PHP with HipHop
Steve Kamerman
 
Evolution of deploy.sh
Evolution of deploy.shEvolution of deploy.sh
Evolution of deploy.sh
Leonid Mamchenkov
 
Introduction to PHP (SDPHP)
Introduction to PHP   (SDPHP)Introduction to PHP   (SDPHP)
Introduction to PHP (SDPHP)
Eric Johnson
 
01 Php Introduction
01 Php Introduction01 Php Introduction
01 Php Introduction
Geshan Manandhar
 
Behaviour Testing and Continuous Integration with Drupal
Behaviour Testing and Continuous Integration with DrupalBehaviour Testing and Continuous Integration with Drupal
Behaviour Testing and Continuous Integration with Drupalsmithmilner
 
Rapid and Reliable Developing with HTML5 & GWT
Rapid and Reliable Developing with HTML5 & GWTRapid and Reliable Developing with HTML5 & GWT
Rapid and Reliable Developing with HTML5 & GWT
Manuel Carrasco Moñino
 
Php Inside - confoo 2011 - Derick Rethans
Php Inside -  confoo 2011 - Derick RethansPhp Inside -  confoo 2011 - Derick Rethans
Php Inside - confoo 2011 - Derick RethansBachkoutou Toutou
 
Dev/Stage/Prod Parity with Vagrant
Dev/Stage/Prod Parity with VagrantDev/Stage/Prod Parity with Vagrant
Dev/Stage/Prod Parity with Vagrant
Mike Bybee
 
Training ppt
Training pptTraining ppt
Training ppt
nikita vijay
 
PHP: Hypertext Preprocessor Introduction
PHP: Hypertext Preprocessor IntroductionPHP: Hypertext Preprocessor Introduction
PHP: Hypertext Preprocessor Introduction
Oto Brglez
 
HipHop Virtual Machine
HipHop Virtual MachineHipHop Virtual Machine
HipHop Virtual Machine
Radu Murzea
 
MOHAN ppt.pptx
MOHAN ppt.pptxMOHAN ppt.pptx
MOHAN ppt.pptx
Loki218382
 
Introduction to PHP - SDPHP
Introduction to PHP - SDPHPIntroduction to PHP - SDPHP
Introduction to PHP - SDPHP
Eric Johnson
 
NodeJS
NodeJSNodeJS
NodeJS
LinkMe Srl
 
Tech talk: PHP
Tech talk: PHPTech talk: PHP
Tech talk: PHP
Jen Wei Lee
 

Similar to What the HACK is HHVM? (20)

Daniel Sloof: Magento on HHVM
Daniel Sloof: Magento on HHVMDaniel Sloof: Magento on HHVM
Daniel Sloof: Magento on HHVM
 
Magento on HHVM. Daniel Sloof
Magento on HHVM. Daniel SloofMagento on HHVM. Daniel Sloof
Magento on HHVM. Daniel Sloof
 
Wc13
Wc13Wc13
Wc13
 
Hack and HHVM
Hack and HHVMHack and HHVM
Hack and HHVM
 
IPC 2013 - High Performance PHP with HipHop
IPC 2013 - High Performance PHP with HipHopIPC 2013 - High Performance PHP with HipHop
IPC 2013 - High Performance PHP with HipHop
 
Evolution of deploy.sh
Evolution of deploy.shEvolution of deploy.sh
Evolution of deploy.sh
 
Introduction to PHP (SDPHP)
Introduction to PHP   (SDPHP)Introduction to PHP   (SDPHP)
Introduction to PHP (SDPHP)
 
01 Php Introduction
01 Php Introduction01 Php Introduction
01 Php Introduction
 
Behaviour Testing and Continuous Integration with Drupal
Behaviour Testing and Continuous Integration with DrupalBehaviour Testing and Continuous Integration with Drupal
Behaviour Testing and Continuous Integration with Drupal
 
24307183 php
24307183 php24307183 php
24307183 php
 
Rapid and Reliable Developing with HTML5 & GWT
Rapid and Reliable Developing with HTML5 & GWTRapid and Reliable Developing with HTML5 & GWT
Rapid and Reliable Developing with HTML5 & GWT
 
Php Inside - confoo 2011 - Derick Rethans
Php Inside -  confoo 2011 - Derick RethansPhp Inside -  confoo 2011 - Derick Rethans
Php Inside - confoo 2011 - Derick Rethans
 
Dev/Stage/Prod Parity with Vagrant
Dev/Stage/Prod Parity with VagrantDev/Stage/Prod Parity with Vagrant
Dev/Stage/Prod Parity with Vagrant
 
Training ppt
Training pptTraining ppt
Training ppt
 
PHP: Hypertext Preprocessor Introduction
PHP: Hypertext Preprocessor IntroductionPHP: Hypertext Preprocessor Introduction
PHP: Hypertext Preprocessor Introduction
 
HipHop Virtual Machine
HipHop Virtual MachineHipHop Virtual Machine
HipHop Virtual Machine
 
MOHAN ppt.pptx
MOHAN ppt.pptxMOHAN ppt.pptx
MOHAN ppt.pptx
 
Introduction to PHP - SDPHP
Introduction to PHP - SDPHPIntroduction to PHP - SDPHP
Introduction to PHP - SDPHP
 
NodeJS
NodeJSNodeJS
NodeJS
 
Tech talk: PHP
Tech talk: PHPTech talk: PHP
Tech talk: PHP
 

More from Hean Hong Leong

Telegram Bot
Telegram BotTelegram Bot
Telegram Bot
Hean Hong Leong
 
How To Work With UI/UX Designer
How To Work With UI/UX DesignerHow To Work With UI/UX Designer
How To Work With UI/UX Designer
Hean Hong Leong
 
How not to be a mediocre developer!
How not to be a mediocre developer!How not to be a mediocre developer!
How not to be a mediocre developer!
Hean Hong Leong
 
Gitflow Workflow
Gitflow WorkflowGitflow Workflow
Gitflow Workflow
Hean Hong Leong
 
Lazy Programmer's Guide To Writing Spec
Lazy Programmer's Guide To Writing SpecLazy Programmer's Guide To Writing Spec
Lazy Programmer's Guide To Writing Spec
Hean Hong Leong
 
Developing Better Software
Developing Better SoftwareDeveloping Better Software
Developing Better Software
Hean Hong Leong
 
Go serving: Building server app with go
Go serving: Building server app with goGo serving: Building server app with go
Go serving: Building server app with go
Hean Hong Leong
 
Webhook & Mailhook
Webhook & MailhookWebhook & Mailhook
Webhook & Mailhook
Hean Hong Leong
 
Hacker Culture
Hacker CultureHacker Culture
Hacker Culture
Hean Hong Leong
 
Do More With Message Queue
Do More With Message QueueDo More With Message Queue
Do More With Message Queue
Hean Hong Leong
 
Building A Software Team
Building A Software TeamBuilding A Software Team
Building A Software Team
Hean Hong Leong
 
Developing MyTrafficCam
Developing MyTrafficCamDeveloping MyTrafficCam
Developing MyTrafficCam
Hean Hong Leong
 
Mobile Payment
Mobile PaymentMobile Payment
Mobile Payment
Hean Hong Leong
 
Android and web services
Android and web servicesAndroid and web services
Android and web services
Hean Hong Leong
 
Color filters for the dummies
Color filters for the dummiesColor filters for the dummies
Color filters for the dummiesHean Hong Leong
 
Android security
Android securityAndroid security
Android security
Hean Hong Leong
 
PHP_Frameworks_Discussion
PHP_Frameworks_DiscussionPHP_Frameworks_Discussion
PHP_Frameworks_DiscussionHean Hong Leong
 
Rubik Cubes For Geeks
Rubik Cubes For GeeksRubik Cubes For Geeks
Rubik Cubes For Geeks
Hean Hong Leong
 
Geekcamp Android
Geekcamp AndroidGeekcamp Android
Geekcamp Android
Hean Hong Leong
 

More from Hean Hong Leong (19)

Telegram Bot
Telegram BotTelegram Bot
Telegram Bot
 
How To Work With UI/UX Designer
How To Work With UI/UX DesignerHow To Work With UI/UX Designer
How To Work With UI/UX Designer
 
How not to be a mediocre developer!
How not to be a mediocre developer!How not to be a mediocre developer!
How not to be a mediocre developer!
 
Gitflow Workflow
Gitflow WorkflowGitflow Workflow
Gitflow Workflow
 
Lazy Programmer's Guide To Writing Spec
Lazy Programmer's Guide To Writing SpecLazy Programmer's Guide To Writing Spec
Lazy Programmer's Guide To Writing Spec
 
Developing Better Software
Developing Better SoftwareDeveloping Better Software
Developing Better Software
 
Go serving: Building server app with go
Go serving: Building server app with goGo serving: Building server app with go
Go serving: Building server app with go
 
Webhook & Mailhook
Webhook & MailhookWebhook & Mailhook
Webhook & Mailhook
 
Hacker Culture
Hacker CultureHacker Culture
Hacker Culture
 
Do More With Message Queue
Do More With Message QueueDo More With Message Queue
Do More With Message Queue
 
Building A Software Team
Building A Software TeamBuilding A Software Team
Building A Software Team
 
Developing MyTrafficCam
Developing MyTrafficCamDeveloping MyTrafficCam
Developing MyTrafficCam
 
Mobile Payment
Mobile PaymentMobile Payment
Mobile Payment
 
Android and web services
Android and web servicesAndroid and web services
Android and web services
 
Color filters for the dummies
Color filters for the dummiesColor filters for the dummies
Color filters for the dummies
 
Android security
Android securityAndroid security
Android security
 
PHP_Frameworks_Discussion
PHP_Frameworks_DiscussionPHP_Frameworks_Discussion
PHP_Frameworks_Discussion
 
Rubik Cubes For Geeks
Rubik Cubes For GeeksRubik Cubes For Geeks
Rubik Cubes For Geeks
 
Geekcamp Android
Geekcamp AndroidGeekcamp Android
Geekcamp Android
 

Recently uploaded

Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 

Recently uploaded (20)

Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 

What the HACK is HHVM?

  • 1. What the HACK is HHVM? Leong Hean Hong 2014-06-06 @ HackerspaceJB
  • 2. About ● Web/mobile developer ● Android instructor ● Experienced in developing web services ● Interest in Linux, web, mobile
  • 3. Agenda ● What is HHVM ● Where does HHVM come from? ● Why use HHVM? ● What is Hack? ● Demo (benchmark test)
  • 4. What is HHVM? PHP Code Hack Code Zend Engine (Interpreter) HHVM HipHop Virtual Machine ● PHP execution engine created by Facebook ● Convert PHP to bytecode ● Bytecode translated to machine code at runtime by JIT (just-in-time) compiler ● Similar to .NET/CLR, Java/JVM JIT
  • 5. Once upon a time... ● 2008 - Facebook create HPHPc to convert PHP to C++ ● Performance boost over Zend PHP ● Don’t fully support PHP language ● Deployment includes pushing 1GB+ binary to multiple servers ● Need to maintain production+debug builds
  • 6. the story continues... ● 2010 - Facebook decided to build VM for PHP ● HHVM built on top of HPHPc ● 2013 - Facebook.com started running on HHVM, replacing HPHPc
  • 7. Why use HHVM? ● Better performance than Zend PHP ● Nearly full compatibility with PHP 5.4 ● 100% support CI, Drupal, Laravel, PHPUnit, … (http://hhvm.com/frameworks/) ● Supports Hack
  • 8. Note on using HHVM ● Not available in many Linux repos ○ Installation guide: http://bit.ly/1kP9aWS ○ Some prebuilt packages provided on GitHub (http: //bit.ly/1oj3SIK) ● Usage with webservers: FastCGI (http://bit. ly/1xgplGA) ● Installation on Mac is unsupported and experimental (as of 2014-06-06)
  • 9. What is Hack? ● Programming language for HHVM ● Can mix PHP Some of the features ● Static typing ● Generics ● Collections: Vector, Map, Set, Pair
  • 10. Type Annotation <?hh class MyClass { const int MyConst = 0; private string $x = ''; public function increment( int $x): int { $y = $x + 1; return $y; } } // Source: http://hacklang.org/
  • 11. Generics <?hh class Box<T> { protected T $data; public function __construct( T $data) { $this->data = $data; } public function getData(): T { return $this->data; } } // Source: http://hacklang.org/
  • 12. Vector <?hh // Hack introduces new collection types (Vector, Set and Map). function test(): int { // Vector is preferred over array(1, 2, 3) $vector = Vector {1, 2, 3}; $sum = 0; foreach ($vector as $val) { $sum += $val; } return $sum; } // Source: http://hacklang.org/tutorial/
  • 13. Demo