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
Xslate振り返り
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
FUJI Goro
October 17, 2014
Technology
2
5.7k
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.8k
How to Boost Your Code with WebAssembly
gfx
2
3.1k
AssemblyScriptでライブラリコードの高速化をしてみる
gfx
5
3.3k
実践TypeScriptトークバトル
gfx
1
1.2k
歴史的経緯の説明 as code
gfx
7
2.9k
Elasticsearchによる 全文検索の実装 in Rails
gfx
6
9.7k
すばらしきGraphQLのSEKAIへようこそ
gfx
20
9.7k
マルチテナント・ウェブアプリケーションの実践
gfx
14
9.7k
How to choose the ORM on Android
gfx
1
4.4k
Other Decks in Technology
See All in Technology
たかがボタン、されどボタン ~button要素から深ぼるボタンUIの定義について~ / BuriKaigi 2026
yamanoku
1
290
CodeRabbit CLI + Claude Codeの連携について
oikon48
1
620
全員が「作り手」になる。職能の壁を溶かすプロトタイプ開発。
hokuo
1
390
みんなでAI上手ピーポーになろう! / Let’s All Get AI-Savvy!
kaminashi
0
200
Data Intelligence on Lakehouse Paradigm
scotthsieh825
0
190
AI アクセラレータチップ AWS Trainium/Inferentia に 今こそ入門
yoshimi0227
1
320
ドキュメントからはじめる未来のソフトウェア
pkshadeck
2
670
re:Inventで出たインフラエンジニアが嬉しかったアップデート
nagisa53
4
190
アウトプットはいいぞ / output_iizo
uhooi
0
140
20260114_データ横丁 新年LT大会:2026年の抱負
taromatsui_cccmkhd
0
380
AWS監視を「もっと楽する」ために
uechishingo
0
300
「違う現場で格闘する二人」——社内コミュニティがつないだトヨタ流アジャイルの実践とその先
shinichitakeuchi
0
580
Featured
See All Featured
A Modern Web Designer's Workflow
chriscoyier
698
190k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
61k
The World Runs on Bad Software
bkeepers
PRO
72
12k
Become a Pro
speakerdeck
PRO
31
5.8k
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
99
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
200
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
Mobile First: as difficult as doing things right
swwweet
225
10k
Statistics for Hackers
jakevdp
799
230k
The Language of Interfaces
destraynor
162
26k
A Tale of Four Properties
chriscoyier
162
24k
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
53
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