A Web-Style Native Application Runtime (Electron Replacement)
HexaCore Runtime is a cross-platform desktop runtime designed to replace Electron for large-scale applications. It preserves the web paradigm (declarative tree + CSS-like styling) while removing Chromium, WebView, and the browser DOM from the stack.
Goals:
- consistent native performance,
- smaller footprint than Electron,
- deep OS integration,
- and incremental migration from existing Electron apps.
- Replace Electron without full app rewrites.
- Keep CSS-like styling and layout.
- Run UI and logic in a custom runtime (no browser).
- Enforce security via sandbox and explicit permissions.
- Scale to Discord/Slack/Teams-level apps.
- Full HTML/CSS/JS compliance per W3C.
- Embedded browser behavior.
- Running arbitrary web code without sandboxing.
- Companies with large, mature Electron apps.
- Products that require rich UI + real-time media.
- Teams that want the web model with native performance and control.
- UI built on a custom declarative tree, inspired by DOM/React.
- Primitive components controlled by the runtime.
- Direct GPU rendering (no HTML layout).
-
CSS-like subset, including:
- cascade,
- specificity,
- variables,
- themes.
-
Styles apply to runtime primitives, not arbitrary HTML tags.
- App logic runs inside a sandbox (WASM or isolated JS).
- Host communication via a Native Bridge with explicit permissions.
flowchart TD
A["Dev writes App (DSL or TS/JSX)"] --> B["Compiler: Parser -> AST -> IR"]
B --> C["App Bundle"]
C --> D["Desktop Host"]
subgraph R["HexaCore Runtime"]
E["App Runtime (WASM or JS sandbox)"]
F["UI Runtime (tree + diff)"]
G["Style Engine (CSS subset)"]
H["Layout Engine (flexbox)"]
I["Text Engine (shaping, selection)"]
J["GPU Renderer"]
K["Input & A11y"]
L["Native Bridge"]
end
D --> R
E --> F
F --> G --> H --> I --> J
K --> F
E --> L --> D
Responsible for:
- executing app logic,
- state management,
- UI event dispatch.
Characteristics
- sandboxed by default,
- async communication with UI,
- hot reload in development.
- maintains the real UI tree,
- applies diffs (reconciliation),
- controls component lifecycle.
- selectors:
.class,#id, type, simple descendant. - box model: margin, padding, border.
- full flexbox.
- colors, backgrounds, images.
- opacity, transform.
- variables (
--var).
- advanced CSS Grid.
- complex pseudo-elements.
- table-based layout.
- flexbox-based.
- incremental, cached calculation.
- scroll and virtualization support.
- font fallback.
- full Unicode.
- emoji.
- selection, cursor, copy/paste.
- IME (Japanese, Chinese, etc.).
Note: This is critical for Discord-level apps.
- modern graphics API (Vulkan/Metal/D3D).
- display lists.
- layered composition.
- aggressive glyph and image caching.
- mouse, keyboard, touch.
- keyboard navigation.
- focus and tab order.
- semantic tree for screen readers.
Exposed APIs:
- filesystem (sandboxed),
- notifications,
- tray,
- windows,
- audio/video,
- auto-update.
All gated by declarative permissions.
flowchart LR
A["App Manifest"] --> B["Permission Resolver"]
B --> C["Allowed APIs"]
B --> D["Denied APIs"]
Example:
permissions:
filesystem: read-only
notifications: true
audio: true
camera: falsemy-app/
├─ manifest.yaml
├─ ui/
│ ├─ app.tsx
│ └─ styles.css
├─ logic/
│ └─ main.ts
└─ assets/
├─ icons/
└─ fonts/
name: ChatApp
version: 1.0.0
entry: ui/app.tsx
permissions:
filesystem: sandbox
notifications: true
audio: true
window:
width: 1280
height: 720
resizable: trueflowchart TD
A["Source App"] --> B["Compiler"]
B --> C["IR + Assets"]
C --> D["Runtime Bundle"]
D --> E["Packager"]
E --> F["Windows"]
E --> G["Linux"]
E --> H["macOS"]
- Windows:
.exe/.msi - Linux: Flatpak, AppImage
- macOS:
.app/.dmg
- binary signing,
- delta updates,
- safe rollback.
flowchart TD
A["HexaCore Window"] --> B["Native Screens"]
A --> C["Isolated WebView (Legacy)"]
- New screens use HexaCore UI.
- Legacy screens run in isolated WebView.
- Progressive migration to zero WebView.
- virtualized list (50k messages),
- basic Markdown,
- emojis,
- selection and copy,
- stable 60 FPS.
- multiline,
- IME,
- undo/redo,
- keyboard shortcuts.
- UI tree
- basic styles
- GPU render
- simple input
- full text
- virtualization
- permissions
- packaging
- isolated WebView
- hybrid APIs
- dev tooling
- full accessibility
- voice/media APIs
- telemetry and crash reporting
- mature tooling
| Aspect | Electron | HexaCore |
|---|---|---|
| Chromium | Yes | No |
| Footprint | High | Low |
| Startup | Slow | Fast |
| UI Engine | DOM/CSS | Native GPU |
| Permissions | Weak | Strong |
| Migration | Hard | Incremental |
HexaCore Runtime is not "just another framework". It is a native UI infrastructure with a web-style paradigm, designed to replace Electron for large apps without a full rewrite or embedded browser costs.