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
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
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
2k
How GitHub (no longer) Works
holman
316
150k
Reality Check: Gamification 10 Years Later
codingconduct
0
2.3k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.9k
Automating Front-end Workflow
addyosmani
1369
210k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
35
2.9k
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
380
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
500
What does AI have to do with Human Rights?
axbom
PRO
1
2.4k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.3k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.6k
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
560
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を実行 ・実行後に端末に変更を反映
軽いデモ
これから ・軽い編集しかできないので、機能追加 ・突貫なのでバグが多いので修正 ・シンタックスハイライト欲しい ・ある程度の機能追加が終わり次第公開予定
まとめ
自作エディタはつらい
でも楽しい
ご清聴ありがとうございました