4 ms·
Why not both? I want both GC for recursive data structures (lists, trees, graphs, etc.) and Rust-style resource management when deterministic reclamation matter
by catnaroek 10y ago
Why not both? I want both GC for recursive data structures (lists, trees, graphs, etc.) and Rust-style resource management when deterministic reclamation matters (files, GUI objects, etc.).
- bluejekyll 10y agoThis is something that is in discussion, though I don't know the status of any of the discussions: https://internals.rust-lang.org/t/on-native-allocations-pointing-into-a-gc-heap/564 https://internals.rust-lang.org/t/on-native-allocations-poin... https://github.com/rust-lang/rfcs/blob/bdbe73d1be948dd925c6b3583d40879cde130bcf/text/1398-kinds-of-allocators.md#the-gc-integration-strategy https://github.com/rust-lang/rfcs/blob/bdbe73d1be948dd925c6b...
- catnaroek 10y agoI should've been clearer: For low-level programming, Rust is already fine as it is. What I want is a high-level language that offers some of the benefits of Rust (safe deterministic non-memory resource management), without the unnecessarily low-level features (sized types and overemphasis on unique ownership). Due to its C++ heritage, Rust has a tendency to conflate ownership (a high-level concern) with indirection (a low-level one), which is fine for the niche it targets, but too inflexible for general-purpose programming, IMO.
- fridsun 10y agoOCaml or Haskell.
- catnaroek 10y agoNeither OCaml nor Haskell has substructural types. There's no way to tell their type systems “you can't use a file after it's been closed”. In fact, what I want can be summarized as “ML plus substructural types”! (But preferably with Standard ML as the base point, since OCaml has way too many warts for my taste.)