ulmus 0.2.0

An Elm architecture TUI framework
Documentation

Ulmus

Ulmus is a TUI framework, inspired by Charm's Bubble Tea. Like Bubble Tea, it uses the Elm architecture.

Architecture

To use Ulmus a user needs to create a type which implements the Model trait. It will be called using a Program, via the run method.

Program will repeatedly call the model, passing crossterm messages via model's update method. After each update the view method will be called, and the results will be draw on the terminal.

For performing I/O see Cmd and Subroutine.

Examples

Comparison

Bubble Tea

Ulmus interface is based on that of Bubble Tea, so they are very similar. However, Rust's type system causes two differences:

  • Ulmus doesn't type-erase messages, so the user must implement a separate type for their messages: CustomMsg.

  • The model is mutated in-place in update, since it is ensured that it remains constant when view is called.

Ratatui

  • Ratatui is a library. The application calls Ratatui's functions.

  • Ulmus is a framework. Ulmus calls application's code.

Additionally, Ulmus does less than Ratatui. It doesn't support multiple terminal backends, styling (the application has to do it itself, for example using colored), or complex widgets (Ratatui renders each cell individually, Ulmus renders one string).

Finally, Ratatui is a mature project with a large ecosystem and Ulmus is my small weekend project.