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
RustでPagerを作ってみた
Search
ryochack
November 26, 2018
Programming
1
940
RustでPagerを作ってみた
RustでpeepというlessのようなPagerツールを作ってみた話。
ryochack
November 26, 2018
Tweet
Share
More Decks by ryochack
See All by ryochack
Rustでチョット気軽にセンサドライバ開発
ryochack
2
3.5k
Other Decks in Programming
See All in Programming
CSC307 Lecture 15
javiergs
PRO
0
240
Claude Codeセッション現状確認 2026福岡 / fukuoka-aicoding-00-beacon
monochromegane
4
420
Rで始めるML・LLM活用入門
wakamatsu_takumu
0
180
DSPy入門 Pythonで実現する自動プロンプト最適化 〜人手によるプロンプト調整からの卒業〜
seaturt1e
1
710
How to stabilize UI tests using XCTest
akkeylab
0
120
AI Assistants for Your Angular Solutions
manfredsteyer
PRO
0
140
DevinとClaude Code、SREの現場で使い倒してみた件
karia
1
1k
AI駆動開発の本音 〜Claude Code並列開発で見えたエンジニアの新しい役割〜
hisuzuya
4
500
Fundamentals of Software Engineering In the Age of AI
therealdanvega
1
250
20260313 - Grafana & Friends Taipei #1 - Kubernetes v1.36 的開發雜記:那些困在 Alpha 加護病房太久的 Metrics
tico88612
0
180
CSC307 Lecture 13
javiergs
PRO
0
320
Go Conference mini in Sendai 2026 : Goに新機能を提案し実装されるまでのフロー徹底解説
yamatoya
0
580
Featured
See All Featured
Between Models and Reality
mayunak
2
230
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
110
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
1
320
Bash Introduction
62gerente
615
210k
Art, The Web, and Tiny UX
lynnandtonic
304
21k
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
110
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
140
Designing for humans not robots
tammielis
254
26k
Docker and Python
trallard
47
3.8k
Become a Pro
speakerdeck
PRO
31
5.8k
The Mindset for Success: Future Career Progression
greggifford
PRO
0
280
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
150
Transcript
RustでPagerを作ってみた RustのLT会! Rust入門者の集い #6 2018.11.26 @ryochack
About Me @ryochack 組み込みソフトウェア開発が仕事 システムプログラミング目当てでRust触り始めた 昨年、組み込みRustの同人誌書きました 2
RustでPager作ってみたという話 3
対象とする人 Rustが好きだ CUIが好きだ ケチ 節約が好きだ 記憶力が貧弱だ それ、tmuxやscreenでいいじゃん、って言わない人 4
Pager、使ってますよね less / more 呼吸をするように使うもの 5
でも、こんなことありませんか? 6
1. lessを起動する 2. lessでファイルを閲覧する 3. lessを終了する 4. lessで何を見ていたか忘れる 5. ※1に戻る
7
つらい 8
他のツールは… cat / less +X : ターミナルのバッファが必要以上に汚れる head / tail
: 見たい行がどこかわかってないといけない grep : マッチするものが多いとノイズが増える 9
要求 最後に見ていたものがそのままターミナルに残る ターミナルバッファを必要以上に汚さない lessのようなインタラクティブな閲覧ができる 10
peep https://github.com/ryochack/peep $ cargo install peep 11
peepの機能 指定行数内でのテキストファイル閲覧操作 Viライクなキーバンド tail -f / less +F モード 正規表現でのキーワード検索
Linux / MacOSサポート (Windowsでは動作しません) 12
Demo 13
peepの構成 14
知見(と苦しみ) 複数モジュールから参照するバッファ/Traitのハンドリング Borrow Checkerとの戦い… Rc<RefCell<xxx>> 便利だけど…? Unicode文字の表示幅のハンドリング Unicodeを取り扱うWGがある unicode-rs unicode-width
クレート ターミナル操作のテストに失敗する cargo test はデフォルトで並列テスト cargo test -- --test-threads=1 でスレッド数を1に 固定できる Shift_JISなどのUTF-8以外のファイルを入力すると死ぬ 15
まとめ CプログラマにとってRustはムズカシイ コンパイラが通ったあとの安心感がある Rustを書いてからCに戻るとつらい 16
ご清聴ありがとうございました This slide was generated by Marp 17