SlideShare a Scribd company logo
1 of 19
Download to read offline
新言語Hackの話
by n0bisuke
いわてPPHHPPカンファレンス22001144
14年5月21日水曜日
About me
•のびすけ (1989∼
•Twitter: n0bisuke
•Facebook: sugawara.ryousuke
•株式会社LIG
14年5月21日水曜日
今回の話
•今回はPHPカンファレンスということで
•仕事で使っているCodeigniterでも
Node.jsでもなく興味本位で調べた内容で
す。
14年5月21日水曜日
今回の話
Web系エンジニアの中にはこういう人が多い
そもそもPHPとか…(ry
なので違う側面から。
14年5月21日水曜日
新言語Hackとは
•Facebookが開発した新言語
•PHPと互換性あり
•静的型付言語
•HHVM (後述) 上で動作
参考: 新言語Hackで最強PHPerになろう! - Qiita - http://go.shr.lc/1jpkte2
参考: https://code.facebook.com/posts/264544830379293/hack-a-new-programming-language-for-hhvm/
14年5月21日水曜日
新言語Hackとは
•Facebookは2013年から全コードを
Hackに移行
•コードによってはすぐにHackに完全移
行できない場合も考慮
•他のPHPファイルと共存させて徐々に
導入することを想定した設計
http://www.atmarkit.co.jp/ait/articles/1403/24/news092.html
PHPの開発スピードと、静的型付⾔言語の統制性を調和させ、他の現代プログラミング⾔言語に共通する多くの特徴を付加した
14年5月21日水曜日
HHVM
•HipHop Virtual Machine
•Facebookが開発した実行環境
•JVM的なイメージ
•PHP(言語)のコードの実行を,現在標準
的に使われているPHP(実行環境)よりも
高速化することが目的
14年5月21日水曜日
PHP and Hack
PHP Hack
けっこー似てるネ!
http://hacklang.org/
14年5月21日水曜日
PHP and Hack
PHP Hack
今まで	
  <?php	
  だったものを	
  <?hh	
  とするだけ
・generics
・Nullable Type
・Collection
・Lambda
・Async
・Await
・Tuple
・Override Attribute
・Type aliasing
etc
利利⽤用可能に!
14年5月21日水曜日
PHP vs Hack
PHP Hack
参考: http://web-rocker.de/2013/12/drupal-7-hhvm-vs-php-55-zend-opcache
14年5月21日水曜日
PHP vs Hack
PHP Hack
参考: http://web-rocker.de/2013/12/drupal-7-hhvm-vs-php-55-zend-opcache
14年5月21日水曜日
Hackを使ってみた
•環境
•CentOS release 6.5 (Final)
•流れ
•HHVMのインストール
•HackでHello World
14年5月21日水曜日
HHVMのインストール
参考: CentOS6.5にHHVMを入れる時のTips -
生涯未熟 - http://go.shr.lc/1kteJKX
$ sudo yum -y install http://ftp.riken.jp/Linux/fedora/
epel/6/x86_64/epel-release-6-8.noarch.rpm
$ sudo yum -y upgrade
$ cd /etc/yum.repos.d/
$ sudo wget http://www.hop5.in/yum/el6/hop5.repo
$ sudo yum install -y hhvm
epel(拡張パッケージ)をインストールしてHHVMをインストール
14年5月21日水曜日
※エラーが出ました
Error: Package: gcc-java-4.4.7-4.el6.x86_64 (@base)
Requires: gcc = 4.4.7-4.el6
・・・
Error: Package: libgnat-devel-4.4.7-4.el6.x86_64 (@base)
Requires: libgnat-4.4.so()(64bit)
・・・
$ sudo yum remove -y gcc-java
$ sudo yum remove -y liggnat-devel
邪魔者を消しておきます
14年5月21日水曜日
HHVM導⼊入完了了
$ yum install -y hhvm
・
・
Complete!
$ hhvm --version
HipHop VM 3.0.1 (rel)
14年5月21日水曜日
HHVMでPHPを実⾏行行
$ echo '<?php echo "hello hhvmn";' > hello.php
$ hhvm hello.php
hello hhvm
$ php -v
-bash: php: コマンドが見つかりません
※PHPコマンドが無くても大丈夫です
14年5月21日水曜日
HHVMでHackを実⾏行行
$ cp hello.php hello.hh
$ vi hello.hh
<?php echo "hello hhvmn";
↓
<?hh echo "hello hhvmn";
$ hhvm hello.hh
hello hhvm
実行
さっきのhello.phpをhello.hhに
おお、簡単だ!
14年5月21日水曜日
HHVMでHackを実⾏行行
$ sudo hhvm -m server
$ curl localhost/hello.php
hello hhvm
実行
Webサーバーを立ち上げて確認
14年5月21日水曜日
まとめ
•PHPerの皆さんはHackerになれます
•HackはPHPよりも⾼高速、管理理がしやす
い、多機能
•興味を持った⼈人は是⾮非使ってみましょう!
•情報元のQiitaさんありがとう(週刊qiita)
ありがとうございました!
14年5月21日水曜日

More Related Content

Viewers also liked

Texas Backgammon Championship QUIZ CHALLENGE (by Phil Simborg)
Texas Backgammon Championship QUIZ CHALLENGE (by Phil Simborg)Texas Backgammon Championship QUIZ CHALLENGE (by Phil Simborg)
Texas Backgammon Championship QUIZ CHALLENGE (by Phil Simborg)Masayuki Mochizuki
 
13A Portfolio
13A Portfolio13A Portfolio
13A Portfoliocjacob87
 
JSNA presentation for health and wellbeing network 120416
JSNA presentation for health and wellbeing network 120416JSNA presentation for health and wellbeing network 120416
JSNA presentation for health and wellbeing network 120416KingstonVA
 
Becoming the go to person and profiting from it
Becoming the go to person and profiting from itBecoming the go to person and profiting from it
Becoming the go to person and profiting from itQwiqwiq
 
A Primer On Animal Husbandry PDF
A Primer On Animal Husbandry PDFA Primer On Animal Husbandry PDF
A Primer On Animal Husbandry PDFflorence tamid-ay
 
Blog de ofimatica etiqueta secretaria
Blog de ofimatica  etiqueta secretariaBlog de ofimatica  etiqueta secretaria
Blog de ofimatica etiqueta secretariastefany14sf
 

Viewers also liked (14)

Raji_QA
Raji_QARaji_QA
Raji_QA
 
Pcd pharma franchise
Pcd pharma franchisePcd pharma franchise
Pcd pharma franchise
 
Purihuaman medina lidia
Purihuaman medina lidiaPurihuaman medina lidia
Purihuaman medina lidia
 
Texas Backgammon Championship QUIZ CHALLENGE (by Phil Simborg)
Texas Backgammon Championship QUIZ CHALLENGE (by Phil Simborg)Texas Backgammon Championship QUIZ CHALLENGE (by Phil Simborg)
Texas Backgammon Championship QUIZ CHALLENGE (by Phil Simborg)
 
13A Portfolio
13A Portfolio13A Portfolio
13A Portfolio
 
JSNA presentation for health and wellbeing network 120416
JSNA presentation for health and wellbeing network 120416JSNA presentation for health and wellbeing network 120416
JSNA presentation for health and wellbeing network 120416
 
Slide bhs
Slide bhsSlide bhs
Slide bhs
 
Chapter 5
Chapter 5Chapter 5
Chapter 5
 
Becoming the go to person and profiting from it
Becoming the go to person and profiting from itBecoming the go to person and profiting from it
Becoming the go to person and profiting from it
 
Resume- 3.0
Resume- 3.0Resume- 3.0
Resume- 3.0
 
ORCID UGent
ORCID UGentORCID UGent
ORCID UGent
 
A Primer On Animal Husbandry PDF
A Primer On Animal Husbandry PDFA Primer On Animal Husbandry PDF
A Primer On Animal Husbandry PDF
 
La demanda
La demandaLa demanda
La demanda
 
Blog de ofimatica etiqueta secretaria
Blog de ofimatica  etiqueta secretariaBlog de ofimatica  etiqueta secretaria
Blog de ofimatica etiqueta secretaria
 

Similar to 新言語Hackの話 (いわてPHPカンファレンス2014)

PHPカンファレンス2013 今ドキのPHPの書き方 ~PHP逆引きレシピ改訂版~
PHPカンファレンス2013 今ドキのPHPの書き方 ~PHP逆引きレシピ改訂版~PHPカンファレンス2013 今ドキのPHPの書き方 ~PHP逆引きレシピ改訂版~
PHPカンファレンス2013 今ドキのPHPの書き方 ~PHP逆引きレシピ改訂版~Yuta Sakurai
 
PHP7はなぜ速いのか
PHP7はなぜ速いのかPHP7はなぜ速いのか
PHP7はなぜ速いのかYoshio Hanawa
 
PHP カンファレンス 2014 に行ってきたよ
PHP カンファレンス 2014 に行ってきたよPHP カンファレンス 2014 に行ってきたよ
PHP カンファレンス 2014 に行ってきたよMasaru Matsuo
 
php-buildがいかに便利かを力説する
php-buildがいかに便利かを力説するphp-buildがいかに便利かを力説する
php-buildがいかに便利かを力説するYoshio Hanawa
 
Php入門
Php入門Php入門
Php入門dcubeio
 
PHP7の拡張モジュール事情
PHP7の拡張モジュール事情PHP7の拡張モジュール事情
PHP7の拡張モジュール事情Yoshio Hanawa
 
私の好きなPython構文 vol.2 #nds46
私の好きなPython構文 vol.2 #nds46私の好きなPython構文 vol.2 #nds46
私の好きなPython構文 vol.2 #nds46civicpg
 
PHPマニュアルの育て方
PHPマニュアルの育て方PHPマニュアルの育て方
PHPマニュアルの育て方Masahiro Takagi
 
anything-php-funcref-perl.el
anything-php-funcref-perl.elanything-php-funcref-perl.el
anything-php-funcref-perl.elKenichirou Oyama
 

Similar to 新言語Hackの話 (いわてPHPカンファレンス2014) (11)

PHPNGの動向
PHPNGの動向PHPNGの動向
PHPNGの動向
 
PHPカンファレンス2013 今ドキのPHPの書き方 ~PHP逆引きレシピ改訂版~
PHPカンファレンス2013 今ドキのPHPの書き方 ~PHP逆引きレシピ改訂版~PHPカンファレンス2013 今ドキのPHPの書き方 ~PHP逆引きレシピ改訂版~
PHPカンファレンス2013 今ドキのPHPの書き方 ~PHP逆引きレシピ改訂版~
 
PHP7はなぜ速いのか
PHP7はなぜ速いのかPHP7はなぜ速いのか
PHP7はなぜ速いのか
 
PHP カンファレンス 2014 に行ってきたよ
PHP カンファレンス 2014 に行ってきたよPHP カンファレンス 2014 に行ってきたよ
PHP カンファレンス 2014 に行ってきたよ
 
php-buildがいかに便利かを力説する
php-buildがいかに便利かを力説するphp-buildがいかに便利かを力説する
php-buildがいかに便利かを力説する
 
Php入門
Php入門Php入門
Php入門
 
PHP7の拡張モジュール事情
PHP7の拡張モジュール事情PHP7の拡張モジュール事情
PHP7の拡張モジュール事情
 
私の好きなPython構文 vol.2 #nds46
私の好きなPython構文 vol.2 #nds46私の好きなPython構文 vol.2 #nds46
私の好きなPython構文 vol.2 #nds46
 
♡PHPが恋しい話♡
♡PHPが恋しい話♡♡PHPが恋しい話♡
♡PHPが恋しい話♡
 
PHPマニュアルの育て方
PHPマニュアルの育て方PHPマニュアルの育て方
PHPマニュアルの育て方
 
anything-php-funcref-perl.el
anything-php-funcref-perl.elanything-php-funcref-perl.el
anything-php-funcref-perl.el
 

More from Sugawara Ryousuke

More from Sugawara Ryousuke (13)

20220716_jsfes.pdf
20220716_jsfes.pdf20220716_jsfes.pdf
20220716_jsfes.pdf
 
クリスマス企画を技術面から振り返り ( #ヒカラボ: 15分)
クリスマス企画を技術面から振り返り  ( #ヒカラボ: 15分)クリスマス企画を技術面から振り返り  ( #ヒカラボ: 15分)
クリスマス企画を技術面から振り返り ( #ヒカラボ: 15分)
 
LIGのクリスマス企画の裏側の話(企画面)
LIGのクリスマス企画の裏側の話(企画面)LIGのクリスマス企画の裏側の話(企画面)
LIGのクリスマス企画の裏側の話(企画面)
 
Cmujp21_node-webkit
Cmujp21_node-webkitCmujp21_node-webkit
Cmujp21_node-webkit
 
たきざワッカソン 開会式
たきざワッカソン 開会式たきざワッカソン 開会式
たきざワッカソン 開会式
 
Introducing a Revitalization Project for a Local City in Japan by Learning
Introducing a Revitalization Project for a Local City in Japan by LearningIntroducing a Revitalization Project for a Local City in Japan by Learning
Introducing a Revitalization Project for a Local City in Japan by Learning
 
n0bisuke Isltm10
n0bisuke Isltm10n0bisuke Isltm10
n0bisuke Isltm10
 
ELT isltm10
ELT isltm10ELT isltm10
ELT isltm10
 
ぼっち
ぼっちぼっち
ぼっち
 
mario
mariomario
mario
 
aya ueto
aya uetoaya ueto
aya ueto
 
Isltm perfume
Isltm perfumeIsltm perfume
Isltm perfume
 
Intro
IntroIntro
Intro
 

Recently uploaded

Postman LT Fukuoka_Quick Prototype_By Daniel
Postman LT Fukuoka_Quick Prototype_By DanielPostman LT Fukuoka_Quick Prototype_By Daniel
Postman LT Fukuoka_Quick Prototype_By Danieldanielhu54
 
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介Yuma Ohgami
 
【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)
【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)
【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)Hiroki Ichikura
 
SOPを理解する 2024/04/19 の勉強会で発表されたものです
SOPを理解する       2024/04/19 の勉強会で発表されたものですSOPを理解する       2024/04/19 の勉強会で発表されたものです
SOPを理解する 2024/04/19 の勉強会で発表されたものですiPride Co., Ltd.
 
スマートフォンを用いた新生児あやし動作の教示システム
スマートフォンを用いた新生児あやし動作の教示システムスマートフォンを用いた新生児あやし動作の教示システム
スマートフォンを用いた新生児あやし動作の教示システムsugiuralab
 
TSAL operation mechanism and circuit diagram.pdf
TSAL operation mechanism and circuit diagram.pdfTSAL operation mechanism and circuit diagram.pdf
TSAL operation mechanism and circuit diagram.pdftaisei2219
 
論文紹介:Automated Classification of Model Errors on ImageNet
論文紹介:Automated Classification of Model Errors on ImageNet論文紹介:Automated Classification of Model Errors on ImageNet
論文紹介:Automated Classification of Model Errors on ImageNetToru Tamaki
 
論文紹介:Semantic segmentation using Vision Transformers: A survey
論文紹介:Semantic segmentation using Vision Transformers: A survey論文紹介:Semantic segmentation using Vision Transformers: A survey
論文紹介:Semantic segmentation using Vision Transformers: A surveyToru Tamaki
 
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略Ryo Sasaki
 
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...Toru Tamaki
 

Recently uploaded (10)

Postman LT Fukuoka_Quick Prototype_By Daniel
Postman LT Fukuoka_Quick Prototype_By DanielPostman LT Fukuoka_Quick Prototype_By Daniel
Postman LT Fukuoka_Quick Prototype_By Daniel
 
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
 
【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)
【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)
【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)
 
SOPを理解する 2024/04/19 の勉強会で発表されたものです
SOPを理解する       2024/04/19 の勉強会で発表されたものですSOPを理解する       2024/04/19 の勉強会で発表されたものです
SOPを理解する 2024/04/19 の勉強会で発表されたものです
 
スマートフォンを用いた新生児あやし動作の教示システム
スマートフォンを用いた新生児あやし動作の教示システムスマートフォンを用いた新生児あやし動作の教示システム
スマートフォンを用いた新生児あやし動作の教示システム
 
TSAL operation mechanism and circuit diagram.pdf
TSAL operation mechanism and circuit diagram.pdfTSAL operation mechanism and circuit diagram.pdf
TSAL operation mechanism and circuit diagram.pdf
 
論文紹介:Automated Classification of Model Errors on ImageNet
論文紹介:Automated Classification of Model Errors on ImageNet論文紹介:Automated Classification of Model Errors on ImageNet
論文紹介:Automated Classification of Model Errors on ImageNet
 
論文紹介:Semantic segmentation using Vision Transformers: A survey
論文紹介:Semantic segmentation using Vision Transformers: A survey論文紹介:Semantic segmentation using Vision Transformers: A survey
論文紹介:Semantic segmentation using Vision Transformers: A survey
 
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
 
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
 

新言語Hackの話 (いわてPHPカンファレンス2014)