Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Introduction of php-ext by rust
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
gong023
January 14, 2016
Programming
0
13k
Introduction of php-ext by rust
ごく簡単なphp拡張をrustで作る手順
gong023
January 14, 2016
Tweet
Share
Other Decks in Programming
See All in Programming
SourceGeneratorのススメ
htkym
0
200
疑似コードによるプロンプト記述、どのくらい正確に実行される?
kokuyouwind
0
390
副作用をどこに置くか問題:オブジェクト指向で整理する設計判断ツリー
koxya
1
610
CSC307 Lecture 07
javiergs
PRO
1
550
Rust 製のコードエディタ “Zed” を使ってみた
nearme_tech
PRO
0
200
FOSDEM 2026: STUNMESH-go: Building P2P WireGuard Mesh Without Self-Hosted Infrastructure
tjjh89017
0
170
高速開発のためのコード整理術
sutetotanuki
1
410
カスタマーサクセス業務を変革したヘルススコアの実現と学び
_hummer0724
0
720
OSSとなったswift-buildで Xcodeのビルドを差し替えられるため 自分でXcodeを直せる時代になっている ダイアモンド問題編
yimajo
3
620
AIと一緒にレガシーに向き合ってみた
nyafunta9858
0
250
HTTPプロトコル正しく理解していますか? 〜かわいい猫と共に学ぼう。ฅ^•ω•^ฅ ニャ〜
hekuchan
2
690
Vibe Coding - AI 驅動的軟體開發
mickyp100
0
180
Featured
See All Featured
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
60
42k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.4k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.7k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.1k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
94
Building Adaptive Systems
keathley
44
2.9k
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
83
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.4k
Automating Front-end Workflow
addyosmani
1371
200k
Darren the Foodie - Storyboard
khoart
PRO
2
2.4k
Transcript
Introduction of php-ext by rust
About me • gong023 • https://github.com/gong023/ • PHP developer of
• #mercari_wakate??
I — PHP
Interested in rust
rust is • supported by Mozilla • to replace Firefox
engine • better C++ • golang is better C
rust is good because…
Safe memory You can compile errors with dangerous memory operations
Safe memory You can compile errors with dangerous memory operations
Modern syntax • Optional
Modern syntax • Generics & Traits
create php-ext by rust
Overview 1. Create shared object file by rust 2. Test
shared object file by C 3. Link shared object file from php-ext
Create .so file by rust 1. cargo new 2. write
a function in rust 3. cargo build • you can get *.so file
Test .so file by C 1. Write test code in
C 2. Include .so and compile C test code • Don’t forget to link shared object • gcc test.c -L SO_PATH -php_ext
Link .so file from php-ext 1. Create php-ext by ext-skel
2. Edit config.m4 and configure • difficult…
Link .so file from php-ext • Edit config.m4 I don’t
know why it doesn’t work
Link .so file from php-ext • Edit config.m4 I added
a path ignoring errors
Link .so file from php-ext 3. Write .h and .c
in php-ext • see references to know more details 4. make && make install 5. Test
Advanced • I tried to export rust-carbon to php-ext •
https://github.com/gong023/rust-carbon • But I don’t succeed yet. I don’t know why it doesn’t work
References • http://hermanradtke.com/2015/08/03/ creating-a-php-extension-to-rust.html • https://github.com/hjr3/rust-php-ext • http://postd.cc/creating-a-php-extension-in- rust/