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
EXIA.pdf
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
slme
January 25, 2018
160
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
EXIA.pdf
slme
January 25, 2018
More Decks by slme
See All by slme
ViewModel SavedState
slme
1
160
Kotlin Serializationことはじめ
slme
1
1.1k
Featured
See All Featured
Google's AI Overviews - The New Search
badams
0
1.6k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
370
Ten Tips & Tricks for a 🌱 transition
stuffmc
1
250
Paper Plane (Part 1)
katiecoart
PRO
2
11k
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
2
2.2k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
530
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
320
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.4k
Technical Leadership for Architectural Decision Making
baasie
3
590
AI Search: Where Are We & What Can We Do About It?
aleyda
0
8k
Test your architecture with Archunit
thirion
2
2.4k
Transcript
EXIA slme
whoami ・slme_not_found ・好きな言語: Rust / Kotlin ・ゲーム: MHW
~10日前の出来事~
None
_人人人人人人_ > 全員発表 <  ̄Y^Y^Y^Y^Y ̄
None
逃げました
ある会話が脳裏に浮かんだ
自作言語、自作エディタ、自作OSはエンジニアの夢
そして出来上がった
EXIA
None
None
エディタを作りました
EXIAの機能 ・vimと同じようにmodeを持つ ・vimと同じようなキーバインド ・ただのテキストエディタ ・クッソ効率が悪い
だがしかし...
_人人人人人人人人人人_ > マルチバイト文字 <  ̄Y^Y^Y^Y^Y^Y^Y^Y^Y ̄
マルチバイト文字 ・1 byteではない文字 ・全角ひらがな、漢字、カタカナとか ・矢印キーも ( ↑ => “\x1b[A” )
ターミナルのmode ・Cooked mode ・標準入力から入力されたデータをバッファリング ・Enter || EOFで送信 ・バッファリングされてるデータを編集できる ・Raw mode
・標準入力から入力されたデータをそのまま送信する
Rustのstdin function ・read ・read_to_string ・read_to_end ・read_exact
Raw modeとの相性がよろしくない
解決法 ・libcのgetcharを使って後続判定を作り適切に処理する ・read_to_stringを使って後続判定を作り適切に処理する (おそらくRaw modeならgetcharと変わらない(?)) ・cursesを使って最高の気分を得る
この時点で月曜日
curses !!!!
curses ・UNIX系システムの端末制御ライブラリ ・TUIアプリケーションの作成に使われる ・cursor optimizationが由来 ・Linux -> ncurses ・Windows ->
PDcurses
そして出来上がった
TRANS-AM
None
None
TRANS-AMの機能 ・vimと同じようにmodeを持つ ・vimと同じようなキーバインド ・ただのテキストエディタ ・ncursesで制御している
基本的な処理の流れ ・キーボードからの入力を監視 ( Raw mode ) ・その入力文字が何なのか、何を意味するかを解析 (Commandにparse) ・Commandを実行 ・実行後に端末に変更を反映
軽いデモ
これから ・軽い編集しかできないので、機能追加 ・突貫なのでバグが多いので修正 ・シンタックスハイライト欲しい ・ある程度の機能追加が終わり次第公開予定
まとめ
自作エディタはつらい
でも楽しい
ご清聴ありがとうございました