What Programming Languages Are Used in Openwork? A Complete Technical Breakdown
Openwork primarily uses TypeScript for its frontend UI, server-side logic, and tooling, while leveraging Rust for performance-critical sandboxed execution, complemented by JavaScript, Shell, and JSON configuration files.
The different-ai/openwork repository is a polyglot codebase that blends high-level application logic with low-level systems programming. Understanding what programming languages are used in Openwork reveals a modern architecture optimized for both developer productivity and runtime security.
TypeScript: The Primary Language for Frontend and Backend
TypeScript dominates the Openwork codebase, serving as the main language for UI components, server APIs, and development tooling. This choice provides type safety across the entire application stack while maintaining JavaScript ecosystem compatibility.
UI Components and Frontend Architecture
The user interface layer relies heavily on TypeScript to render reactive components. In packages/ui/src/react/index.ts, the entry point initializes the React-based frontend, handling component registration and state management. The codebase utilizes modern frameworks like SolidJS (evidenced by createSignal usage) alongside React patterns to build interactive elements.
// TypeScript – creating a simple UI component
import { createSignal } from 'solid-js';
export function Counter() {
const [count, setCount] = createSignal(0);
return <button onClick={() => setCount(c => c + 1)}>{count()}</button>;
}
Server-Side API Implementation
The backend server implementation lives in apps/server/src/server.ts, where TypeScript handles HTTP routing, middleware chains, and business logic. Using TypeScript for the server ensures shared type definitions between frontend and backend, reducing serialization errors and improving API contract enforcement.
Test Suites and Evaluation Scripts
Quality assurance depends on TypeScript test specifications located under evals/specs/. Files like evals/specs/app-smoke.slow.test.ts contain integration tests that validate end-to-end workflows, leveraging TypeScript's static analysis to catch regressions before runtime.
Rust: Performance-Critical Sandbox Execution
While TypeScript handles the application layer, Openwork integrates Rust for security-sensitive, performance-critical operations. Specifically, the microsandboxed execution environment—responsible for running untrusted code safely—is implemented in Rust.
The example implementation in examples/microsandbox-openwork-rust/main.rs demonstrates how Rust manages memory-safe isolation:
// Rust – a minimal sandboxed worker
fn main() {
println!("Hello from the OpenWork microsandbox!");
}
This polyglot approach allows Openwork to maintain JavaScript/TypeScript developer ergonomics while benefiting from Rust's zero-cost abstractions and sandboxing capabilities for executing arbitrary user code.
Auxiliary Languages: JavaScript, Shell, and Configuration
Beyond the primary TypeScript and Rust components, Openwork utilizes several supporting languages for automation and configuration.
JavaScript Helper Scripts
Small utility scripts and legacy compatibility layers remain in plain JavaScript, particularly within the scripts/ directory. The file scripts/dev-headless-web.ts—though authored in TypeScript—compiles to JavaScript for direct Node.js execution during development workflows.
Build Automation and Shell Scripts
Shell scripts orchestrate the development environment and deployment pipelines. Commands like pnpm dev (defined in package.json but executed via shell) initialize the development server, while environment setup scripts automate dependency installation across the monorepo.
# Shell – launching the development server
pnpm dev
JSON and YAML Configuration
Project metadata and workspace definitions rely on JSON and YAML files. The root package.json manages dependency trees and npm scripts, while pnpm-workspace.yaml defines the monorepo structure. These declarative formats drive the build system without requiring executable code.
Summary
- TypeScript serves as the dominant language for Openwork's frontend UI (
packages/ui/src/react/index.ts), backend API (apps/server/src/server.ts), and test suites (evals/specs/). - Rust powers the microsandboxed execution environment (
examples/microsandbox-openwork-rust/main.rs) for secure, high-performance code isolation. - JavaScript appears in compiled helper scripts within the
scripts/directory for development automation. - Shell commands and JSON/YAML configuration files manage the build pipeline, dependencies, and workspace structure.
Frequently Asked Questions
Is Openwork built entirely in TypeScript?
No. While TypeScript constitutes the majority of the codebase—including the UI, server, and testing infrastructure—Openwork also uses Rust for the microsandbox component that executes untrusted code securely.
Where does Openwork use Rust instead of TypeScript?
Openwork uses Rust specifically in the examples/microsandbox-openwork-rust/main.rs file and related sandbox implementations, prioritizing Rust's memory safety and performance for running isolated code environments.
What build tools does Openwork use for its TypeScript code?
According to the repository structure, Openwork uses pnpm as its package manager (evidenced by pnpm-workspace.yaml and pnpm dev commands) along with standard TypeScript compilation pipelines that output JavaScript for Node.js execution.
Does Openwork contain any pure JavaScript source files?
Yes, though most logic is TypeScript, the repository includes JavaScript files primarily as compiled outputs or legacy helper scripts in the scripts/ folder, such as development utilities that run without TypeScript compilation overhead.
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 →