pub fn write_value_into_scratch( spec: &ParamSpec, val: &Value, scratch: &mut [u8], cursor: &mut usize, ) -> Result<usize, VibeTrap>