h a l f b a k e r y
Like gliding backwards through porridge.
add, search, annotate, link, view, overview, recent, by name, random
news, help, about, links, report a problem
or get an account
There are a lot of syntax highlighting editors/IDEs out there. What if we were to create an editor/IDE that would analyze the source code, and highlight stuff based on estimated best/average/worst case runtimes.
For example, something like:
would be black, but
would be red, with other stuff being in between. The editor would use a database of known built-in functions (specific to the language) and idioms with some other heuristics thrown in.
[As a bonus, the editor could offer complexity-based refactoring hints]
Alan Turing's Halting Problem
Good luck. [zen_tom, Mar 23 2007]
Busy Beaver Functions
Not sure how you'd be able to spot these type of things. [zen_tom, Mar 23 2007]
||It should have several modes so you can see a summary plus highlighted code for several criteria. That way, you can write your code, enter "runtime mode", and see at a glance your bottle necks. Next, enter "maintainability mode", so on so forth.
||This would discourage premature optimisation, as you could concentrate on getting the thing to work first and know you'll have a guide for optimisation later when you've forgotten how everything fits together.
||It would also depend on the architecture of the target machine - I've worked on machines where FFTs were trivial, but string searches nigh-on impossible.
||This is meant to be more of a complement to a syntax or maintainability highlighting editor, which is fully baked (Eclipse, WingIDE, etc.).
||To add context: We recently found a bubble-sort routine implemented in somewhat convoluted python embedded in our (not well documented) code. Something like this would have at least given the author an idea that they were doing something slow and unnecessary (python has built-in sorting). Clearly it won't catch everything, and won't be right about everything