Hacker News new | past | comments | ask | show | jobs | submit login

This reminds me of my idea for a compiler that guarantees performance but not correctness, instead of the other way round.



3D rendering and media compression are almost entirely based on the idea that "close enough" is vastly cheaper than "do it right". At the code level, though... You'd have to be fairly careful about what you allowed, and you'd probably have to be able to enforce correctness to some degree to get any meaningful use out of it.

I like the idea of a compiler making lossy simplifications to mathematical formulas for speed - "You told me to divide by seven. This (faster) machine code divides by 8 most of the time, and divides by 4 every now and then." Blindly trusting the branch-predictor could be fun, too, as long as it took into account the correct answer in its subsequent predictions.

Were you thinking along similar lines, or did you have something completely different in mind?


I like those ideas a lot. I hadn't thought about it in enough detail to come up with similar ones, but that's exactly what I was hoping for.

The problem, of course, is that it's hard to find a metric for "close enough" that works for every program. Perhaps it's easier if you're compiling from a high-level language than from C.


I have a compiler like that. It turns any code into "return 0".





Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: