Opportunistic mutation #1

Open
opened 2024-12-05 16:51:54 +00:00 by scott · 0 comments
Owner

imbl allows for opportunistic mutation of data structures, which is good! However, just about everything in the Ludus vm assumes no mutation, only borrowing. So concat has to create new strings and lists. This isn't the worst, but it's not great, either.

So, for example, I can't mutably borrow out of an argument tuple, which currently has type Rc<Vec<Value<'src>>>.

One reason to separate Base from Prelude is that Base functions should be able to mutate their arguments, whereas Prelude never does, excepting cases of opportunistic mutation. So one project here is to shift all Base values to take &mut Value arguments. This may require distinguishing between those that mutate and those that don't (e.g. Binary vs BinaryMut). That's fine.

`imbl` allows for opportunistic mutation of data structures, which is good! However, just about everything in the Ludus vm assumes no mutation, only borrowing. So `concat` has to create new strings and lists. This isn't the worst, but it's not great, either. So, for example, I can't mutably borrow out of an argument tuple, which currently has type `Rc<Vec<Value<'src>>>`. One reason to separate Base from Prelude is that Base functions should be able to mutate their arguments, whereas Prelude never does, excepting cases of opportunistic mutation. So one project here is to shift all Base values to take `&mut Value` arguments. This may require distinguishing between those that mutate and those that don't (e.g. `Binary` vs `BinaryMut`). That's fine.
scott added the
optimization
label 2024-12-05 16:51:58 +00:00
scott added this to the Optimized Ludus milestone 2024-12-11 05:40:25 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: scott/rudus#1
No description provided.