Skip to content

Thoughts on value equality being fast, and data structure mutation being memory efficient in Val. #728

Answered by kyouko-taiga
RMJay asked this question in Q&A
Discussion options

You must be logged in to vote

HI @RMJay!

I believe that approach you're referring to is how one implement persistent data structures.

Implementations of such data structures typically rely on automatic garbage collection because the n+1-th version of a value needs access to the n-th version, regardless of where it was created. That's not a problem in a language like Javascript since the runtime will take care of all dynamic allocations anyway. However, in a lower-level language like Val (or C++), one has to worry about memory collection.

There are costs to garbage collection that we don't want to pay in Val. Since we're aiming for a zero-cost abstraction language with transparent performance guarantees, we can't affor…

Replies: 0 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@RMJay
Comment options

Answer selected by RMJay
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants