| ▲ | Someone 5 hours ago | |
Is it truly simpler to do that? A separate “command line to byte codes” module would be way easier to test than one that also does the work, including making any necessary syscalls. Also, decreasing CPU usage many not speed up find (much), but it would leave more time for running other processes. | ||
| ▲ | drob518 5 hours ago | parent | next [-] | |
If it was easier to interpret byte codes, nobody would use a tree-walk interpreter. There’s no performance reason to use a tree-walk interpreter. They all do it because it’s easy. You basically already have the expression in tree form, regardless of where you end up. So, stop processing the tree and just interpret it. | ||
| ▲ | maxbond 5 hours ago | parent | prev [-] | |
File operations are a good candidate for testing with side effects since they ship with every OS and are not very expensive in a tmpfs, but you don't have to let it perform side effects. You could pass the eval function a delegate which it calls methods on to perform side effects and pass in a mocked delegate during testing. | ||