Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
PHP で JVM を実装して、 HelloWorld を出力してみる
Search
memory
PRO
February 09, 2020
Programming
4.9k
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
PHP で JVM を実装して、 HelloWorld を出力してみる
- PHPerKaigi 2020
- English Title:
Implement JVM with PHP and try to output Hello World
memory
PRO
February 09, 2020
More Decks by memory
See All by memory
AI 時代のスタートアップエコシステ厶から考究する技術的負債との向き合い方
m3m0r7
PRO
3
3.6k
pnl で簡易的に作る PHP ネイティブアプリケーション
m3m0r7
PRO
0
100
セグメントとターゲットを意識するプロポーザルの書き方 〜採択の鍵は、誰に刺すかを見極めるマーケティング戦略にある〜
m3m0r7
PRO
1
1.2k
PHP で mp3 プレイヤーを実装しよう
m3m0r7
PRO
0
620
PHP でエミュレータを自作して Ubuntu を動かそう
m3m0r7
PRO
2
360
AI 時代だからこそ学ぶべき PHP の基礎
m3m0r7
PRO
7
2.7k
JVM の仕組みを理解して PHP で実装してみよう
m3m0r7
PRO
1
700
コードゴルファー道
m3m0r7
PRO
0
690
ChatGPT とつくる PHP で OS 実装
m3m0r7
PRO
3
580
Other Decks in Programming
See All in Programming
Domain-Driven Transformation
hschwentner
2
2.3k
エージェントを使い続けるためのメタワーク / Meta-work for keeping using the agent
rkaga
6
2k
Kotlinの15年とServer-Side Kotlin
n_takehata
1
170
AI時代のFlutter品質設計 — アプリ品質を守るQuality Layers
omatty198
0
240
現場と育てるRailsモデリング 〜Spreadsheetから始めたモデル設計〜
siroemk
2
1.1k
sbt 2.0: takeoff
eed3si9n
0
170
AI主導のプログラミング学習アプリを作ってみた
econanringo
0
200
HTML-in-Canvasで作る未来のWeb UI表現
clockmaker
5
5.9k
Seven New Principles of Software Engineering
yegor256
0
360
GraphQL の onError と Nullability のこれから
quramy
0
190
Apple Intelligenceとオンデバイス時代の到来
yahir0
0
160
Long Living Tokens, Die, Die, Die! (or: The One Ring is Banned in Modern)
sylph01
0
380
Featured
See All Featured
HDC tutorial
michielstock
2
980
Thoughts on Productivity
jonyablonski
76
5.4k
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
1.8k
The SEO identity crisis: Don't let AI make you average
varn
0
610
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
2
960
Navigating Team Friction
lara
192
16k
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.8k
Google's AI Overviews - The New Search
badams
0
1.6k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.4k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
350
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.6k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.4k
Transcript
/ / PHPerKaigi PHP JVM HelloWorld © - BASE, Inc.
© - BASE, Inc. Who am I? (@m m r
) BASE 6 SDVX
© - BASE, Inc. Who am I?
None
© - BASE, Inc. PHPerKaigi Builderscon
© - BASE, Inc. php-java/php-java
OSS
None
© - BASE, Inc. JVM PHP
© - BASE, Inc. Hello World
JVM
JVM
© - BASE, Inc. JVM JVM Java Virtual Machine Java
JVM JRE JDK
JVM
<?php exec('java HelloWorld')
<?php exec('java HelloWorld')
© - BASE, Inc. JVM Java class class JVM
© - BASE, Inc. JVM JVM Java Virtual Machine Specification
Oracle
© - BASE, Inc. JVM
© - BASE, Inc. JVM Java class
© - BASE, Inc. JVM
© - BASE, Inc. JVM class
JVM
© - BASE, Inc. Perl PHP JavaScript / Builderscon YAPC::Kyoto
PHPerKaigi Qiita JVM
JVM
© - BASE, Inc. Rust Emacs Go Ruby rchaser gongoZ
DQNEO Daiki Miura JVM
JVM
JVM,
PHP
None
© - BASE, Inc. fopen / fread OK
None
© - BASE, Inc. 16 short, unsigned short, integer, unsigned
integer pack / unpack JVM
None
PHP
© - BASE, Inc. PHP int (- ^ ^ -
) bool string float, double array null etc...
Java
© - BASE, Inc. Java byte char short (- ^
^ - ) int (- ^ ^ - ) long (- ^ ^ - ) boolean float double
None
PHP Java
None
None
© - BASE, Inc. ( ) JVM invokevirtual iload /
istore
Hello World
Java Virtual Machine Specification
© - BASE, Inc. JVM Spec Java Virtual Machine Specification
JVM Spec JVM Spec Oracle JVM https://docs.oracle.com/javase/specs/ index.html
ClassFile Structure
© - BASE, Inc. ClassFile Structure
© - BASE, Inc. ClassFile Structure
© - BASE, Inc. JVM Spec u unsigned int u
unsigned short
Hello World
© - BASE, Inc. Constant Pool Method Info Code Attribute
Hello World
Method Info
© - BASE, Inc. Method Info
© - BASE, Inc. Method Info
Code Attribute
None
© - BASE, Inc. Code Attribute
© - BASE, Inc. Code Attribute
© - BASE, Inc. Code Attribute
© - BASE, Inc. Code Attribute
© - BASE, Inc. Code Attribute
© - BASE, Inc. Code Attribute
© - BASE, Inc. Code Attribute
None
© - BASE, Inc. JVM Spec code[code_length] JVM Spec
None
None
None
© - BASE, Inc. java.lang.System.out getstatic println invokevirtual
© - BASE, Inc. Constant Pool ldc return
4
None
getstatic
© - BASE, Inc. getstatic getstatic getstatic Constant Pool unsigned
short
© - BASE, Inc. getstatic getstatic <0xB > putstatic
© - BASE, Inc. getstatic
© - BASE, Inc. getstatic
© - BASE, Inc. getstatic
© - BASE, Inc. getstatic
© - BASE, Inc. getstatic
© - BASE, Inc. getstatic
© - BASE, Inc. getstatic
invokevirtual
© - BASE, Inc. invokevirtual invokevirtual Constant Pool
© - BASE, Inc. invokevirtual invokevirtual <0xB > invoke dynamic,
special, interface, static
© - BASE, Inc. invokevirtual invoke JVM invoke invokedynamic invokeinterface
© - BASE, Inc. invokevirtual
© - BASE, Inc. invokevirtual
© - BASE, Inc. invokevirtual
© - BASE, Inc. invokevirtual
© - BASE, Inc. invokevirtual
© - BASE, Inc. invokevirtual
© - BASE, Inc. invokevirtual void
ldc
© - BASE, Inc. ldc ldc Constant Pool UTF Integer,
short, byte Constant Pool unsigned byte
© - BASE, Inc. ldc ldc Long Double
© - BASE, Inc. ldc
© - BASE, Inc. ldc Constant Pool
© - BASE, Inc. ldc Constant Pool
© - BASE, Inc. ldc
return
© - BASE, Inc. return return void moniterenter return areturn,
ireturn, freturn, dreturn
Hello World
© - BASE, Inc. Hello World B NN MM NN
B NN MM B
© - BASE, Inc. Hello World B NN MM NN
B NN MM B getstatic
© - BASE, Inc. Hello World B NN MM NN
B NN MM B unsigned short
© - BASE, Inc. Hello World B NN MM NN
B NN MM B ldc
© - BASE, Inc. Hello World B NN MM NN
B NN MM B unsigned byte Hello World Constant Pool
© - BASE, Inc. Hello World B NN MM NN
B NN MM B invokevirtual
© - BASE, Inc. Hello World B NN MM NN
B NN MM B unsigned short Constant Pool
© - BASE, Inc. Hello World B NN MM NN
B NN MM B return
None
"java.lang.System"
© - BASE, Inc. "java.lang.System" Java java.lang.System PHP "java\lang\System" System
"out"
© - BASE, Inc. "java.lang.System" ;
"out"
© - BASE, Inc. "out" PHP JVM static
© - BASE, Inc. "out"
© - BASE, Inc. "out"
"println" "java.io.PrintStream"
© - BASE, Inc. "java.io.PrintStream"
Hello World
DEMO
THANK YOU FOR YOUR LISTENING