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
Xslate振り返り
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
FUJI Goro
October 17, 2014
Technology
6.3k
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Xslate振り返り
Template Engine Night 2014/10/17 の資料です
FUJI Goro
October 17, 2014
More Decks by FUJI Goro
See All by FUJI Goro
ステートレスなLLMでステートフルなAI agentを作る - YAPC::Fukuoka 2025
gfx
7
2k
How to Boost Your Code with WebAssembly
gfx
2
3.2k
AssemblyScriptでライブラリコードの高速化をしてみる
gfx
5
3.4k
実践TypeScriptトークバトル
gfx
1
1.3k
歴史的経緯の説明 as code
gfx
7
2.9k
Elasticsearchによる 全文検索の実装 in Rails
gfx
6
9.8k
すばらしきGraphQLのSEKAIへようこそ
gfx
20
10k
マルチテナント・ウェブアプリケーションの実践
gfx
14
9.9k
How to choose the ORM on Android
gfx
1
4.5k
Other Decks in Technology
See All in Technology
【視聴者参加型!】AWSセキュリティアンチパターンクイズ
syoshie
1
480
プロダクト思考 × 基盤思考を AIで実現する Compound Engineering
tkc66buzz
1
310
プロダクトエンジニアに必要な「いい感じ」に作る能力 〜たくさん作れる時代に、どこまで作るかの決め方〜
jnishime_dresscode
2
1.4k
Where Is JetBrains AI Heading- — Central CLI, Air Alpha, and the Agentic Development Stack
x5gtrn
PRO
0
150
Omarchy Quattro の日本語設定周り
simosako
2
120
Claude Code本って、 読む必要あるの?
oikon48
1
330
AIに丸投げしないトイル削減 / Eliminating Toil Without Leaving It All to AI
kohbis
4
1k
omasushiというライブラリを作った
polidog
PRO
0
170
Redmine 7.0で私が開発した新機能の狙いと背景
vividtone
1
130
「重なり」は迎える側がつくる ― 人もAIエージェントも歓迎するプロダクトエンジニアリング ―
go0517go
PRO
0
270
全員がプロダクトへ向き合う組織を持続成長させるために——組織づくりのフライホイールと4象限 / The Flywheel Model and Four Quadrants for Organizational Design
hiro_torii
4
940
DEFCON_CHV_CTF_Write-up.pdf
bata_24
0
110
Featured
See All Featured
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
510
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
230
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
35
2.8k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
202
76k
Docker and Python
trallard
47
4.2k
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
430
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
450
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
エンジニアに許された特別な時間の終わり
watany
108
250k
How Software Deployment tools have changed in the past 20 years
geshan
1
34k
What's in a price? How to price your products and services
michaelherold
247
13k
Large-scale JavaScript Application Architecture
addyosmani
515
110k
Transcript
Xslate։ൃͷৼΓฦΓ Template Engine Night 2014-10-17 by gfx (CPAN:GFUJI)
ࣗݾհ • gfx • ϞόΠϧΞϓϦΤϯδχΞ • Android / iOS ༻ͷࣾϥΠϒϥϦ։ൃ͕ओ
• HTMLΑΓAndroidͷlayout XMLͷ΄͏Λࢁॻ͍ ͯ·͢ • Xslate20104݄ʹ։ൃͯ͠20111݄ʹ1.0
http://xslate.org/ https://github.com/xslate
arity
Introduction to Xslate • Xslate: Perl࠷ͷςϯϓϨʔτΤϯδϯ • ʮςϯϓϨʔτΤϯδϯͷ࣮ʰʱͱʰػೳʱ ͷτϨʔυΦϑ͕͋Δʯͱ͍͏ݴઆΛ൱ఆͨ͠ʂ •
࣮ߦΤϯδϯCͰ࣮ͨ͠ԾϚγϯ • DTC: Direct Threaded Code • YARV ManiacsͱCRubyΛࢀߟʹͨ͠
ࢀߟ: XslateҎલͷ࣌ • ߴ • HTML::Template::Pro, Text::ClearSilver • ߴػೳ •
Template-Toolkit, Text::MicroTemplate
)FMMP OBNF "45 0QDPEF4FRVFODF %5$ < <MJUFSBM l)FMMP l>
<QSJOU lOBNFz> > QBSTF DPNQJMF BTTFNCMF
Virtual Machine (written in C)
Template Syntax (“Kolon”)
Xslateͷಛ • छྨ • ൚༻ɾಠࣗݴޠܕʢSmarty, Mustache) • ࢀߟ: ൚༻ɾϗετݴޠܕʢerb, JSPʣ,
HAMLܕ (haml, Jade), XMLܕ (Thymeleaf, Genshi) • ॏ • ߴػೳ & ߴ ʢ͍͍ͩͨओཁͳػೳ͍͋ͬͯʣ • ࢀߟ: Τϯδϯͷอकੑ, ςϯϓϨʔτϑΝΠϧͷอकੑ, ଞͷݴޠ͔Βͷར༻
ৼΓฦΓ Keep / Problem / Try
Keep - Α͔ͬͨ͜ͱ • σϑΝΫτͩͬͨTemplate-Toolkitͷ100ഒߴ • ͷܕͰHTML escapeͷཁɾෆཁΛܾఆ͢Δ • PSGI͚ͩΛߟ͑ͯೖग़ྗΛ୯७ʹͨ͠
• ύʔαɾίϯύΠϥɾVMΛ͍͓͔ͯͨ͛͠Ͱ੩తղੳπʔϧ Λ࡞Δ༨͕͋ͬͨ • Locale::Maketext::Extract::Plugin::Xslate • جຊػೳҎ֎ͯ͢ϢʔβʔఆٛؔͰఏڙͱ͍͏ͷΑ͔ͬͨ
Problem - ѱ͔ͬͨ͜ͱ • ʹͩ͜ΘΓ࣮͕͗ͯ͢ղʹͳͬͨ • CʹΑΔͩ͜ΘΓͷVM, ෳࡶ͗͢ΔΩϟογϡγεςϜ… • ࣮༻Ϩϕϧͷ͕͋Εɺ࣍ʹॏཁͳͷอकੑ
• ಈతܕ͖ݴޠతͳܽ • ͋Δύϥϝʔλ͕ʮҙʯͳͷ͔ʮඞਢʯͳͷ͔Λهड़Ͱ͖ͳ͍ • ΠϯΫϧʔυͰมΛೝΊΔʢ<: include $file :> ʣඞཁຊʹඞ ཁ͔ͩͬͨ • ։ൃऀ͕Σϒ։ൃΛ͠ͳ͔ͬͨʢࣄͰ͏ͱࢥͬͨΒΘͳ͔ͬͨʣ
Try - ະདྷͷςϯϓϨʔτΤϯδϯ • ७ਮʹϗετݴޠͰ࣮͢Δ or JavaScriptͰ࣮ • ੩తղੳΛ༰қʹͯ͠πʔϧνΣΠϯΛ๛ʹ •
ςϯϓϨʔτϑΝΠϧͷؔΛநग़͢Δπʔϧ • Ͳ͏͍͏ύϥϝʔλΛͱΔ͔Λநग़͢Δπʔϧ • ϓϩϑΝΠϥ͕΄͍͠ • ͍ͣΕʹͤΑςϯϓϨʔτݴޠJSͷαϒηοτͰΑ͍
࣮ݴޠ • ϗετݴޠͰ࣮͢Δͱϝϯς͍͢͠ • Keep It Simple, Stupid! • JavaScriptͰ࣮͢ΔͱϒϦοδ෦Ͱτϥϒϧ
͕ى͖͕͕ͪͩ࠶ར༻Ͱ͖ΔՄೳੑߴ͍ • ͤΔσʔλJSONʹ੍ݶͤ͟ΔΛ͑ͳ͍ • རศੑͱͷτϨʔυΦϑ͕ͩݕ౼ͷՁ͋Δ
ςϯϓϨʔτͷछྨ • ൚༻ܕHTMLͷग़ྗҎ֎ʹ͑ΔͷͰඞਢ • hamlܕॻ͘ͷָ͕ͳ໘ɺֶशίετ͕ߴ ͍ɻه๏౷Ұ͞Ε͓ͯΒͣաظͳײ͡ • XMLܕͷϝϦοτΑ͘Θ͔Βͳ͍ • SࣜͰॻ͘ͷҙ֎ͱѱ͘ͳ͍Μ͡Όͳ͍͔
hamlͷޭࡑ • %ul • %li • - if expr •
Hello, world # ΠϯσϯτϨϕϧʁ • ࣮͕buggy & slowͰΞϨ͗͢Δ
੩తղੳ • ϓϩάϥϜΛ࣮ߦͤͣʹɺߏจˍincludeͷଥੑ&ύϥϝʔλͷ ଥੑΛνΣοΫ͍ͨ͠ • <: $foo :> ͕ۭʹͳΔͷϩδοΫΤϥʔ •
<: $foo // “bar” :> $foo͕ۭͰ͋ΕbarʹͳΔ • <: f($foo) :> ͜ͷϢʔβʔఆٛؔͱΈΒΕΔf()ଥ͔ʁ • ͜ͷνΣοΫΛ੩తʹ͢Δͷ͍͠ • ఆٛͷΈΛॻ͍ͨσʔλ = IDL͕ඞཁ
That’s all. ! ࢀߟ: https://gist.github.com/ tokuhirom/61f5e20cf759706ca3c9