What Programming Languages Does Automattic Harper Use? A Code-Level Breakdown
Automattic Harper is built primarily in Rust for its core grammar-checking engine, with JavaScript and TypeScript powering the web interfaces, browser extensions, VS Code plugin, and Tauri desktop application.
Automattic Harper is an open-source grammar checker whose repository is organized as a multi-language workspace. If you are investigating what programming languages Automattic Harper uses, the answer centers on a robust Rust foundation paired with an extensive JavaScript and TypeScript ecosystem for user-facing tools. The architecture deliberately isolates performance-critical text analysis in Rust crates while delegating UI and integration logic to TypeScript frontends.
Rust Powers the Core Engine and CLI
The heart of Harper lives in Rust. According to the Automattic/harper source code, the workspace defines multiple crates—including harper-core, harper-ls, harper-cli, and harper-wasm—each anchored by a Cargo.toml file.
Key entry points include:
harper-core/Cargo.toml— the root grammar engine crate.harper-ls/src/main.rs— the language server binary.harper-cli/src/main.rs— the command-line interface.harper-wasm/src/lib.rs— the WebAssembly bridge.
You can install and run the CLI directly from the Rust source:
# Install the CLI (built from the Rust crate harper-cli)
cargo install --path harper-cli
# Lint a markdown file
harper-cli lint path/to/file.md
JavaScript and TypeScript Drive the UI and Extensions
All external-facing components rely on JavaScript or TypeScript. The documentation site is built with SvelteKit, browser extensions—including harper-chrome-plugin and harper-firefox-plugin—and the VS Code plugin are bundled with Vite, and the desktop client uses Tauri’s Rust backend with a Svelte/TypeScript frontend. Key files range from harper-chrome-plugin/src/manifest.json to harper-vscode-plugin/src/extension.ts.
WebAssembly and Node.js Integration
The harper-wasm crate compiles the Rust core to WebAssembly, exposing it through the harper.js wrapper. This lets Node.js and browser clients call the grammar engine without managing a native binary:
import { Linter } from "harper.js";
async function lintText(text: string) {
const linter = await Linter.create(); // loads the WASM module (Rust)
const results = await linter.lint(text); // returns lint diagnostics
console.log(results);
}
lintText("# Hello world\nThis is a test.");
VS Code Extension
The VS Code plugin is implemented in TypeScript. It interacts with the linter via a client abstraction defined in the desktop package:
import * as vscode from "vscode";
import { Client } from "harper-desktop/src/lib/client";
export function activate(context: vscode.ExtensionContext) {
const client = new Client();
vscode.workspace.onDidChangeTextDocument(async (e) => {
const diagnostics = await client.getDiagnostics(e.document.getText());
// Populate VS Code diagnostics...
});
}
Desktop Application and Documentation Site
The Tauri-based desktop app (harper-desktop) combines a Rust backend—declared in harper-desktop/src-tauri/Cargo.toml—with a frontend defined in files such as harper-desktop/src/lib/client.ts. Meanwhile, the documentation site is a SvelteKit TypeScript project; content pages such as packages/web/src/routes/docs/about/+page.md render Harper’s web presence.
Summary
- Rust is the primary language for Harper’s core grammar engine, CLI (
harper-cli), language server (harper-ls), and WebAssembly bridge (harper-wasm). - JavaScript and TypeScript power all user-facing integrations, including the VS Code extension, browser extensions, SvelteKit documentation site, and Tauri desktop frontend.
- The project follows a clear architectural boundary: Rust handles performance-critical linting, while TypeScript manages UI and IDE bindings.
Frequently Asked Questions
Is Automattic Harper written entirely in Rust?
No. While the grammar engine, language server, CLI, and WebAssembly bridge are written in Rust, significant portions of the project are implemented in JavaScript and TypeScript. The VS Code extension, browser plugins, documentation site, and Tauri desktop frontend are all built with TypeScript.
What framework does Harper use for its web documentation?
Harper uses SvelteKit, a TypeScript-based framework, for its web documentation site and demo. Source content is authored in Markdown and served from paths such as packages/web/src/routes/docs/about/+page.md.
Can I use Harper in a JavaScript or TypeScript project?
Yes. The harper-wasm crate compiles the Rust core to WebAssembly, which is distributed through the harper.js package. You can instantiate a Linter, load the WASM module asynchronously, and lint strings directly in Node.js or the browser.
What is the desktop client built with?
The desktop client is a Tauri application. It uses Rust for the backend process and Svelte with TypeScript for the frontend UI layer. Key files include harper-desktop/src-tauri/Cargo.toml for the Rust side and harper-desktop/src/lib/client.ts for the frontend client logic.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →