[p-dev] Tracing facilities...

Michael Richter ttmrichter at gmail.com
Fri Jul 28 15:15:30 AEST 2017


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:


   - http://www.snobol4.org/docs/burks/tutorial/ch8.htm  (SNOBOL4's
   debugging and tracing facilities)
   - http://www.kilowattsoftware.com/tutorial/rexx/trace.htm  (Rexx's
   debugging and tracing facilities: doesn't cover the TRACE() BIF but that's
   a minor enhancement)
   - Erlang has a bewilderingly powerful set of tracing facilities that you
   can nose around in beginning here:
   http://erlang.org/doc/man/erlang.html#trace-3  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.


In brief what I'd propose for Plasma's runtime is this:

   1. An *optional* 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.
   2. 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.
   3. 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.
   4. Conditional expressions should ideally state which path they chose.
   5. Interim values generated in complex expressions should be something
   you can request (like Rexx's "Intermediate" trace option).
   6. All I/O should state explicitly what came in or out in the trace
   message (truncated for reasonable sizing, of course).
   7. 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.
   8. In an absolutely perfect world, the hook points used by the above
   features should be available to the end-user to extend tracing capacities.

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.

-- 
"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."
--Sergey Brin, demonstrating the emptiness of the "don't be evil" mantra.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.plasmalang.org/list-archives/dev/attachments/20170728/95ec52fa/attachment.html>


More information about the dev mailing list