4 ms·
How’s the memory managed?
by civopsec 4y ago
How’s the memory managed?
- djha-skin 4y agoBorrow checker like Rust.
- tmtvl 4y agoThey have documentation about that: https://github.com/carp-lang/Carp/blob/master/docs/Memory.md https://github.com/carp-lang/Carp/blob/master/docs/Memory.md It's interesting to see it's implemented in Haskell, looks like Clojure, has certain Rust-like semantics, and compiles to C. Quite an eclectic mix of languages going on here. Quite unusual that they don't mention anything about concurrency anywhere. The docs do say that there's a fork function, but there's no real information. Maybe the expectation is for developers to use C concurrency primitives?
- unsafecast 4y ago> Maybe the expectation is for developers to use C concurrency primitives? My guess is that they simply haven't thought much about this yet. One step at a time.
- timdeve 4y agoThat's correct, concurency is not supported right now. I have a POC for using pthread but essentially the borrow checker is not aware of it and so it's quite unsafe. Note: I'm a contributor.
- sph 4y agoFrom that link: (defn say-hi [text] (while true (if (< (length &text) 10) (println "Too short!") (println &text)))) Surprisingly similar to Rust, though I wonder if borrowing-by-default wouldn't be more readable than adding & everywhere. If you really need to give something ownership, you could have a sigil that maps to (move <var>)