# What Programming Language Is Automattic/Harper Written In?

> Discover the programming languages behind Automattic/Harper. Explore Rust for the core engine and TypeScript/JavaScript for extensions and the UI.

- Repository: [Automattic/harper](https://github.com/Automattic/harper)
- Tags: getting-started
- Published: 2026-07-26

---

**Automattic Harper is primarily written in Rust for its core grammar-checking engine, while TypeScript and JavaScript power the browser extensions, VS Code plugin, web interface, and desktop application.**

Automattic Harper is a multi-language grammar checker designed for developers. While the repository contains components in several languages, the performance-critical core logic is implemented in Rust, with TypeScript providing the integration layers for various platforms and user interfaces.

## The Rust Foundation: Core Engine and Tools

The heart of Harper resides in several Rust crates that handle text parsing, linting rules, and Language Server Protocol (LSP) implementation.

### Core Engine (harper-core)

The primary grammar-checking logic lives in `harper-core`, defined in [[`harper-core/Cargo.toml`](https://github.com/Automattic/harper/blob/main/harper-core/Cargo.toml)](https://github.com/Automattic/harper/blob/master/harper-core/Cargo.toml). This crate contains the tokenization algorithms, dictionary management, and linting rules that analyze text for grammatical errors.

### Command-Line Interface

The `harper-cli` crate provides a standalone Rust binary for linting files from the terminal. The entry point is located at [[`harper-cli/src/main.rs`](https://github.com/Automattic/harper/blob/main/harper-cli/src/main.rs)](https://github.com/Automattic/harper/blob/master/harper-cli/src/main.rs).

Install and run the CLI directly from the Rust source:

```bash

# 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

```

### Language Server Protocol (LSP)

Harper implements the Language Server Protocol in the `harper-ls` crate, with its main entry point at [[`harper-ls/src/main.rs`](https://github.com/Automattic/harper/blob/main/harper-ls/src/main.rs)](https://github.com/Automattic/harper/blob/master/harper-ls/src/main.rs). This Rust component enables real-time grammar checking in editors that support LSP, such as Neovim and Emacs.

## TypeScript and JavaScript: User Interfaces and Integrations

While Rust powers the backend, Harper exposes its functionality to web and desktop environments through TypeScript and JavaScript wrappers.

### WebAssembly Bridge

The `harper-wasm` crate compiles the Rust core to WebAssembly, allowing JavaScript environments to invoke the grammar engine. The bindings are defined in [[`harper-wasm/src/lib.rs`](https://github.com/Automattic/harper/blob/main/harper-wasm/src/lib.rs)](https://github.com/Automattic/harper/blob/master/harper-wasm/src/lib.rs).

Use Harper in Node.js via the JavaScript wrapper:

```typescript
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.");

```

### Browser Extensions

The Chrome and Firefox extensions are built with TypeScript and bundled via Vite. The Chrome extension configuration is located at [[`harper-chrome-plugin/manifest.json`](https://github.com/Automattic/harper/blob/main/harper-chrome-plugin/manifest.json)](https://github.com/Automattic/harper/blob/master/harper-chrome-plugin/manifest.json), with source files written in TypeScript to interface with browser APIs.

### VS Code Extension

The official Visual Studio Code extension is implemented in TypeScript at [[`harper-vscode-plugin/src/extension.ts`](https://github.com/Automattic/harper/blob/main/harper-vscode-plugin/src/extension.ts)](https://github.com/Automattic/harper/blob/master/harper-vscode-plugin/src/extension.ts). It communicates with the Harper language server to provide inline diagnostics and code actions.

```typescript
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

The `harper-desktop` package is a Tauri application that combines a Rust backend with a Svelte/TypeScript frontend. The Rust backend configuration resides in [[`harper-desktop/src-tauri/Cargo.toml`](https://github.com/Automattic/harper/blob/main/harper-desktop/src-tauri/Cargo.toml)](https://github.com/Automattic/harper/blob/master/harper-desktop/src-tauri/Cargo.toml), while the frontend client logic is implemented in [[`harper-desktop/src/lib/client.ts`](https://github.com/Automattic/harper/blob/main/harper-desktop/src/lib/client.ts)](https://github.com/Automattic/harper/blob/master/harper-desktop/src/lib/client.ts).

### Documentation Site

The web documentation and demo site use SvelteKit, a TypeScript-based framework. Content files like [`packages/web/src/routes/docs/about/+page.md`](https://github.com/Automattic/harper/blob/master/packages/web/src/routes/docs/about/+page.md) demonstrate the TypeScript-heavy nature of the project's web presence.

## Architecture Overview: How the Components Interact

Harper follows a polyglot architecture where Rust handles CPU-intensive text analysis while TypeScript manages platform-specific integrations. The WebAssembly bridge (`harper-wasm`) serves as the critical link, allowing browser extensions and Node.js applications to execute Rust-compiled logic without native bindings.

This separation ensures that the grammar rules and parsing algorithms remain performant and portable, while the user-facing components can leverage the extensive JavaScript ecosystem for UI development.

## Summary

- **Automattic Harper is written primarily in Rust**, with the core grammar engine residing in `harper-core` and supporting CLI/LSP tools in `harper-cli` and `harper-ls`.
- **TypeScript powers the integration layer**, including browser extensions, the VS Code plugin, the Tauri desktop app, and the documentation site.
- **WebAssembly bridges the gap**, compiled via `harper-wasm` to enable JavaScript environments to consume Rust logic.
- Key Rust entry points include [[`harper-core/Cargo.toml`](https://github.com/Automattic/harper/blob/main/harper-core/Cargo.toml)](https://github.com/Automattic/harper/blob/master/harper-core/Cargo.toml), [[`harper-cli/src/main.rs`](https://github.com/Automattic/harper/blob/main/harper-cli/src/main.rs)](https://github.com/Automattic/harper/blob/master/harper-cli/src/main.rs), and [[`harper-ls/src/main.rs`](https://github.com/Automattic/harper/blob/main/harper-ls/src/main.rs)](https://github.com/Automattic/harper/blob/master/harper-ls/src/main.rs).
- Key TypeScript files include [[`harper-vscode-plugin/src/extension.ts`](https://github.com/Automattic/harper/blob/main/harper-vscode-plugin/src/extension.ts)](https://github.com/Automattic/harper/blob/master/harper-vscode-plugin/src/extension.ts) and [[`harper-desktop/src/lib/client.ts`](https://github.com/Automattic/harper/blob/main/harper-desktop/src/lib/client.ts)](https://github.com/Automattic/harper/blob/master/harper-desktop/src/lib/client.ts).

## Frequently Asked Questions

### Is Harper written entirely in Rust?

No, while the grammar-checking engine and LSP implementation are written in Rust, Harper includes substantial TypeScript code for browser extensions, the VS Code plugin, and the desktop application frontend. The project uses a hybrid approach with Rust for performance-critical logic and TypeScript for platform integrations.

### Why does Harper use Rust for the core engine?

Rust provides memory safety and high performance without garbage collection, making it ideal for text processing tasks that require low latency. The `harper-core` crate implements complex parsing algorithms and dictionary lookups that benefit from Rust's zero-cost abstractions and deterministic memory management.

### Can I use Harper in a JavaScript or TypeScript project?

Yes. The `harper-wasm` crate compiles the Rust core to WebAssembly, exposing the linter through the [`harper.js`](https://github.com/Automattic/harper/blob/main/harper.js) package. You can instantiate the `Linter` class in Node.js or browser environments to check text programmatically without installing native binaries.

### What is the harper-ls crate used for?

The `harper-ls` crate implements the Language Server Protocol (LSP) in Rust, located at [[`harper-ls/src/main.rs`](https://github.com/Automattic/harper/blob/main/harper-ls/src/main.rs)](https://github.com/Automattic/harper/blob/master/harper-ls/src/main.rs). It provides real-time diagnostic support for editors that communicate via LSP, enabling features like hover information, quick fixes, and inline error highlighting in compatible development environments.