Skip to content

Commit 423d6f5

Browse files
hyperpolymathclaude
andcommitted
docs: Linguist classification + Language Identity roadmap section
Two connected changes resolving the ".twasm files show up as blank text to GitHub Linguist" problem: .gitattributes: - Add *.twasm mapping to WebAssembly via linguist-language override, so the six example .twasm files classify deterministically on GitHub instead of being heuristic-guessed as C/C++/JavaScript based on their // comment prefix. - Add previously-missing *.zig, *.idr, *.idr2, *.ipkg entries so Zig FFI code and Idris2 ABI code also classify correctly. ROADMAP.adoc: - New "Language Identity & Linguist Classification" section documenting the current .twasm=WebAssembly override, the rationale (Linguist has no Typed WebAssembly entry), and the path to a distinct Linguist submission at v1.0. Includes the list of preconditions for upstream Linguist submission: stable tree-sitter grammar, adoption evidence, nesting-vs-top-level decision, PR cycle. - New adjacent-tooling section identifying that the grammar port, the tree-sitter repo, the LSP server, the editor plugins, and the Linguist submission all share a single blocker (porting spec/grammar.ebnf to tree-sitter), so they're recorded together. - Cross-references added from the Future section to the new Language Identity section so scattered TODOs no longer look independent. Trade-off noted: claiming WebAssembly in .gitattributes under-claims the typed-ness (readers see WebAssembly, not Typed WebAssembly). Acceptable for a pre-alpha research repo; unacceptable at v1.0. The roadmap section captures the upgrade path. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent a47c1c4 commit 423d6f5

2 files changed

Lines changed: 78 additions & 2 deletions

File tree

.gitattributes

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,15 @@
1919
*.a2ml text eol=lf linguist-language=TOML
2020
*.ncl text eol=lf
2121
*.nix text eol=lf
22+
*.zig text eol=lf
23+
*.idr text eol=lf linguist-language=Idris
24+
*.idr2 text eol=lf linguist-language=Idris
25+
*.ipkg text eol=lf linguist-language=Idris
26+
27+
# .twasm is typed-wasm's surface syntax. Upstream Linguist has no
28+
# "Typed WebAssembly" entry, so for now we claim WebAssembly to keep
29+
# the language bar honest. See ROADMAP "Language Identity" section.
30+
*.twasm text eol=lf linguist-language=WebAssembly
2231

2332
# Docs
2433
*.md text eol=lf diff=markdown

ROADMAP.adoc

Lines changed: 69 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,75 @@ Known audit constraints:
7272
* [ ] De-template release/build/container surfaces
7373
* [ ] Real benchmark and aspect-test evidence
7474

75+
== Language Identity & Linguist Classification
76+
77+
typed-wasm is *a type discipline over WebAssembly*, not a separate bytecode
78+
format. The `.twasm` surface syntax elaborates to standard WASM modules after
79+
the L1--L10 checks fire. This shapes how the project should be classified by
80+
external tooling (GitHub Linguist, tree-sitter, LSP clients, editor plugins).
81+
82+
=== Current classification (v0.1.x)
83+
84+
* `.gitattributes` maps `*.twasm` to `linguist-language=WebAssembly` via an
85+
override. Rationale: Linguist has no "Typed WebAssembly" entry, and without
86+
the override Linguist runs content heuristics on files that start with `//`
87+
comments -- producing nondeterministic misclassification (C, C++, JavaScript,
88+
or plain Text). The override guarantees `.twasm` files are counted as
89+
WebAssembly in the GitHub language bar and keeps the repo's external
90+
fingerprint stable.
91+
* Trade-off: this *under-claims* the typed-ness. A reader browsing GitHub sees
92+
"WebAssembly" and has no cue that the files encode a 10-level type
93+
discipline. That is acceptable for a pre-alpha research repo; it is not
94+
acceptable at v1.0.0.
95+
96+
=== Path to distinct Linguist language (v1.0+)
97+
98+
Submitting "Typed WebAssembly" as a first-class Linguist language requires
99+
several preconditions that we do not yet meet:
100+
101+
* [ ] Stable `.twasm` grammar beyond EBNF. Linguist accepts TextMate grammars
102+
(`.tmLanguage.json`) or references to published tree-sitter grammars. Neither
103+
exists yet. Blocker: port `spec/grammar.ebnf` to one of these formats.
104+
* [ ] `tree-sitter-twasm` repository with a published grammar and sample
105+
corpus. Required for editor tooling and also the cleanest input to a
106+
Linguist submission.
107+
* [ ] Evidence of adoption. Linguist's contribution policy requires a language
108+
be in "actual use" -- historically interpreted as a few hundred public repos
109+
with non-trivial content. A research repo with six example files will not
110+
clear this bar; seeding the estate to manufacture adoption is also not
111+
acceptable and will be noticed.
112+
* [ ] A settled answer on whether "Typed WebAssembly" should be a top-level
113+
language or nested under WebAssembly as a `group`. Nesting is the honest
114+
choice -- typed-wasm is a conservative extension and its artefacts remain
115+
valid WASM -- and it preserves the existing language bar semantics.
116+
* [ ] PR against `github-linguist/linguist` adding the language entry, sample
117+
files, and grammar reference. Expect multiple review cycles.
118+
119+
Tracking: this is tied to the v1.0.0 "Complete `.twasm` parser" milestone. The
120+
parser, the tree-sitter grammar, and the Linguist submission are the same
121+
piece of work viewed from three angles.
122+
123+
=== Adjacent language-tooling work (same precondition chain)
124+
125+
* [ ] `tree-sitter-twasm` -- grammar, parser, published NPM package
126+
* [ ] LSP server (`twasm-lsp`) -- diagnostics surfacing L1--L10 checks as
127+
editor squiggles rather than batch compiler errors
128+
* [ ] TextMate / VS Code syntax-highlight extension built from the tree-sitter
129+
grammar
130+
* [ ] Editor plugins: Helix, Zed, Neovim, Emacs (all derive from the
131+
tree-sitter grammar once it exists)
132+
* [ ] Browser-side `.twasm` validation tooling (requires a parser implementation
133+
reachable from JS/WASM)
134+
135+
These items are currently scattered under "Future" and v1.0.0; the common
136+
blocker is the grammar port, which should be scheduled before any of them.
137+
75138
== Future
76139

77140
* GraalVM compile-time guarantees replacing runtime InteropLibrary dispatch
78-
* Browser-side `.twasm` validation tooling
79-
* Language server protocol support for `.twasm` files
141+
* Browser-side `.twasm` validation tooling (see Language Identity section;
142+
depends on tree-sitter-twasm)
143+
* Language server protocol support for `.twasm` files (see Language Identity
144+
section; depends on tree-sitter-twasm)
145+
* Linguist upstream submission (see Language Identity section; depends on
146+
grammar port and adoption evidence)

0 commit comments

Comments
 (0)