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
TableGenの言語サーバーをつくる
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Arata
December 02, 2023
610
0
Share
TableGenの言語サーバーをつくる
Arata
December 02, 2023
More Decks by Arata
See All by Arata
LLVMのDSL”TableGen”向け言語サーバーの開発
arata_nvm
0
9
5分でわかるPage-Fault Weird Machine
arata_nvm
1
140
eBPFを用いたAndroid向けデバッガ「eDBG」のx86_64 Linuxへの移植
arata_nvm
0
12
Pythonのcopy-and-patch JITの実装を読む
arata_nvm
0
110
eBPFを使った動的解析手法
arata_nvm
1
700
カーネルハック実験の振り返り
arata_nvm
1
48
Improving LLVM Backend Development with a New TableGen Language Server
arata_nvm
0
44
コードエディターのシンタックスハイライトの話
arata_nvm
0
200
LLVMのコード自動生成機構におけるコード記述を支援するツールの作成
arata_nvm
0
90
Featured
See All Featured
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
120
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
55k
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
160
Test your architecture with Archunit
thirion
1
2.2k
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
280
Producing Creativity
orderedlist
PRO
348
40k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
230
Practical Orchestrator
shlominoach
191
11k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.6k
Utilizing Notion as your number one productivity tool
mfonobong
4
280
Music & Morning Musume
bryan
47
7.1k
Transcript
TableGenの言語サーバーをつくる 2023/12/02 Kernel/VM探検隊@北陸 Part 6 @Arata
2023/12/02 TableGenの言語サーバーを作る @arata-nvm TableGenとは • コンパイラ基盤LLVMの内部で使用されているDSL • レジスタや命令など、ターゲットマシン固有の情報を 記述するために用いられることが多い 2
2023/12/02 TableGenの言語サーバーを作る @arata-nvm https://github.com/llvm/llvm-project/blob/1c822e1e8278ebefdb7701249bdfe51f1ed03d7d/llvm/lib/Target/X86/X86RegisterInfo.td#L163-L184 例: TableGenでX86のレジスタを記述 3
2023/12/02 TableGenの言語サーバーを作る @arata-nvm TableGen嫌われがち問題 4
2023/12/02 TableGenの言語サーバーを作る @arata-nvm • エディタの支援を受けられない • C++と組み合わせてのビルドに手間がかかる • 情報が少ない なぜTableGenは嫌われているのか
5
2023/12/02 TableGenの言語サーバーを作る @arata-nvm • エディタの支援を受けられない • C++と組み合わせてのビルドに手間がかかる • 情報が少ない なぜTableGenは嫌われているのか
6
2023/12/02 TableGenの言語サーバーを作る @arata-nvm 2022年5月から言語サーバーが実装され始める 今日までに実装された機能: • シンタックスハイライト • エラー表示 •
定義へ移動 • 参照へ移動 • ホバー表示 エディタ支援の現状 7
2023/12/02 TableGenの言語サーバーを作る @arata-nvm • 言語サーバーの応答性が悪い • 一部のコードで支援機能を提供できない • 内部実装が言語サーバー向きではない 現状の言語サーバーの問題点
8
TableGenの言語サーバーをつくる 2023/12/02 Kernel/VM探検隊@北陸 Part 6 @Arata [再掲]
2023/12/02 TableGenの言語サーバーを作る @arata-nvm 現在は以下の機能が使用できる • エラーの表示 • シンタックスハイライト • 定義へ移動
• 参照へ移動 • ホバー表示 • 入力補完 • インレイヒント 実装した機能 10
2023/12/02 TableGenの言語サーバーを作る @arata-nvm エラーの表示 11
2023/12/02 TableGenの言語サーバーを作る @arata-nvm シンタックスハイライト 12
2023/12/02 TableGenの言語サーバーを作る @arata-nvm 定義へ移動/参照へ移動 13
2023/12/02 TableGenの言語サーバーを作る @arata-nvm ホバー時のドキュメント表示 14
2023/12/02 TableGenの言語サーバーを作る @arata-nvm 入力補完 15
2023/12/02 TableGenの言語サーバーを作る @arata-nvm インレイヒント 16
2023/12/02 TableGenの言語サーバーを作る @arata-nvm • TableGenのすべての構文を処理できるようにする ◦ たとえば現在はinclude文やforeach文などを無視している • 使い勝手を改善する ◦
補完候補が表示される順番の最適化、型チェックなど • 言語サーバーのWASM化 ◦ 現在はプラットフォームごとのバイナリをバンドルしている 今後の展望 17
2023/12/02 TableGenの言語サーバーを作る @arata-nvm TableGenへの不平不満を募集しています おわりに 18
2023/12/02 TableGenの言語サーバーを作る @arata-nvm TableGenへの不平不満を募集しています おわりに 19 tablegen-lspで VSCode拡張を公開しています