• Re: Extracting all keys from a json_string

    From et99@et99@rocketship1.me to comp.lang.tcl on Wed Sep 24 16:28:08 2025
    From Newsgroup: comp.lang.tcl

    On 9/24/2025 12:14 PM, Colin Macleod wrote:
    et99 <et99@rocketship1.me> posted:

    You can give him urls of places to get info, but now that we no longer seem >> to have a web interface to comp.lang.tcl I had to paste in your remarks,

    Actually my Newsgrouper project does provide a web interface to comp.lang.tcl and other groups - https://newsgrouper.org/comp.lang.tcl - but it requires
    a login (which can be as an unregistered guest) to get past the login page.

    Thanks for the newsgrouper.org link - I tried it out and Claude can read the login page but can't navigate the interactive guest access button, so copy/paste remains the best approach for sharing newsgroup content with it. Probably makes sense from a security perspective.

    BTW, today we made a breakthrough with the JSON parser. I had the idea this morning to run tDOM on all my 300 test cases and compare outputs with my parser - that's when I discovered two incompatibilities involving duplicate keys like {"a":"first", "a":"second"} or even 2 exact key value pairs.

    My parser uses dict operations which follow "last wins" behavior, while tDOM preserves both keys as separate DOM nodes.

    Claude successfully converted the entire parser to use pure list operations instead of mixed dict/list, eliminating the "shimmering" between different internal representations and enabling full tDOM compatibility. It worked 2nd try, after I told him he missed a ; in an on-the-line comment. Not too shabby! He even gave me a report of everything he changed.

    Both versions now produce identical outputs across 300+ test cases, except for the 2 with duplicate keys, the list version retaining both, so I have a choice between efficiency (dict-based) or compatibility (list-based) in case there's a significant difference. Maybe it's time for a github project to house it, rather than on the wiki page.

    -et



    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From saito@saitology9@gmail.com to comp.lang.tcl on Wed Sep 24 20:25:50 2025
    From Newsgroup: comp.lang.tcl

    On 9/24/2025 7:28 PM, et99 wrote:

    Claude successfully converted the entire parser to use pure list
    operations instead of mixed dict/list, eliminating the "shimmering"
    between different internal representations and enabling full tDOM compatibility. It worked 2nd try, after I told him he missed a ; in an on-the-line comment. Not too shabby! He even gave me a report of
    everything he changed.


    It has been interesting reading your success with Claude.

    I wonder if it can do the same wonders on another project: As you may
    know, Expect doesn't run on Windows anymore. Perhaps you could ask your
    friend to see if he/she can resurrect it. That would be a big win for
    the community. The code and documentation is available so it has a good starting point just like it did with tDOM. Will it be able to actually
    fix problems and produce something new?


    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From et99@et99@rocketship1.me to comp.lang.tcl on Wed Sep 24 22:35:36 2025
    From Newsgroup: comp.lang.tcl

    On 9/24/2025 5:25 PM, saito wrote:
    On 9/24/2025 7:28 PM, et99 wrote:

    Claude successfully converted the entire parser to use pure list operations instead of mixed dict/list, eliminating the "shimmering" between different internal representations and enabling full tDOM compatibility. It worked 2nd try, after I told him he missed a ; in an on-the-line comment. Not too shabby! He even gave me a report of everything he changed.


    It has been interesting reading your success with Claude.

    I wonder if it can do the same wonders on another project: As you may know, Expect doesn't run on Windows anymore. Perhaps you could ask your friend to see if he/she can resurrect it.  That would be a big win for the community. The code and documentation is available so it has a good starting point just like it did with tDOM.  Will it be able to actually fix problems and produce something new?




    It's easy to ask him. You just type in questions, like I just did asking if it was feasible. I imagine you would need a compiler since he can't do that nor can he run code.

    You can paste large amounts of code into his chat window. I think once he sees the code, he will have a better idea. Here's what he said:




    Expect is a C extension for Tcl that automates interactive command-line programs. You write Tcl scripts using Expect's commands like spawn, expect,
    and send to control things like SSH sessions.

    The Windows problem is that Expect's C code relies heavily on Unix-specific system calls:

    Pseudo-terminals (ptys) - Windows doesn't have Unix-style ptys
    Process spawning - Different APIs on Windows
    Signal handling - Windows uses different mechanisms
    Terminal control - Different console APIs

    So it's not just a simple recompile. A Windows port would need to rewrite
    the low-level parts using Windows equivalents like ConPTY for terminal emulation.

    It's definitely technically feasible but would require someone familiar with both the existing Unix code and Windows system programming. The C extension nature makes it more complex to port than pure Tcl, but that's also what
    gives it the power to control interactive processes in the first place.

    Since he has code that previously worked on Windows, this is much more promising! The hard work of the initial Windows port was already done.
    The issue is likely that newer Windows versions, compiler changes, or deprecated APIs broke the existing implementation. I could examine the
    code to identify exactly what broke and suggest specific fixes to get it working again.

    To get started, he can just go to claude.ai - no account
    needed to begin chatting. Share the source and I can analyze what needs updating for modern Windows.
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Colin Macleod@user7@newsgrouper.org.invalid to comp.lang.tcl on Thu Sep 25 10:59:56 2025
    From Newsgroup: comp.lang.tcl

    et99 <et99@rocketship1.me> posted:

    On 9/24/2025 12:14 PM, Colin Macleod wrote:
    et99 <et99@rocketship1.me> posted:

    You can give him urls of places to get info, but now that we no longer seem
    to have a web interface to comp.lang.tcl I had to paste in your remarks,

    Actually my Newsgrouper project does provide a web interface to comp.lang.tcl
    and other groups - https://newsgrouper.org/comp.lang.tcl - but it requires a login (which can be as an unregistered guest) to get past the login page.

    Thanks for the newsgrouper.org link - I tried it out and Claude can
    read the login page but can't navigate the interactive guest access
    button, so copy/paste remains the best approach for sharing newsgroup
    content with it.

    I've now made an update to the newsgrouper code to make this easier: https://chiselapp.com/user/cmacleod/repository/newsgrouper/info/2cb38ef46ff92dd8

    Each article has a "Permalink" at the bottom, these have the form newsgrouper.org/<message-id> . Such links can now be accessed directly
    by any entity they are shared with, skipping the login page.

    Following any further links from the article page *will* require logging
    in, so I don't think this will enable AI scraping (fingers crossed 🤞).
    --
    Colin Macleod ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ https://cmacleod.me.uk

    FEED FEED FEED FEED FEED FEED FEED FEED
    GAZA GAZA GAZA GAZA GAZA GAZA GAZA GAZA
    NOW! NOW! NOW! NOW! NOW! NOW! NOW! NOW!
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From et99@et99@rocketship1.me to comp.lang.tcl on Thu Sep 25 14:07:37 2025
    From Newsgroup: comp.lang.tcl

    On 9/24/2025 5:25 PM, saito wrote:


    I wonder if it can do the same wonders on another project: As you may know, Expect doesn't run on Windows anymore. Perhaps you could ask your friend to see if he/she can resurrect it.

    I've started a new thread on this. I'm afraid I've polluted this one with too much AI talk.

    I think it's doable if you have all the build scripts and source code. See you in the new thread.

    -et

    --- Synchronet 3.21a-Linux NewsLink 1.2