Skip to content
Tcl Source Code History Of Ticket 0ec75b9a080ccc65
Login

History Of Ticket 0ec75b9a080ccc65

Artifacts Associated With Ticket 0ec75b9a080ccc65

  1. Ticket change [f8ea6e8ceb] (rid 148314) by anonymous on 2016-08-13 08:08:46:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/plain"
    4. comment initialized to:
      Command ::use_strict
      
      Each time a variable is shimmered, the interpreter launch an exception. Similar idea of "use strict" from javascript.
      
      This can prevents bad design patterns or accidental shimmering.
      
    5. foundin initialized to: "8.6"
    6. is_private initialized to: "0"
    7. login: "anonymous"
    8. priority initialized to: "5 Medium"
    9. private_contact initialized to: "2fc3374731259c55403bee5cb02eec27c4be5d79"
    10. resolution initialized to: "None"
    11. severity initialized to: "Minor"
    12. status initialized to: "Open"
    13. submitter initialized to: "anonymous"
    14. subsystem initialized to: "- New Builtin Commands"
    15. title initialized to: "Strict mode"
    16. type initialized to: "RFE"
  2. Ticket change [8845f38a88] (rid 148315) by ferrieux on 2016-08-13 09:05:59:

    1. icomment:
      Shimmering is in aspect of a *value*'s life, not a variable.
      This distinction matters, because the value can be shared or copied, with different outcomes on whatever behavior we try to attach to it.
      
      Moreover, calling an arbitrary command from deep within the interpreter (at the time the shimmering is decided) raises many implementation issues.
      
      Last, letting the script level *act* on the internal status of values simply violates the EIAS principle (Everything Is A String) and leads to varied impredictable situtations.
      
      Note we do violate it a bit already with the explicit introspection in ::tcl::unsupported::representation, but the way it is serialized tries to discourage decision-making.
      
      In the same vein, a "for-your-eyes-only" variant that (e.g.) writes to stderr when shimmering or Dup'ing (to address the branching history of a value) an intrep, could be useful, and not more dangerous.
      
      Deal ?
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
  3. Ticket change [8d2d29674a] (rid 148316) by ferrieux on 2016-08-13 09:35:21:

    1. icomment:
      Also, be warned of two points:
      
      (1) Even in its mild, "display-only" form, the feature would have a non-negligible perf impact.
      
      Indeed, binary compatibility with extensions precludes adding any field directly to values or internal reps, so the "you're being watched" flag must be implemented as a pointer hash, with associated check on each Dup or Free. This means that only a few values could be watched at any given time, and also that the feature would likely be non-mainstream (macro-controlled).
      
      (2) Displaying any meaningful context for the Dup or Free operation would be extremely hard. The setFromAnyProc of each obj type tends to call TclFreeIntRep on the old type without any kind of politeness like "I'm shimmering to Y".
      
      Hmm. That's a hell of a set of restrictions, right ?
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
  4. Ticket change [cd6d5d56bc] (rid 148317) by anonymous on 2016-08-14 09:52:11:

    1. icomment:
      Using this feature is possible to create some optimizations in the interpreter. It's only an idea.
      
    2. login: "anonymous"
    3. mimetype: "text/plain"
  5. Ticket change [aee015ee34] (rid 148318) by anonymous on 2016-08-14 10:05:20:

    1. icomment:
      Another idea is to use a debug flag to print to stderr when some shimmering happens.
      
      For example by default the variable ::warn_shimmering is set to 0. But if this variable is set to 1 (or another true value)
      
         set ::warn_shimmering 1
      
      then the interpreter print to stderr a warning.
      
      It's similar to your idea.
      
    2. login: "anonymous"
    3. mimetype: "text/plain"
  6. Ticket change [e385e0c68a] (rid 148319) by ferrieux on 2016-08-14 12:22:57:

    1. foundin changed to: "8.7"
    2. icomment:
      If the only incentive is to help optimize "the interpreter", then that's no news, and mimicking another language's implementation is not the best path to it (see my remarks about the lack of context for Dup and Free).
      
      Accordingly, I'm changing the title to something that's clearer to core developers, the category to the proper one, and also downgrading this ticket to lowest priority, since it's a long-term goal (for Tcl9) that would likely be more interesting *after* current work in progress on obj types is completed (more than 1 intrep ; direct conversions between "friend" types, etc.)
      
    3. login: "ferrieux"
    4. mimetype: "text/plain"
    5. priority changed to: "1 Zero"
    6. severity changed to: "Cosmetic"
    7. subsystem changed to: "10. Objects"
    8. title changed to: "Debug display on shimmering"