1
0
Fork
You've already forked kerning
0
Modern Emacs-like Editor
2026年01月25日 11:57:56 +01:00
Readme.md First commit 2026年01月25日 11:57:56 +01:00

Kerning — Modern Emacs-like Editor (Project Log)

This document is a living README + project memory for a long-term editor project inspired by Emacs, but designed with modern constraints and capabilities.

Its purpose is threefold:

  1. Track architectural decisions and rationale
  2. Record learning milestones (especially Rust)
  3. Act as context recovery if this chat is lost or handed to another LLM

Project Goal

Build a modern, extensible text editor with:

  • Configuration as code (no predefined options)
  • A long-running, introspectable runtime
  • First-class self-documentation
  • A rich GUI (mixed fonts, widgets, panels)
  • True multithreading
  • High performance competitive with Neovim

The editor is not just configurable — user code becomes part of the editor itself at runtime.


Technology Choices

Core / Backend

  • Language: Rust

  • Responsibilities:

    • Text buffers and data structures
    • Rendering and layout
    • Scheduling and threading
    • Safe long-running runtime
    • Plugin/extension host

Rust was chosen for:

  • Performance
  • Memory safety
  • Strong concurrency model
  • Suitability for large, long-lived systems

User / Configuration Language

  • Language: Lua

  • Role:

    • Configuration as executable code
    • Defining commands, keybindings, UI behaviors
    • Runtime customization

Lua was chosen for:

  • Simplicity and embeddability
  • Proven performance (Neovim)
  • Low cognitive overhead

Development Style

  • Pair-programming-like workflow

    • Assistant proposes small, manageable tasks
    • User implements them independently
    • Assistant reviews, critiques, and suggests improvements
  • No code generation by assistant

    • All learning and implementation is user-driven
    • Assistant focuses on guidance, architecture, and feedback
  • Incremental Rust learning

    • Tasks are designed to teach Rust concepts gradually
    • Editor architecture evolves alongside Rust proficiency

High-Level Architecture (Initial)

  1. Editor Runtime (Rust)

    • Long-running process
    • Owns all state
  2. Command System

    • Commands are functions with metadata
    • Keybindings map to commands
  3. Lua Integration

    • Lua code loaded as modules
    • Can define commands and interact with runtime
    • No separate "config phase"
  4. Introspection & Documentation

    • Symbols, commands, and modules carry metadata
    • Help system queries live runtime state
  5. GUI (future phases)

    • Native, GPU-accelerated UI
    • Not HTML-based

Milestones

Phase 0 — Foundations (Current)

  • Rust toolchain setup
  • Basic Rust project structure
  • Understanding ownership, borrowing, lifetimes
  • Minimal executable editor shell

Working Agreement

  • This README is updated as decisions are made
  • Each task should be small enough to complete in ~1–2 sessions
  • Mistakes are expected and valuable
  • Architectural clarity > feature count

Notes for Future LLMs

If you are reading this without chat history:

  • The user is intentionally learning Rust
  • Do NOT write code for them
  • Provide conceptual guidance and task breakdowns
  • Assume Rust is new, but editor concepts are not

The assistant should act as a senior systems engineer and mentor, not an implementation engine.


Project Name: Kerning