D and AI / dub registry and AI
monkyyy
crazymonkyyy at gmail.com
Sun Feb 22 23:37:52 UTC 2026
On Sunday, 22 February 2026 at 22:39:39 UTC, Julian Fondren wrote:
> On Sunday, 22 February 2026 at 22:31:05 UTC, monkyyy wrote:
>> outside ai; I unironically wrote this code. If you care about
>> the safety of my usage of std.process I would need a better
>> api.
>
> If the AI had used appropriately strong words, you would've
> already asked it for a replacement. My initial all-caps
> statement had DO THIS INSTEAD. SEE? IT'S EASY ENOUGH.
>
> Lukewarm code review is actually really bad.
>
> ```d
> import std.process : execute;
> import std.stdio : writeln;
>
> // misleading variable name!
> string exe(string[] s) => execute(s).output;
>
> void main(string[] args) {
> exe(["curl", args[1], "--output", args[2]]).writeln;
> }
> ```
The safety failure, if I were to believe this to be one, would
need to construct a command without spaces as its being run thru
the "query format" with a prefix and the query format of googles
font api doesnt have spaces functional bash commands usually do;
I could imagine maybe doing something with a semi-colon and then
turning on some deamon. But its not that simple. Similarly the
output file is in an extremely specific place, I dont believe you
could output elsewhere.
and the ai isnt even looking at the user controllable exe, there
is one here:
https://github.com/crazymonkyyy/Google-Fonts/blob/7aa2b3c0238d7c56f95546642cdb5601926c5ee9/source/googlefonts.d#L33
The line the ai was looking at is controlled by googles severs.
And its like curl, theres some curl functions in the std, either
they should work here cleanly or complain up the chain that
constructing a bash command was simpler.
Maybe atila makes this kind of mistakes, but I think the ai is
failing here; from hyper-safetyism there better criticisms to
make.
More information about the Digitalmars-d
mailing list