# D2 diagram of tvix-eval's `Value` type. # # can be rendered at https://play.d2lang.com/ # # colours have meanings: # # yellow: recurses # orange: heap allocation # red: refcount # # this intentionally does *not* include some internal variants Value -> Null Value -> Bool Value -> Integer Value -> Float Box*.style.fill: "lightsalmon" Rc*.style.fill: "salmon" Vec\<*.style.fill: "salmon" Value -> String -> NixString -> "Box" Value -> Path -> "Box" -> PathBuf PathBuf.style.fill: "lightsalmon" # attribute sets are kinda complicated Value -> Attrs -> "Box" -> NixAttrs NixAttrs -> Empty NixAttrs -> KV KV.style.fill: "LemonChiffon" KV -> Value KV -> Value NixAttrs -> Map Map -> "OrdMap" -> "MapEntry" "OrdMap".style.fill: "lightsalmon" "MapEntry".style.fill: "salmon" "MapEntry".style.multiple: true "MapEntry" -> NixString "MapEntry" -> Value "MapEntry".style.stroke-width: 15 "MapEntry".style.stroke: "lemonchiffon" Value -> List -> NixList -> "Rc>" "Rc>" -> "VecEntry" -> Value "VecEntry".style.multiple: true "VecEntry".style.fill: "salmon" "VecEntry".style.stroke-width: 15 "VecEntry".style.stroke: "lemonchiffon" # closures Value -> Closure -> "Rc" -> Closure Closure -> "Rc" -> Lambda Lambda -> Chunk Lambda -> SmolStr: sometimes allocates SmolStr.style.fill: "lightsalmon" Lambda -> usize Lambda -> "Option" -> Formals Formals -> "HashMap" -> "MapEntry" "HashMap".style.fill: "lightsalmon" "MapEntry".style.fill: "salmon" "MapEntry".style.multiple: true "MapEntry" -> NixString Closure -> "Rc" -> Upvalues Upvalues -> "Vec" "Vec" -> Value "Vec".style.stroke-width: 15 "Vec".style.stroke: "lemonchiffon" Upvalues -> "Option>" "Option>" -> Value "Option>".style.fill: "lightsalmon" "Option>".style.stroke-width: 15 "Option>".style.stroke: "lemonchiffon" Value -> Blueprint -> "Rc" # builtins Value -> Builtin -> "Box" -> BuiltinRepr BuiltinRepr -> "Rc" BuiltinRepr -> "Vec" # thunks Value -> Thunk -> "Rc>" -> ThunkRepr ThunkRepr -> Suspended Suspended -> "Rc" Suspended -> "Rc" ThunkRepr -> Native -> "Box Result>" ThunkRepr -> Blackhole ThunkRepr -> Evaluated -> Value Evaluated.style.fill: "lemonchiffon"