Notes from https://gitter.im/fish-shell/fish-oil so I don't forget
echo 1>&3fish shell uses threads to support interactive features, like syntax highlighting, and also when writing output. For example in a command like echo $var | cat fish will spawn a thread to write the output of echo to cat.
fork() instead of threads (the original strategy)We need to interface Oil's garbage collected code with non-GC code. Working on it with Local<T> etc.
We could also do some kind of binary in-process API to avoid exposing that detail. (And for C programs that want to embed Oil)
These posts explain how Oil's completion (prototyped in Python) works, and how it's integrated with the parser:
http://www.oilshell.org/blog/tags.html?tag=interactive-shell#interactive-shell
https://github.com/oilshell/oil/issues/704
In addition to the config file and ble.sh use cases, Oil could "virtually fork" its heap with memcpy() and pipe() between threads.