Glossary
The documentation uses abbreviations, language terms and a set of terms with exact meanings in this project. An abbreviation links to the reference that defines it, and a language term to the section of the walkthrough that introduces it. A project term has no outside reference, so it is defined here, with a pointer to the page that treats it in full.
Abbreviations
| Abbreviation | Meaning |
|---|---|
| ABI | Application binary interface: names, calling convention and struct layouts at the machine level; Keyrill’s is include/keyrill.h |
| ADR | Architecture decision record; Keyrill’s are in docs/adr |
| API | Application programming interface |
| ARC | Automatic Reference Counting: retain and release inserted by the Objective-C compiler |
| ASan | AddressSanitizer, clang’s memory-error detector |
| BOM | Byte order mark, U+FEFF at the start of a text file |
| CC BY-SA | Creative Commons Attribution-ShareAlike 4.0, the license of the model’s word data |
| CI | Continuous integration; here, the GitHub Actions workflows in .github/workflows |
| COM | Component Object Model, the Windows object system TSF is built on |
| DLL | Dynamic-link library, a Windows shared library |
| EWT | English Web Treebank, one of the evaluation corpora |
| FFI | Foreign function interface: calling between Rust and another language; here, the crate keyrill-ffi |
| GCD | Grand Central Dispatch, Apple’s queue library |
| GTK | GTK, a toolkit for Linux desktop applications |
| HRESULT | A Windows status code returned by COM methods |
| IMK | InputMethodKit, the macOS framework for input methods |
| IPC | Inter-process communication; every IMK client call is one |
| MSVC | Microsoft’s C and C++ toolchain, and the Rust Windows target that uses it |
| RAII | Resource acquisition is initialization: a C++ object whose destructor undoes what its constructor did |
| SHA-256 | A cryptographic hash; used to pin the model source and the corpora, for consistency rather than authenticity |
| TIS | Text Input Sources, the Carbon API that lists and selects keyboard layouts and input methods; see Terms |
| TSF | Text Services Framework, the Windows counterpart of IMK |
| TUI | Text-based user interface, such as a program running in a terminal |
| UBSan | UndefinedBehaviorSanitizer, clang’s undefined-behavior detector |
| UD | Universal Dependencies, the treebank project the evaluation corpora come from |
| UTF-8, UTF-16 | UTF-8 and UTF-16, Unicode encodings; every length in the ABI counts UTF-16 code units |
| X11 | The X Window System, the older Linux display protocol |
Language terms
The terms the walkthrough sets in bold, with the section that introduces each.
| Term | Meaning |
|---|---|
| Accessor | A getter or setter method; an Objective-C property declares a pair |
| AppKit | The part of Cocoa for windows, menus and events |
| ARC | Automatic Reference Counting: the Objective-C compiler inserts the retain and release calls |
| Atomic | A variable whose reads and writes are indivisible even across threads |
| Attribute | An annotation for the Rust compiler, written #[...], or #![...] for a whole crate |
| Block | Objective-C’s closure, written ^{ ... } |
| Borrow checker | The part of the Rust compiler that enforces the rules for references |
| Callback | A function handed to other code for it to call later |
| Calling convention | Which registers and stack slots carry a function’s arguments and result |
| Capture | A closure or block keeping a variable from the code around it |
| Class method | An Objective-C method called on the class itself, declared with + |
| Closure | An anonymous function that can use variables from where it was written |
| Cocoa | Apple’s Objective-C frameworks for macOS applications |
| Compile time, run time | While the compiler translates the program, and while the program runs |
| Constructor, destructor | The C++ functions that run when an object is created and when it is destroyed |
| Crate | Rust’s unit of compilation: one library or one program, compiled as a whole |
| Data race | Two threads touching the same memory, at least one writing, without coordination; undefined behavior |
| Debug build, release build | The unoptimized build for development, and the optimized one that ships |
| Dependency injection | Handing a function its collaborators instead of letting it reach for them |
| Drop | Destroying a Rust value when its owner goes out of scope |
| Edition | A per-crate dialect of Rust: 2015, 2018, 2021 or 2024 |
| Enum, variant | A Rust type that is one of several variants, each with its own fields |
| Fake | A working stand-in for a real dependency, written by hand for tests |
| Fuzzer | A tool that feeds a program generated and damaged inputs |
| Garbage collector | The part of Python’s or JavaScript’s runtime that frees objects nobody refers to |
| Generic | Code written once for many types; the Rust compiler makes a copy per type |
| Guard | In a match, a condition after if; for a mutex, the value that holds the lock and releases it when dropped |
| Handle | A value that identifies an object to code that can’t see inside it |
| Header | A C file of declarations that other files include |
| Heap, stack | Memory for data of unknown size or lifetime, and memory for a function’s local variables |
| Initializer | An Objective-C method that sets up a new object, the counterpart of a constructor |
| Input method | A program between the keyboard and applications that decides what text a key produces |
| Input source | The macOS name for a keyboard layout or input method chosen from the menu bar |
| Instance variable | A private field of an Objective-C object, declared in @implementation |
| Internal linkage | A name visible only inside its own source file |
| Iterator | A source of values produced one at a time, on demand |
| Lifetime | The name, written 'a, for how long a borrowed reference stays valid |
| Linker | The tool that joins compiled files into one program by matching symbols |
| Lint | A check for a suspicious pattern, at level allow, warn, deny or forbid |
| Lock, mutex | Lets one thread at a time into the code or data it protects; a Rust Mutex contains its data |
| Macro | Code the compiler expands into more code; in Rust its name ends in ! |
| Main thread, main queue | The thread on which macOS delivers every input event, and the queue that runs blocks on it |
| Mangling | Encoding a function’s context or parameter types into its symbol name |
| Message, selector | A method call looked up by name at run time, and that name, such as handleEvent:client: |
| Module | A Rust namespace, usually one file |
| Move | Handing a Rust value to a new owner; the old variable can’t be used afterwards |
| Nested run loop | The event loop entered again from inside a call that is waiting |
| Opaque type | A struct with a name and no definition, which code can point to but not look inside |
| Owner | The variable or field that a Rust value belongs to |
| Panic | Rust stopping on a bug; it unwinds the stack unless the build aborts instead |
| Pattern, arm | A shape a value is compared against, and one branch of a match |
| Process | A running program |
| Property | An Objective-C declaration of a getter and setter, written by the compiler |
| Property test | A test that checks a law over many generated inputs |
| Protocol | A named list of methods any Objective-C class may adopt |
| Queue, serial queue | A GCD list of blocks to run; a serial queue runs them one at a time, in order |
| RAII | Tying an action to a C++ object’s lifetime, so its destructor undoes it on every exit |
| Raw pointer | A plain memory address with no lifetime and no guarantee it is valid |
| Reentrancy | Code entered again before its first run has finished |
| Reference | Access to a value without owning it: &T shared, &mut T exclusive; in C++, another name for an object |
| Retain count, retain cycle | The number of owners of an Objective-C object, and two objects that own each other and so are never freed |
| Run loop | The main thread’s event loop in a macOS program |
| Seed | The starting value of a random generator; fixing it makes a test repeat exactly |
| Shrinking | A property-test tool reducing a failing input to a small one |
| Slice | A view of part of an array: a pointer and a length |
| Standard library | The library every Rust program gets with the compiler |
| Static library | A file of compiled code the linker copies into a program |
| Struct, field | A record of named fields |
| Symbol | The name a function or variable has in compiled code |
| Tagged union | A value that is one of several variants and records which |
| Thread | An independent sequence of execution inside one process |
| Trait | A named set of methods a Rust type can provide |
| Translation unit | One source file with every header it includes, compiled as one unit |
| Undefined behavior | An operation the language gives no meaning to; the program may crash, corrupt memory or seem to work |
| Unsafe | Rust code in which a person vouches for what the compiler can’t prove |
| Unwinding | Leaving each function in turn and cleaning up, as an exception or panic propagates |
| UTF-16 code unit | One 16-bit value of UTF-16 text; most characters take one, some take two |
| Workspace | The set of Rust crates built together from one root Cargo.toml |
| Worktree | A second checkout of the same Git repository in another directory |
Terms
Acknowledgement. The adapter’s report of what happened to a plan, through kr_commit: verified,
refused before the write, or unknown. Only a verified acknowledgement advances the Rust session. See
Rust in the core.
Adapter. The platform code that owns the native objects and the editing: on macOS, the
Objective-C++ under native/macos. It calls the engine through the C ABI and never the other way
round. See macOS adapter.
Boundary. The context in which a letter may start a word: the caret at the start of the document or after whitespace, read back from the client. Anything else, including a prefix that couldn’t be read, is ineligible, and the letter goes to the application untouched.
Boundary mark. A word and its Space, still marked after Space so that a correction can be undone by replacing Keyrill’s own mark. It ends with the next key. ARCHITECTURE.md calls the state BoundaryRetained.
Compatibility backend. The macOS backend for applications that can’t hold an owned composition, such as terminals: it posts synthetic key events and treats them as dispatched, never as verified edits. It is the one exception to owned-composition-only editing; see ADR 006.
Controlled-native evidence. A result from the native tests, which run the real adapter and the real Rust engine against a scripted fake client. It shows what the adapter does on a schedule; it shows nothing about a real application, which only a physical test can. See Testing.
Explicit intent. A manual conversion or a reversal by the user. It stops automatic inference for the rest of that word, so inference never undoes a choice the user made.
Fixture policy. A test policy that converts exactly ghbdtn and руддщ and nothing else, so
that session tests don’t depend on the model.
Generation. A counter that grows on every event invalidating what the adapter knows. An operation remembers the generation it started under and compares after each native call; a difference means a callback ran in between, and the operation stops. See Reentrancy and tests.
Guard. The compatibility backend’s listen-only event tap. It observes mouse, navigation, shortcut and source changes without reading characters; each one ends tracking and advances the process-wide guard generation, which every rewrite rechecks before it posts. See macOS.
Inference. The engine’s decision, at a word boundary, whether a finished word was typed in the wrong layout. It uses the frozen model, the user’s dictionaries and recent context, and leaves the word alone whenever it is unsure. See Engine.
Input mode. Keyrill EN or Keyrill RU, the two input sources Keyrill installs; the mode decides which layout the keys type in.
Learned words. Words the user taught the OS spell checker. They protect and forbid words like the Vim dictionaries, but automatic correction never waits for them.
Local authority. The adapter’s record of the mark it verified last: the client, the start offset and the exact text. A write needs it, and the adapter drops it before every write and regains it only when the write’s checks pass, which for a mark update means a matching readback.
Mark, owned composition. Marked text, the underlined composition of an input method, that
Keyrill itself placed with setMarkedText and still owns. It is the only text the composition path
may change; the compatibility backend is the one exception. See
How Keyrill works.
Plan. Rust’s answer to one key: an id, one permitted action (pass, mark, finish or unavailable), the text the mark must hold before the write, the text to write, and what to do with the key afterwards. A plan is a proposal, never editing authority.
Poisoned handle. An engine or vocabulary handle in which a Rust panic was caught. Every later
call on it returns KR_POISONED; only freeing it remains. See
The C boundary.
Provisional key. A key such as [ or ; that types punctuation in English but a Russian letter
in Russian. In English mode it may start or continue a word, because the word may turn out to be
Russian typed in the wrong layout.
Readback. Reading the composition back from the client after a write, over exactly the range written. It is the only evidence of a write’s effect that the adapter accepts; an API’s success return is not. The one write verified without it is an unchanged commit that IMK or the controller requests, which writes back the text last verified in the mark; see the edit contract.
Receipt. The text a word had before Keyrill first converted it, kept while the same word is owned so that Control-Option-Z or Escape can restore it. An edit or finishing the word expires it.
Secure Input. The macOS mode in which keyboard input goes only to the focused application, used for password fields (TN2150). While it is on, Keyrill passes every key and inspects nothing.
Snapshot. An immutable, fully parsed copy of a dictionary, published whole as an Arc and never
edited in place. A failed parse leaves the last good snapshot in force.
Tier. How Keyrill handles one application, chosen by its bundle identifier: composition, compatibility (automatic and manual, or manual only) or off. See macOS adapter.
TIS. Text Input Sources, the Carbon interface in HIToolbox/TextInputSources.h (functions named
TIS...) that lists, enables and selects input sources. Apple documents it only in that header.
Keyrill uses it to list input sources and read their properties and to observe source changes, and
avoids it where its answers are unreliable inside the input method’s own process
(Input-source switching).
Unknown outcome. The acknowledgement for a write that was attempted but whose effect couldn’t be verified. It invalidates the session and stops correction; nothing is repaired or replayed. The edit contract lists the one write still allowed afterwards and when correction resumes.