Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Xslate振り返り
Search
FUJI Goro
October 17, 2014
Technology
2
5.6k
Xslate振り返り
Template Engine Night 2014/10/17 の資料です
FUJI Goro
October 17, 2014
Tweet
Share
More Decks by FUJI Goro
See All by FUJI Goro
ステートレスなLLMでステートフルなAI agentを作る - YAPC::Fukuoka 2025
gfx
7
1.7k
How to Boost Your Code with WebAssembly
gfx
2
3k
AssemblyScriptでライブラリコードの高速化をしてみる
gfx
5
3.2k
実践TypeScriptトークバトル
gfx
1
1.2k
歴史的経緯の説明 as code
gfx
7
2.9k
Elasticsearchによる 全文検索の実装 in Rails
gfx
6
9.7k
すばらしきGraphQLのSEKAIへようこそ
gfx
20
9.6k
マルチテナント・ウェブアプリケーションの実践
gfx
14
9.7k
How to choose the ORM on Android
gfx
1
4.4k
Other Decks in Technology
See All in Technology
子育てで想像してなかった「見えないダメージ」 / Unforeseen "hidden burdens" of raising children.
pauli
2
320
さくらのクラウド開発ふりかえり2025
kazeburo
2
930
Strands AgentsとNova 2 SonicでS2Sを実践してみた
yama3133
1
1.7k
事業の財務責任に向き合うリクルートデータプラットフォームのFinOps
recruitengineers
PRO
2
190
会社紹介資料 / Sansan Company Profile
sansan33
PRO
11
390k
AWS re:Invent 2025~初参加の成果と学び~
kubomasataka
0
180
株式会社ビザスク_AI__Engineering_Summit_Tokyo_2025_登壇資料.pdf
eikohashiba
1
110
アラフォーおじさん、はじめてre:Inventに行く / A 40-Something Guy’s First re:Invent Adventure
kaminashi
0
130
フルカイテン株式会社 エンジニア向け採用資料
fullkaiten
0
9.9k
たまに起きる外部サービスの障害に備えたり備えなかったりする話
egmc
0
400
MySQLとPostgreSQLのコレーション / Collation of MySQL and PostgreSQL
tmtms
1
1.2k
Oracle Database@Google Cloud:サービス概要のご紹介
oracle4engineer
PRO
1
760
Featured
See All Featured
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
69
The Mindset for Success: Future Career Progression
greggifford
PRO
0
190
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
1.7k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
30
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
190
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
60
37k
End of SEO as We Know It (SMX Advanced Version)
ipullrank
2
3.8k
Build your cross-platform service in a week with App Engine
jlugia
234
18k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
130
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
150
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
0
180
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
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