<div dir="ltr"><div><div>There was a halcyon age when high level languages had tracing facilities. Dating as far back as 1962 (SNOBOL4) languages offered the ability to trace execution as a (sometimes optional) part of the runtime. Here are some examples:<br><br><ul><li><a href="http://www.snobol4.org/docs/burks/tutorial/ch8.htm">http://www.snobol4.org/docs/burks/tutorial/ch8.htm</a> (SNOBOL4's debugging and tracing facilities)</li><li><a href="http://www.kilowattsoftware.com/tutorial/rexx/trace.htm">http://www.kilowattsoftware.com/tutorial/rexx/trace.htm</a> (Rexx's debugging and tracing facilities: doesn't cover the TRACE() BIF but that's a minor enhancement)</li><li>Erlang has a bewilderingly powerful set of tracing facilities that you can nose around in beginning here: <a href="http://erlang.org/doc/man/erlang.html#trace-3">http://erlang.org/doc/man/erlang.html#trace-3</a> But this is only the tip of the proverbial iceberg. There's a whole lot more going on there that you can use including sequential traces (that can follow a message around), etc.</li></ul></div><br></div>In brief what I'd propose for Plasma's runtime is this:<br><ol><li>An <b>optional</b> trace facility; perhaps only available in the interpreted bytecode machine but not in the final AOT/JIT-compiled code. If you use it, you pay the price for its overhead but if you don't use it there's no runtime cost.</li><li>At the very least the trace facility should be able to tell you when each function in your code is called. This is something you should be able to turn on and off while running so that you can focus on only those parts of the code that are of interest instead of every line in your whole project.</li><li>Better would be the ability to inform the user at each expression being evaluated: at the very least each top-level expression, but perhaps even nested expressions.</li><li>Conditional expressions should ideally state which path they chose.</li><li>Interim values generated in complex expressions should be something you can request (like Rexx's "Intermediate" trace option).</li><li>All I/O should state explicitly what came in or out in the trace message (truncated for reasonable sizing, of course).</li><li>Queries like Erlang's trace queries to narrow down to precise details which things you want to trace: Trace iff the function foo was called with parameter 1 being "seventeen" and if it was called directly or indirectly via function bar.</li><li>In an absolutely perfect world, the hook points used by the above features should be available to the end-user to extend tracing capacities.<br></li></ol><div><div>Obviously not all of these (indeed not most of these!) can be included in Plasma 1.0, but when designing the run-time opportunities for hooking these in should be considered.<br clear="all"></div><div><div><br>-- <br><div class="gmail_signature">"Perhaps people don't believe this, but throughout all of the discussions of entering China our focus has really been what's best for the Chinese people. It's not been about our revenue or profit or whatnot."<br>--Sergey Brin, demonstrating the emptiness of the "don't be evil" mantra.</div>
</div></div></div></div>