(a longer meditation)

Many search engines nowadays come up with an AI generated preface summing up the results before showing the hits.

Of course we are not a search engine nor a code writing service, but a community tool helping others becoming better programmers.

I initially said it's a horrible idea, bc the way harangzsolt is proposing would lead to too many problems, (apart from implementation problems)

But let's try:

So I took the liberty to feed a current question into Duck.AI using ChatGPT 4o

> Why is "any" slow in this case?

Answer:

It reads interesting - like always with AI - but requires deeper analysis for disguised non-sense. (Disclaimer: I didn't)

Definitely nothing an amateur could handle. But an expert can draw inspiration from this.

For instance I was intrigued by the idea of $1 being slow because it can't optimize numification.(point 2)

So I asked for clarification, guessing this being about dual-values.

> why is numification of read-only slower

Answer:

Again interesting, but I'm not convinced. The claim (Point 2) that "read-only variables do not benefit from caching" can't be reproduced. Because $1 is indeed also a dual-value.

:~$ perl -MDevel::Peek -E'"42"=~/(\d+)/; say $1; Dump $1; $a=$1+1; Dum +p $1' 42 SV = PVMG(0x5d60b28468a0) at 0x5d60b2868a50 REFCNT = 1 FLAGS = (GMG,SMG,POK,pPOK) IV = 0 NV = 0 PV = 0x5d60b283f5f0 "42"\0 CUR = 2 LEN = 16 MAGIC = 0x5d60b286f0e0 MG_VIRTUAL = &PL_vtbl_sv MG_TYPE = PERL_MAGIC_sv(\0) MG_OBJ = 0x5d60b2868a38 MG_LEN = 1 SV = PVMG(0x5d60b28468a0) at 0x5d60b2868a50 REFCNT = 1 FLAGS = (GMG,SMG,IOK,POK,pIOK,pPOK) IV = 42 #<--- Caching NV = 0 PV = 0x5d60b283f5f0 "42"\0 CUR = 2 LEN = 16 MAGIC = 0x5d60b286f0e0 MG_VIRTUAL = &PL_vtbl_sv MG_TYPE = PERL_MAGIC_sv(\0) MG_OBJ = 0x5d60b2868a38 MG_LEN = 1 :~$
Probably another caching mechanism is meant??? Nope ChatGPT confirms that dual-values are meant:

MY CONCLUSION (so far):

LLM output can inspire good ideas in our context but require an expert to deal with. The wordy answers are often full of hidden pitfalls and contrary to a human being the LLM doesn't even try to cross-check what it (hear-)says.

So

Cheers Rolf
(addicted to the Perl Programming Language :)
see Wikisyntax for the Monastery

IN HINDSIGHT

This should probably better be a meditation in it's own thread.

Disclaimer

This test is far from methodical. I ran this conversation with Duck.AI after the original question already got many answers. Hence the replies might have already been training and influencing the LLM.


In reply to Re^7: AI in the workplace (... in the Monastery) by LanX
in thread AI in the workplace by talexb

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.