The Bedrock of Land: Native Backend & Service Host.
The RAM tax is not optional.
VS Codewith a medium project: 500 MB to 1.5 GB of RAM. Three open windows means threeChromiumrenderer processes, each carrying a full heap. Every OS interaction crosses a serialized JSON IPC pipe.
"Where Electron takes 200 ms to open a dialog, Mountain takes 2."
Welcome to Mountain ⛰️! This element is the native Rust backend and Tauri
application shell for the Land Code Editor. It serves as the foundational
bedrock for the entire system, managing the application lifecycle, orchestrating
native OS operations, and providing high-performance services to the Wind
frontend and the Cocoon extension host.
Mountain ⛰️ is engineered to:
- Be the Native Core: Act as the primary
Rustapplication, leveragingTaurito create a lightweight, cross-platform windowing andWebViewhost. - Provide High-Performance Services: Implement the abstract service
traits defined in theCommoncrate, offering native-speed implementations for filesystem I/O, process management, secure storage, and more. - Orchestrate Sidecars: Reliably launch, manage, and communicate with the
Cocoon(Node.js) extension host sidecar via a robustgRPCinterface. - Power the User Interface: Serve as the backend for the
Windlayer, responding to requests viaTauricommands and pushing state updates viaTaurievents.
- Declarative Effect System: Built on a
RustActionEffectsystem defined in theCommoncrate. Business logic is described as declarative, composable effects, executed by a centralApplicationRunTime. gRPC-Powered IPC: Hosts atonic-basedgRPCserver (Vine) to provide a strongly-typed, high-performance communication channel for theCocoonextension host.- Centralized State Management: Utilizes a thread-safe,
Tauri-managedApplicationStateas the single source of truth for the entire application's state, from open documents to provider registrations. - Native PTY Management: Implements a full-featured integrated terminal
service by spawning and managing native pseudo-terminals (
PTY) using theportable-ptycrate. - Secure Storage Integration: Leverages the native OS keychain via the
keyringcrate to securely store sensitive data like authentication tokens. - Robust Command Dispatching: A central
Trackdispatcher intelligently routes all incoming requests fromWindandCocoonto the appropriate nativeEnvironmentprovider orActionEffect.
| Principle | Description | Key Components |
|---|---|---|
| Implementation of Contracts | Implement the abstract service traits from Common, providing concrete logic for the application's architecture. |
Environment/* providers |
| Separation of Concerns | Isolate service logic into distinct Environment provider modules, each responsible for a specific domain (e.g., FileSystem, Documents). |
Environment/*, Command/* |
| Declarative Logic | Express complex operations as ActionEffects, executed by ApplicationRunTime - composable, testable, and robust. |
RunTime/*, Track/EffectCreation.rs, Common |
| Centralized State | Maintain a single, thread-safe ApplicationState struct managed by Tauri for data consistency across the entire application. |
ApplicationState/* |
| Secure & Performant IPC | Use gRPC for all communication with the Cocoon sidecar, ensuring a well-defined and high-performance API boundary. |
Vine/* |
| UI–Backend Decoupling | Interact with Wind exclusively through asynchronous Tauri commands and events, keeping the backend UI-agnostic. |
Binary.rs (invoke handler), Command/* |
To understand how Mountain's internal components are structured and how they
implement the application's core logic, see
Documentation/GitHub/DeepDive.md.
This document explains the roles of ApplicationRunTime, ApplicationState,
Handler, Environment, and the Vine gRPC layer.
This diagram illustrates Mountain's central role as the native orchestrator
for the entire Land application.
graph LR
classDef mountain fill:#f0d0ff,stroke:#9b59b6,stroke-width:2px,color:#2c0050;
classDef cocoon fill:#d0d8ff,stroke:#4a6fa5,stroke-width:2px,color:#001050;
classDef wind fill:#cce8ff,stroke:#2980b9,stroke-width:2px,color:#00304a;
classDef common fill:#d4f5d4,stroke:#27ae60,stroke-width:1px,stroke-dasharray:5 5,color:#0a3a0a;
classDef ipc fill:#fff3c0,stroke:#f39c12,stroke-width:1px,stroke-dasharray:5 5,color:#5a3e00;
subgraph "⛰️ Mountain - Native Rust/Tauri Backend"
TauriRuntime["🚀 Tauri App & Window"]:::mountain
ApplicationRunTime["⚡ ApplicationRunTime Engine"]:::mountain
ApplicationState["🗄️ ApplicationState - Shared State"]:::mountain
TrackDispatcher["🔀 Track Dispatcher"]:::mountain
VinegRPC["🌿 Vine - gRPC Server"]:::ipc
EnvironmentProviders["⚙️ Environment Providers"]:::mountain
CommonCrate["📐 Common Crate - Traits & DTOs"]:::common
TauriRuntime --> ApplicationState
TauriRuntime --> ApplicationRunTime
ApplicationRunTime --> EnvironmentProviders
TrackDispatcher --> ApplicationRunTime
end
subgraph "🖥️ Clients"
WindUI["🍃 Wind / Sky - UI WebView"]:::wind
CocoonSideCar["🦋 Cocoon - Extension Host (Node.js)"]:::cocoon
end
TauriRuntime -- hosts --> WindUI
WindUI -- Tauri Command --> TrackDispatcher
TrackDispatcher -- Tauri Events --> WindUI
VinegRPC <-- gRPC --> CocoonSideCar
VinegRPC -- forwards --> TrackDispatcher
EnvironmentProviders -. implements traits .-> CommonCrate
The Mountain repository is organized to clearly separate concerns, following
the architectural patterns defined in Common.
Mountain/
├── Source/
│ ├── Binary.rs # Tauri application entry point and setup.
│ ├── ApplicationState/ # Central, thread-safe state store and DTOs.
│ ├── Command/ # Tauri command handlers for UI-specific requests.
│ ├── Environment/ # Concrete implementations of Common provider traits.
│ ├── ExtensionManagement/ # Logic for scanning and parsing extensions.
│ ├── FileSystem/ # Native TreeView provider for the File Explorer.
│ ├── ProcessManagement/ # Logic for managing the Cocoon sidecar process.
│ ├── RunTime/ # The ApplicationRunTime engine that executes effects.
│ ├── Track/ # The central request dispatcher (EffectCreation).
│ ├── Update/ # Application self-updating logic.
│ ├── Vine/ # The gRPC server and client implementation (tonic).
│ └── Workspace/ # Logic for handling .code-workspace files.
├── Proto/
│ └── Vine.proto # The gRPC contract definition file.
└── build.rs # Build script to compile .proto into Rust code.
Mountain is a Rust crate and a core component of the main Land repository.
It is not intended to be built or run standalone. Please follow the instructions
in the main Land Repository README to
set up, build, and run the entire application.
Key Dependencies:
| Crate / Package | Purpose |
|---|---|
Common |
Local path dependency - abstract traits & DTOs |
Echo |
Local path dependency - work-stealing scheduler |
keyring |
Secure OS keychain access |
log & env_logger |
Structured logging |
portable-pty |
Cross-platform native PTY for integrated terminal |
serde & serde_json |
Serialization / deserialization |
tauri |
^2.x - windowing, WebView, command dispatch |
tokio |
Async runtime |
tonic |
gRPC server implementation |
This project is released into the public domain under the Creative Commons CC0
Universal license. You are free to use, modify, distribute, and build upon
this work for any purpose, without any restrictions. For the full legal text,
see the LICENSE file.
See CHANGELOG.md for a
history of changes specific to Mountain ⛰️.
Mountain ⛰️ is a core element of the Land 🏞️ ecosystem. This project is funded through NGI0 Commons Fund, a fund established by NLnet with financial support from the European Commission's Next Generation Internet program. Learn more at the NLnet project page.
The project is operated by PlayForm, based in Sofia, Bulgaria.
PlayForm acts as the open-source steward for Code Editor Land under the NGI0 Commons Fund grant.
| Land | PlayForm | NLnet | NGI0 Commons Fund |
|---|---|---|---|
|
|
|
|
|
Project Maintainers: Source Open (Source/Open@Editor.Land) | GitHub Repository | Report an Issue | Security Policy