Is anyone taking advantage of an AI for programming actions, edicts, etc

Im curious if anyone is having luck leveraging AI to do the dirty work of programming. Personally I only dabble in coding, so I was getting really nervous about having to operate Tinderbox with Regex and Perl; but now that AI can code Im really looking forward to trying out TBs most powerful features.

Any tips or advice for a complete novice?

So far, the experiments I’ve done with asking various AI clients to write Tinderbox action code is that the AI very happily writes what it says is action code, but is in fact unworkable.

That part aside, I’m hesitant to think that AI is a good way for folks to get working program logic, if the person who asked for the code does not understand the code. So, yes, ask AI to write code in languages that one can at least parse for valid and efficient logic.

1 Like

The dangers of trusting translation of unknown quality is well known: Dirty Hungarian Phrasebook - Wikipedia

What’s not clear is why AI, which has little (no?) semantic understanding of what we write is more trustworthy for being a machine. As stated above, I’ve found AI is more use in a context where I know that subject area and gan see the AI’s then-obvious bad guesses.

Noted above is AI doesn’t really get ‘Action code’. This should be expected. Why? The current ChatGPT type AI runs off an LLM: Large Language Model. The ‘Large’ part is pertinent. If you hoover up all the writing on Tinderbox action code I doubt it equates to large. So the old computer rule applies: garbage in, garbage out. The ‘garbage’ in this case being to (unwittingly) use too small a library to train the AI. I suspect it does better at HTML code or ordering a takeaway meal (where the library is larger). AI will doubtless get better, but today it is quite limited outside a quite small number of areas. It only look authoritative as it bad at showing—unlike a human—its confidence in the answer (especially where confidence is based on knowledge rather than data like percentage of correctly delivered take-aways)

Tinderbox action code is a world away from MS Office ‘wizard’, i.e. canned solutions. Tinderbox is a big toolbox so surprisingly often you can find yourself doing something not done before.

Given the comparatively small footprint of the app, if stuck with Action Code you best/first solution should be to ask in this forum. You’ll get a real answer from real people who actually understand the app. :slight_smile:

Footnote. I’ve nothing against AI; it’s massively impressive. I just think we’re all a bit over-optimistic in where and how it is of use. And, Yes, it’s getting better all the time. This answer might be different in a decade’s time.

Contrary to @PaulWalters, I can say that I have had very good experiences in asking ChatGPT to help me write code. But that was in (the statistics language) R rather than in Tinderbox action code. The R community is larger and there is a lot of material on the 'net, which is why I think the quality may be better. But it has worked really well - describing the problem in detail and stating that I want R code has led to good explanations as an answer plus code that I could copy and paste into RStudio.
I feel like I have an inexhaustible research assistant who is at my beck and call whenever I feel the need - something that has escaped me in real life so far :wink:

1 Like

I was only referring to failed Tinderbox action code, which I expected, so no need to disagree with me. Other languages; other more broadly documented and used languages: sure. But, when it comes to code created by any LLM, trust but verify.

1 Like

No need for perl at all, nowadays.

Regular expressions are good to learn: they ought to be part of your toolbox, especially if you do much work with text. You don’t need to worry about the exotic parts, but the basic concept and notation is, I think, important for everyone.

Very simple action code will take you and afternoon or so to master. If you get stuck, ask on the forum and someone is bound to have an answer right away. Often, simple action code is all you need!

A lot of the talk about action code is doing things that aren’t simple but that are (now) possible. Cross those bridges when you come to them.

2 Likes

Paul, I didn’t mean to disagree - just mention my experience. In fact I fully agree as to the causes of differences in results between TBX action code and R code. Apologies if my choice of words caused a misunderstanding.

Using AI to write correct RegEx statements works for me pretty well. The beauty as well is that the AI explains the code to you. The same works for me for CSS which I also use quite a bit in my projects.

1 Like

Interesting. Would it be possible for you to post some specimens of the sort of explanations given by the AI? I’m not asking because I doubt your report but because it would be interesting to see the detail granularity of the description you get back. This sort of tightly scoped use of AI does seem to be an area where it can help us without adding uncertainty into the mix.

1 Like

I’d be interested as well!

Recent example from today:

Gernot:
write regex to extract every word before “:” in each line with text

*** Snip ***
ChatGPT:
You can use the following regex pattern to extract every word before “:” in each line of text:

regexCopy code

\b(\w+)(?=\s*:\s*)

Explanation of the pattern:

  • \b: Word boundary to ensure we match whole words.
  • (\w+): Capturing group for one or more word characters (letters, digits, or underscores).
  • (?=\s*:\s*): Positive lookahead assertion to match only if there’s a colon (:slight_smile: ahead with optional whitespace before and after it.

Here’s an example of how you might use this regex in PHP:

2 Likes

Thanks. Though the code fails as it only match one word, the word before the colon:

You asked for every word before the colon. Of course if one didn’t have a means to check the solution, one might just trust the AI. Oops!

That said, thanks for the example as the explanation is informative, apart from not understanding the semantics of ‘every’.

This example seems consistent with reports from people using GPT to help with coding. It rarely gets the right answer but it gets you most of the way there. Good for the practised user who can likely see the errors. Not good—yet—for the novice. But the systems are getting better all the time so this is encouraging.

Sorry, “every” was only me writing in “English” as german-native ;o)

I usually ask ChatGPT first for the code and then go to https://regexr.com/ to execute. If there is any mismatch I usually correct it directly in regexr.

I use regexr a lot to parse and transform text for my project before copy and paste it into my tbx workflow. That’s a very effective way of working for me.

1 Like

Sorry. My misunderstanding. :slight_smile:

ChatGPT can help a lot speeding up the coding. But you still need to know what is going on in the code. If ChatGPT runs into an error/wrong concept it will close to never fix this but repeat the wrong approach over and over again. Also ChatGPT sticks to the more simple and basic solutions. This maybe fine for smaller projects but will break your architecture for larger ones. But it is very helpful and speeds up the development.

1 Like

So there was a major development last week with ChatGPT, basically OpenAI has added a feature that lets anyone create a custom chatbot with specialized knowledge added in by the user. If there is a library of special syntax than it can be uploaded and GPT will be able to print code using that.

They will also be making a market-place for people to buy and sell these specialized chatbots - called “GPTs”. But just beware, if you make a public GPT you have to include directions to the GPT not to share its instruction set, otherwise the user can ask for a printout of its programing.


I uploaded the pdf to my private gpt, and asked it how to use tinderbox to do my first project. How does this look?

Interesting. Few (any?) real bloopers, but it is easy to see the GPT doesn’t have a semantic understanding of the training corpus. Some of the suggestions, especially in later headings is vague and not really relevant. For instance:

Visual Analysis: Employ visualisation tools in Tinderbox, such as charts or graphs, if available, to visually compare data trends.

Tinderbox doesn’t have ‘charts or graphs’ these and I’m unconvinced this is deliberately obliquely referring to posters. So the advice is generically useful but not really applicable to Tinderbox.

Still, for advice that costs $0, it’s not egregiously wrong.

Pertinent, what is the training corpus for your ‘pdf’ input? IOW, what documents was it given to ‘learn’ Tinderbox? There isn’t a lot of copy out there.

I fed the bot with Tinderbox way, that was it, but I can add more later. I havnt started using the program yet as Ive been too busy traveling. I only have time to run little experiments like this and think about the high-level design of my first few projects

1 Like

That’s good.
Do share your experience with us whenever you use AI for any new experiment.