And what little there is, is worth it ten-fold for all of the runtime bug headaches that you avoid compared to dynamically typed languages.
JS:
let person_1 = { }; let person_2 = { parent: person_1 }; person_1.child = person_2;
use std::cell::Cell; struct Person<'a> { parent: Option<&'a Person<'a>>, child: Cell<Option<&'a Person<'a>>> } let person_1 = Person { parent: None, child: Cell::new(None) }; let person_2 = Person { parent: Some(&person_1), child: Cell::new(None) }; person_1.child.set(Some(&person_2));
And what little there is, is worth it ten-fold for all of the runtime bug headaches that you avoid compared to dynamically typed languages.