You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've got this working for the most part. I need to separate it from my piping-related changes though. Backtick-style substitution still doesn't work at the moment (due to parsing). There are also some issues with setting variables and whatnot in a substitution as I want to avoid forking (and thus creating a real subshell) unless absolutely necessary.
Basically what needs to happen to avoid forking is we need to have locality for variables (in addition to file descriptors, which already have locality). There are two easy ways to do this:
Use the Locality type currently used for file descriptors and, like file descriptors, loop through every variable and increment the count for Locality::Local variables. This is pretty easy to do as we already have the necessary types and such, but could become slower than forking given enough variables.
Give the current Environment a parent Environment and check for variables in the current Environment all the way back up to the global Environment. Disadvantage of this is that if there are many scopes finding variables can be very slow (not updating though, as any time we set a variable we'd just do env.set_local_fd() as the scopes are only used for subshells). If we do this we'd probably want to write a custom HashMap that allows us to provide the hashed key (so that we don't need to keep hashing the key over and over again when going up the chain of scopes).
The only issue at the moment is getting the output. Running the program and waiting for it should work fine.
The text was updated successfully, but these errors were encountered: