3 ms·
Could the optimizer still help in the general case if you only ever intend to run each program one time? If so, I probably need to spend a lot more time in thi
by bob1029 2y ago
Could the optimizer still help in the general case if you only ever intend to run each program one time?
If so, I probably need to spend a lot more time in this rabbit hole.
- john-h-k 2y agoYes. The biggest win (that you may already do) is recording branch positions, so when you hit a `[` or `]` knowing exactly where to jump through rather than going left/right. My interpreter above isn't the most advanced (it was a few hours while hungover because it seemed fun!), but try throwing it at your thing and I suspect it could help. ``` cargo install --git https://github.com/john-h-k/rustfuck https://github.com/john-h-k/rustfuck rustfuck <source> --lir # or --jit if you are on arm64 and don't need to read from stdin ```