Posts by pygy@mamot.fr
(DIR) Post #AkUHKcZgp1GQ8so12m by pygy@mamot.fr
2024-07-31T10:54:56Z
0 likes, 0 repeats
@jaffathecake I think that this is because JS GC works per scope rather than per variable.Lua has a more granular approach to lexical scope, with the upvalue mechanism, which is explained here:https://www.jucs.org/jucs_11_7/the_implementation_of_lua/jucs_11_7_1159_1176_defigueiredo.html#:~:text=5%20Functions%20and%20Closures
(DIR) Post #AkUhoPc2B2ZPR7lhKa by pygy@mamot.fr
2024-07-31T13:41:15Z
0 likes, 0 repeats
@Drarok @jaffathecake There's no need for explicitly marking them, the lua `local` binding works almost like the JS `let` (but it allows shadowing). The scenario described by Jake doesn't leak in Lua.It is "just" a matter of changing the runtimes, no need for custom language semantics tweaking.
(DIR) Post #AkUhoQGRkmtdSSfyK0 by pygy@mamot.fr
2024-07-31T13:43:00Z
0 likes, 0 repeats
@Drarok @jaffathecake To answer your question (I almost forgot, sorry), there's no mechanism to sidestep the issue in JS currently, because of suboptimal runtime semantics.
(DIR) Post #AkUxZkGCj0b4OiaNV2 by pygy@mamot.fr
2024-07-31T18:46:53Z
0 likes, 0 repeats
@jaffathecake @Drarok That's only a partial solution, it isn't always possible to track references.