# neoomir/neomir architecture

> Architecture diagram of the GitHub repository neoomir/neomir, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/neoomir/neomir
- Repository: https://github.com/neoomir/neomir

## Overview

NeoMir is a desktop robot-programming environment: users edit a program, run or step it, and observe the robot or turtle in an editable field, with output in the console. The language pipeline tokenizes and parses source into an AST, then compiles it to a virtual machine that operates on the field. The application also provides editor preferences and plugin management, including a Unix-socket IPC server. The README is empty; relationships below rely on shown excerpts and SOURCE INDEX references, so unsampled integrations are not inferred.

Main entry points: [`src/ui/app_window.rs`](https://github.com/neoomir/neomir/blob/main/src/ui/app_window.rs) (Main window), [`src/plugins/ipc.rs`](https://github.com/neoomir/neomir/blob/main/src/plugins/ipc.rs) (IPC server), [`src/ui/settings_dialog.rs`](https://github.com/neoomir/neomir/blob/main/src/ui/settings_dialog.rs) (Settings dialog), [`src/lang/mod.rs`](https://github.com/neoomir/neomir/blob/main/src/lang/mod.rs) (Language compiler)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Desktop interface"]
  node_startup["Application startup<br/>[main.rs]"]
  node_window["Main window<br/>[app_window.rs]"]
  node_editor["Code editor<br/>[editor_view.rs]"]
  node_console["Console<br/>[console_view.rs]"]
  node_settings["Settings dialog<br/>[settings_dialog.rs]"]
  node_shortcuts["Keybindings<br/>[keybindings.rs]"]
  node_theme["Editor themes<br/>[theme.rs]"]
  node_vim["Vim controls<br/>[vim_mode.rs]"]
end

subgraph group_language["Language runtime"]
  node_compiler["Language compiler<br/>[mod.rs]"]
  node_lexer["Lexer<br/>[token.rs]"]
  node_parser["Parser<br/>[parser.rs]"]
  node_ast["Syntax tree<br/>[ast.rs]"]
  node_vm["Virtual machine<br/>[vm.rs]"]
end

subgraph group_simulation["Robot simulation"]
  node_field["Robot field state<br/>[robot.rs]"]
  node_fieldview["Field view<br/>[field_view.rs]"]
end

subgraph group_extensions["Extensions and IPC"]
  node_pluginmgr["Plugin management<br/>[mod.rs]"]
  node_pluginengine["Plugin engine<br/>[engine.rs]"]
  node_ipc["IPC server<br/>[ipc.rs]"]
end

node_user(("User"))

node_user -->|"launches"| node_startup
node_startup -->|"opens"| node_window
node_window -->|"hosts"| node_editor
node_window -->|"hosts"| node_console
node_window -->|"hosts"| node_fieldview
node_window -->|"compiles source"| node_compiler
node_compiler -->|"tokenizes with"| node_lexer
node_compiler -->|"parses with"| node_parser
node_compiler -->|"compiles AST"| node_vm
node_parser -->|"consumes tokens"| node_lexer
node_parser -->|"builds"| node_ast
node_vm -->|"compiles"| node_ast
node_vm -->|"executes commands"| node_field
node_window -->|"steps execution"| node_vm
node_fieldview -->|"renders and edits"| node_field
node_window -->|"controls field"| node_field
node_window -->|"opens"| node_settings
node_settings -->|"configures"| node_shortcuts
node_settings -->|"configures"| node_editor
node_editor -->|"applies"| node_theme
node_editor -->|"delegates key input"| node_vim
node_window -->|"starts server"| node_ipc
node_ipc -->|"dispatches robot actions"| node_field
node_ipc -->|"requests redraw"| node_fieldview
node_ipc -->|"interacts with"| node_console
node_settings -->|"manages plugins"| node_pluginmgr
node_pluginmgr -->|"delegates management"| node_pluginengine
node_pluginengine -->|"uses IPC"| node_ipc

click node_startup "https://github.com/neoomir/neomir/blob/main/src/main.rs"
click node_window "https://github.com/neoomir/neomir/blob/main/src/ui/app_window.rs"
click node_editor "https://github.com/neoomir/neomir/blob/main/src/ui/editor_view.rs"
click node_console "https://github.com/neoomir/neomir/blob/main/src/ui/console_view.rs"
click node_settings "https://github.com/neoomir/neomir/blob/main/src/ui/settings_dialog.rs"
click node_shortcuts "https://github.com/neoomir/neomir/blob/main/src/ui/keybindings.rs"
click node_theme "https://github.com/neoomir/neomir/blob/main/src/ui/theme.rs"
click node_vim "https://github.com/neoomir/neomir/blob/main/src/ui/vim_mode.rs"
click node_compiler "https://github.com/neoomir/neomir/blob/main/src/lang/mod.rs"
click node_lexer "https://github.com/neoomir/neomir/blob/main/src/lang/token.rs"
click node_parser "https://github.com/neoomir/neomir/blob/main/src/lang/parser.rs"
click node_ast "https://github.com/neoomir/neomir/blob/main/src/lang/ast.rs"
click node_vm "https://github.com/neoomir/neomir/blob/main/src/lang/vm.rs"
click node_field "https://github.com/neoomir/neomir/blob/main/src/robot.rs"
click node_fieldview "https://github.com/neoomir/neomir/blob/main/src/ui/field_view.rs"
click node_pluginmgr "https://github.com/neoomir/neomir/blob/main/src/plugins/mod.rs"
click node_pluginengine "https://github.com/neoomir/neomir/blob/main/src/plugins/engine.rs"
click node_ipc "https://github.com/neoomir/neomir/blob/main/src/plugins/ipc.rs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_startup,node_window,node_editor,node_console,node_settings,node_shortcuts,node_theme,node_vim,node_user toneBlue
class node_compiler,node_lexer,node_parser,node_ast,node_vm toneAmber
class node_field,node_fieldview toneMint
class node_pluginmgr,node_pluginengine,node_ipc toneRose
```

## Components

### Desktop interface

- [Application startup](https://github.com/neoomir/neomir/blob/main/src/main.rs): `src/main.rs`
- [Main window](https://github.com/neoomir/neomir/blob/main/src/ui/app_window.rs): `src/ui/app_window.rs`
- [Code editor](https://github.com/neoomir/neomir/blob/main/src/ui/editor_view.rs): `src/ui/editor_view.rs`
- [Console](https://github.com/neoomir/neomir/blob/main/src/ui/console_view.rs): `src/ui/console_view.rs`
- [Settings dialog](https://github.com/neoomir/neomir/blob/main/src/ui/settings_dialog.rs): `src/ui/settings_dialog.rs`
- [Keybindings](https://github.com/neoomir/neomir/blob/main/src/ui/keybindings.rs): `src/ui/keybindings.rs`
- [Editor themes](https://github.com/neoomir/neomir/blob/main/src/ui/theme.rs): `src/ui/theme.rs`
- [Vim controls](https://github.com/neoomir/neomir/blob/main/src/ui/vim_mode.rs): `src/ui/vim_mode.rs`

### Language runtime

- [Language compiler](https://github.com/neoomir/neomir/blob/main/src/lang/mod.rs): `src/lang/mod.rs`
- [Lexer](https://github.com/neoomir/neomir/blob/main/src/lang/token.rs): `src/lang/token.rs`
- [Parser](https://github.com/neoomir/neomir/blob/main/src/lang/parser.rs): `src/lang/parser.rs`
- [Syntax tree](https://github.com/neoomir/neomir/blob/main/src/lang/ast.rs): `src/lang/ast.rs`
- [Virtual machine](https://github.com/neoomir/neomir/blob/main/src/lang/vm.rs): `src/lang/vm.rs`

### Robot simulation

- [Robot field state](https://github.com/neoomir/neomir/blob/main/src/robot.rs): `src/robot.rs`
- [Field view](https://github.com/neoomir/neomir/blob/main/src/ui/field_view.rs): `src/ui/field_view.rs`

### Extensions and IPC

- [Plugin management](https://github.com/neoomir/neomir/blob/main/src/plugins/mod.rs): `src/plugins/mod.rs`
- [Plugin engine](https://github.com/neoomir/neomir/blob/main/src/plugins/engine.rs): `src/plugins/engine.rs`
- [IPC server](https://github.com/neoomir/neomir/blob/main/src/plugins/ipc.rs): `src/plugins/ipc.rs`

### Other components

- **User**

## Connections

- User → Application startup: launches
- Application startup → Main window: opens (evidence: `src/main.rs`)
- Main window → Code editor: hosts (evidence: `src/ui/app_window.rs`)
- Main window → Console: hosts (evidence: `src/ui/app_window.rs`)
- Main window → Field view: hosts (evidence: `src/ui/app_window.rs`)
- Main window → Language compiler: compiles source (evidence: `src/ui/app_window.rs`)
- Language compiler → Lexer: tokenizes with (evidence: `src/lang/mod.rs`)
- Language compiler → Parser: parses with (evidence: `src/lang/mod.rs`)
- Language compiler → Virtual machine: compiles AST (evidence: `src/lang/mod.rs`)
- Parser → Lexer: consumes tokens (evidence: `src/lang/parser.rs`)
- Parser → Syntax tree: builds (evidence: `src/lang/parser.rs`)
- Virtual machine → Syntax tree: compiles (evidence: `src/lang/vm.rs`)
- Virtual machine → Robot field state: executes commands (evidence: `src/lang/vm.rs`)
- Main window → Virtual machine: steps execution (evidence: `src/ui/app_window.rs`)
- Field view → Robot field state: renders and edits (evidence: `src/ui/field_view.rs`)
- Main window → Robot field state: controls field (evidence: `src/ui/app_window.rs`)
- Main window → Settings dialog: opens (evidence: `src/ui/app_window.rs`)
- Settings dialog → Keybindings: configures (evidence: `src/ui/settings_dialog.rs`)
- Settings dialog → Code editor: configures (evidence: `src/ui/settings_dialog.rs`)
- Code editor → Editor themes: applies (evidence: `src/ui/editor_view.rs`)
- Code editor → Vim controls: delegates key input (evidence: `src/ui/editor_view.rs`)
- Main window → IPC server: starts server (evidence: `src/ui/app_window.rs`)
- IPC server → Robot field state: dispatches robot actions (evidence: `src/plugins/ipc.rs`)
- IPC server → Field view: requests redraw (evidence: `src/plugins/ipc.rs`)
- IPC server → Console: interacts with (evidence: `src/plugins/ipc.rs`)
- Settings dialog → Plugin management: manages plugins (evidence: `src/ui/settings_dialog.rs`)
- Plugin management → Plugin engine: delegates management (evidence: `src/plugins/mod.rs`)
- Plugin engine → IPC server: uses IPC (evidence: `src/plugins/engine.rs`)
