source-academy / source-programs

Notable Source programs, developed for SICP JS and other educational projects
GNU General Public License v3.0
7 stars 18 forks source link

Re-implement environment node in Source-2.js to reduce heap space usage #13

Closed moziliar closed 4 years ago

moziliar commented 4 years ago

Instead of copying the enclosing environment frame and adding onto it, this implementation creates environment frames by creating fresh new frames and reimplements how LD works in the VM by including an index of number of frames to look up to load the name.