# Introduction Sauron is a web framework written in rust, which can compile to webassembly to help you create robust websites and web apps. This guide will: - Show you how to make interactive apps with Sauron web framework. # A Quick Example ```rust use sauron::html::text; use sauron::prelude::*; use sauron::{node, Cmd, Component, Node, Program}; #[derive(Debug)] pub enum Msg { Increment, Decrement, } pub struct App { count: i32, } impl App { pub fn new() -> Self { App { count: 0 } } } impl Component for App { fn view(&self) -> Node { node! {
{text(self.count)}
} } fn update(&mut self, msg: Msg) -> Cmd { match msg { Msg::Increment => self.count += 1, Msg::Decrement => self.count -= 1, } Cmd::none() } } #[wasm_bindgen(start)] pub fn main() { console_log::init_with_level(log::Level::Trace).unwrap(); console_error_panic_hook::set_once(); Program::mount_to_body(App::new()); } ``` ## Why sauron? - No runtime errors in practice - Reliable refactoring - Automatically enforced semantic versioning for all dependent crates.