4 ms·
IMO, Doing this sort of approach within the micro-iterations of an individual programmer's edit-compile-test cycle is not quite the best place to do this. I en
by stcredzero 16y ago
IMO, Doing this sort of approach within the micro-iterations of an individual programmer's edit-compile-test cycle is not quite the best place to do this. I envision the "hardness level" of a code base to be about the same throughout one iteration/release. This gives time for the production application to generate runtime profile data from actual use. In this case, the more data, the better. This data can then be massaged and verified by programmers using suitable tools and their in-depth knowledge of the application. (So runtime traces which contradict each other's type inferences can be looked at, etc.) Such tools can also apply a set of massaged type annotations to a branch of the code base, which can then be tested and merged back into the main branch of the application. I think this is a very natural pace of this level of change for most shops. This technique can also be adapted to apply to specific sections of code which need to be optimized, or can be applied incrementally across a code base over time.
- tlack 16y agoAn easy/fun testbed for this idea might be Erlang's new type specs: http://www.erlang.org/doc/reference_manual/typespec.html http://www.erlang.org/doc/reference_manual/typespec.html You could write a parse transform that wraps all exported funs in a module in some kind of type analyzing shim function, which would eventually output type specs as an .hrl you could -include(). Type specs will eventually be used by Dialyzer and other Erlang tools to issue warnings and optimize code, so the effort wouldn't be in vain. Seems like a quick way to figure out the feasibility of your excellent idea.
- dkersten 16y agoI envision this to take place in staged releases, eg, during an automated nightly build, rather than during the programmers normal code-compile-run cycle. For example, production code usually turns off a lot of runtime assertions, so this might only be applied to development builds. Having said that, a JIT compiler blurs the line between debug/development and production builds, since the JIT compiler could dynamically insert or remove debug, profiling or tracing code. I like the idea of being able to connect testing tools to a running production system (eg, when an error or bug is detected) and the JIT compiler would insert the required code to make this work for the duration of the test session. The debug information that was generated could then be applied to the next build of the development version (which would include new type annotations, unit test stubs, profile information for the code optimizer and whatever else).
- stcredzero 16y agoI envision this to take place in staged releases, eg, during an automated nightly build, rather than during the programmers normal code-compile-run cycle. Cool! the JIT compiler could dynamically insert or remove debug, profiling or tracing code. I like the idea of being able to connect testing tools to a running production system (eg, when an error or bug is detected) and the JIT compiler would insert the required code to make this work for the duration of the test session. That's going much farther than I'd envisioned it! The mind boggles.
- dkersten 16y agoTheres obviously a lot of work to be done before we get there, but a world where you can have all the powerful features of dynamic runtimes/languages without sacrificing efficiency would certainly be welcome. We'll see how my own experiments work out. If anyone would like to chat about the idea, feel free to send an email to my username at gmail.