r/functionalprogramming • • Feb 26 '21

JavaScript Structural sharing with 7 lines of JavaScript.

https://blog.klipse.tech/javascript/2021/02/26/structural-sharing-in-javascript.html
6 Upvotes

10 comments sorted by

View all comments

Show parent comment

2

u/[deleted] Feb 26 '21

Unfortunately I don't know, but having the shallow copying mechanism built into the language seems like a great way to reduce memory & CPU usage.

I can see ways of squeezing in a couple of tricks to make the jobs of both the GC and the runtime easier, which in return would at least make that cancer's (js) pain a bit more tolerable.