News for hackers. Stuff that matters.
Re:Unix "find" expressions compiled to bytecode by Someone on Friday December 26, 2025 @03:27PM (#46395869)
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.

Re:Unix "find" expressions compiled to bytecode by maxbond on Friday December 26, 2025 @04:17PM (#46396355)
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.
Re:Unix "find" expressions compiled to bytecode by drob518 on Friday December 26, 2025 @04:07PM (#46396275)
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.
Re:Unix "find" expressions compiled to bytecode by Someone on Saturday December 27, 2025 @03:52AM (#46400278)
> If it was easier to interpret byte codes

I’m not claiming anything, certainly not that; I’m questioning whether the additional complexity of designing a bytecode VM is worth it because it makes testing easier.