Functional Reactive Programming in Rust

What is Functional Reactive Programming

Functional Reactive Programming, or FRP for short, is a declarative style of UI design famous for ideas such as bidirectional data-bindings. This style of programming has been much popularized by frameworks such as React, which adapts many ideas from FRP.

What is FRP in RUST Web?

There is an ambitious Web Framework in Rust called Yew that adapts many FRP concepts in a similar way to React. Throwing my hat into the ring I have made some declarative macros for simply generating HTML. Less or More, One way or Another, users tend to desire abstractions that behave in a declarative effective reactive intuitive manner. FRP embodies intuition in UI, striving against the naturally cascading deployment cycle that we are accustomed to as developers.

Update 2022

A new contender for FRP style UI in Rust is the dioxus library. With dioxus it is now possible to write one program that compiles to run on Windows, Mac Desktop, Linux Desktop, Android Mobile, iPhone, and Web all from the same codebase. For reference I am personally developing through Windows Subsystem for Linux Ubuntu running on Windows through a third party X Server. It really just works!

use dioxus::prelude::*;
use dioxus_desktop::tao::menu::MenuBar;

fn main() {
    dioxus::desktop::launch_cfg(app, |c| c.with_window(|w| w.with_menu(MenuBar::default())));
}

fn app(cx: Scope) -> Element {
    cx.render(rsx! (
        div { "Hello, world!" }
    ))
}