reubeno / brush

bash/POSIX-compatible shell implemented in Rust
MIT License
26 stars 4 forks source link

Consider adding a JIT and JIT cache for static sections of source files #253

Open skull-squadron opened 3 weeks ago

skull-squadron commented 3 weeks ago

If going through the motions to reinvent the wheel and already having access to a parser, why not make it uniquely advantageous and practical?

One of the biggest problems with bash and traditional shells is slow execution speed of loading and interpreting constant source files.

While avoiding the moderately more difficult cases of non-constant sourcing and eval as potential interpretive "hole" sequence points, but most other bits are low-hanging fruit source transformable into machine code ahead-of-time.

References, prior art and discussion:

reubeno commented 3 weeks ago

Love the idea! Thanks for the links as well, I'll read through them.

(We've dipped our toes into memoizing simple sub-operations like tokenizing, but haven't tackled anything more interesting in that direction.)

More broadly, we're definitely open to creative ideas like this. Whether it's for the sake of performance, inspectability/security, or testing/analysis--I'd wholly agree it's worthwhile to find interesting ways to leverage our "reinventing the wheel" 🙂