
「送り仮名を無視する言語」のために Language Server を作った話 ― 日本語プログラミング言語 Mind の VS Code 拡張Building a Language Server for a Language That Ignores Okurigana: A VS Code Extension for the Japanese Language Mind
日本語プログラミング言語 Mind 向けの VS Code 拡張と Language Server を開発し、構文の対応ミスや未定義語、定義前参照を診断できるようにした。Mind やDockerの導入は不要で、実コンパイラ検査も任意で使える。
A VS Code extension and Language Server for the Japanese programming language Mind diagnoses mismatched syntax, undefined words and use-before-definition, with no Mind or Docker install needed. Optional real-compiler checks help Mind developers.
AI 生成の要約と解説(解説は要約と収集メタデータに基づく)で、元記事全文の転載・翻訳ではありません。日本語版と英語版は言語ごとに独立して生成しています。正確性は元記事 (qiita.com) でご確認ください。AI-generated summary and explainer (the latter based on the summaries and collected metadata), not a copy or translation of the full source article. Generated independently for each language. Verify accuracy at the original source (qiita.com).
日本語言語 Mind と拡張の登場
日本語プログラミング言語 Mind のソースコードを VS Code で書けるようにする拡張機能と Language Server が作られた。Mind は株式会社スクリプツ・ラボが開発している言語で、一般的な言語向けの Language Server の作り方がそのままでは通用しない「少し変わった言語」だと説明されている。
筆者は、Mind の作者である killy さんと以前同じ会社で働いていた。Mind 9 のリリース発表のビデオチャットの案内を受けたことがきっかけで Mind への関心が高まり、この拡張の開発に至ったという。
診断機能と導入の手軽さ
拡張が提供する診断は、構文の対応ミス、未定義の単語、定義より前での参照などを対象とする。コンパイルで取り込むファイルもまとめて検査できる。
Mind のインストールも Docker も不要で、拡張を入れればすぐに動く。そのうえで、本物のコンパイラによる検査をオプションで使うこともできる。記事では、この本物のコンパイラで答え合わせをした結果、何が分かったかも扱うとされている。
「ひらがなで読める」コードの例
記事では、買い物の合計を計算するプログラムが例として示されている。「税込みで」を表示し、合計を税込みにして数値表示し、「円です」を一行表示する、という内容だ。プログラミングの知識がなくても、何をしているかは大体読めるとされる。
文法の要点も示されている。「〇〇とは」で新しい言葉を定義し、「メインとは」から実行が始まる。「120円」の「円」や「3個」の「個」は読みやすさのための飾りで、コンパイラは数字だけを見る。タイトルにある「送り仮名を無視する言語」という表現は、こうした性質を指すものと考えられるが、記事の冒頭部分ではこの点の詳細までは述べられていない。
後置記法という土台
Mind は値をスタックに積み、後から操作を書く「後置記法」の言語で、Forth の系譜にあたると説明されている。この性質が、一般的な言語向けの Language Server の手法をそのまま適用しにくい理由の一端になっていると考えられる。
なお、この記事は実装編という位置づけである。「AI がコードを書く時代に、日本語で読めるコードにどんな意味があるのか」という論点は、考察編として別の記事にまとめる予定とのことだ。
Mind の VS Code 拡張
This article describes a VS Code extension and Language Server built for Mind, a Japanese programming language developed by Scripts Lab Inc. (株式会社スクリプツ・ラボ). It matters because, according to the author, Mind is unusual enough that the standard approach to building a Language Server for an ordinary language did not work as-is. The piece is the implementation write-up; a separate essay on what Japanese-readable code means in the age of AI-written code is planned.
The author says the project began after an invitation from Scripts Lab to a video chat about the release of Mind 9. The author had once worked at the same company as Mind's creator, killy, and became increasingly enthusiastic about the language.
診断と導入のしやすさ
The extension reports diagnostics for mismatched syntax, undefined words and references that appear before their definition. It also examines files pulled in through compilation together. According to the author, it works as soon as the extension is installed, with no need to install Mind or Docker. Checking against the real compiler is available as an optional feature.
変わった言語 Mind
The author describes Mind as a somewhat unusual language and says the article covers how those peculiarities were turned into implementation, and what was learned when the results were checked against the real compiler.
The sample shown is a shopping-total program. It uses the form 〇〇とは to define a new word, and execution begins from メインとは. Lines such as 「税込みで」を 表示し and 「円です」を 一行表示すること read close to natural Japanese, so the author suggests that even someone with no programming background can roughly follow what it does.
送り仮名と後置記法
Some of the text in the code is decoration. In 120円 and 3個, the 円 and 個 are there for readability, and the compiler looks only at the numbers. This is the kind of behavior that sets Mind apart from conventional languages.
Mind is also a postfix-notation language: values are pushed onto a stack, and the operations that act on them are written afterward. The author places it in the lineage of Forth. The source gives no further detail on how each of these traits was implemented in the Language Server or what the comparison with the real compiler revealed, so those points are left to the full article.
ポコとTECHガイドPoko & TECH Guide
ポコと当サイトのTECHガイドが、記事の要約と収集した情報から読みどころを語るAI生成の対話です。Poko and TECH Dashboard's own TECH Guide discuss the article's highlights in an AI-generated conversation based on its summary and collected source details.
- ポコPokoMindでコードを書く人は、これで普段の作業がどう変わるの?If someone writes code in Mind, what changes in their day-to-day work?
- TECHガイドTECH GuideVS Codeで書きながら、構文の対応ミスや未定義の単語、定義前の参照を診断してくれるよ。Mindも Dockerも入れずに、拡張だけで動くんだ。VS Code can flag mismatched syntax, undefined words, and use-before-definition while you write. You don't need Mind or Docker installed; the extension alone works.
- ポコPoko前は、こういうチェックってできなかったの?So you couldn't get these checks before?
- TECHガイドTECH Guide以前の状況は、この記事では分からないな。ただ今回は、取り込むファイルもまとめて見られるし、本物のコンパイラでの検査も任意で使えると書いてあるよ。The article doesn't say how it was before. But this one also checks the files you pull in, and optional checks with the real compiler are available.
- ポコPokoじゃあ一番の収穫は、入れてすぐ使えて、必要なら本物のコンパイラでも確かめられることかな?So the big win is that it works right after install, and you can verify with the real compiler if you want?
- TECHガイドTECH Guideいいまとめだね。次は、普通の言語向けの作り方が通用しなかったMindの「変わったところ」を、どう実装したかに注目だよ。Nicely put. Next, look at how Mind's quirks, which ordinary Language Server approaches couldn't handle as-is, were turned into an implementation.
匿名の公開いいねです。記事の保存・お気に入りではなく、Featured、Top 3、重要度、掲載順位には影響しません。仕組みとプライバシーAnonymous public likes are reactions, not saved articles or bookmarks. They do not affect Featured, Top 3, importance, or listing order.How it works and privacy





