secondlife / jira-archive

2 stars 0 forks source link

[BUG-233743] Inline instantiations in for loop initializers #10786

Open sl-service-account opened 1 year ago

sl-service-account commented 1 year ago

How would you like the feature to work?

Quite a few people have come to me to fix their GPT-4 scripts for Second Life. The one thing that it keeps messing up on is initializing for loops. GPT thinks that LSL has the ability to do the following:

for(integer i=0; i < 10; i++) { llOwnerSay("Loop: " + (string)i); }

Where the i variable is initialized in the intializer section of the for loop declaration.

My feature suggestion is to just implement this feature of the LSL scripting system. Not only does it just make sense as a feature but it also will allow anyone using GPT to always just get their scripts to run without manually fixing this very simple mistake.

Essentially, it would no longer be a mistake.

Why is this feature important to you? How would it benefit the community?

It just makes sense and should be a very simple feature to implement.

Original Jira Fields | Field | Value | | ------------- | ------------- | | Issue | BUG-233743 | | Summary | Inline instantiations in for loop initializers | | Type | New Feature Request | | Priority | Unset | | Status | Accepted | | Resolution | Accepted | | Created at | 2023-04-11T11:19:28Z | | Updated at | 2023-04-12T18:22:45Z | ``` { 'Build Id': 'unset', 'Business Unit': ['Platform'], 'Date of First Response': '2023-04-11T23:12:22.438-0500', 'How would you like the feature to work?': 'Quite a few people have come to me to fix their GPT-4 scripts for Second Life. The one thing that it keeps messing up on is initializing for loops. GPT thinks that LSL has the ability to do the following:\r\n\r\nfor(integer i=0; i < 10; i++)\r\n{\r\n llOwnerSay("Loop: " + (string)i);\r\n}\r\n\r\nWhere the i variable is initialized in the intializer section of the for loop declaration.\r\n\r\nMy feature suggestion is to just implement this feature of the LSL scripting system. Not only does it just make sense as a feature but it also will allow anyone using GPT to always just get their scripts to run without manually fixing this very simple mistake.\r\n\r\nEssentially, it would no longer be a mistake.', 'ReOpened Count': 0.0, 'Severity': 'Unset', 'Target Viewer Version': 'viewer-development', 'Why is this feature important to you? How would it benefit the community?': 'It just makes sense and should be a very simple feature to implement.', } ```
sl-service-account commented 1 year ago

JIRAUSER341305 commented at 2023-04-12T04:12:22Z

+1 here…  While I loathe the idea of letting ChatGPT (or any other AI chat rubbish) in any way influence the development of LSL…  This is a feature that would be very much appreciated.

The number of times I forget that LSL {}can't do this{}, because just about everything else {}can{}…  C/C++/C#/D can, JavaScript can, Python and even PHP can (albeit a technicality — they don't require defining variables), so on and so forth.

That said…  I have considered jira'ing this a time or dozen, but never bothered because it is a pretty minor issue to work around, and could require changing the LSL parser (when was the last time that happened?) in a fairly invasive way for really not a lot of gain.  But if you guys are ever poking around in there…  Please, do, give us this little spoon full of sugar!  (But absolutely not because of anything to do with ChatGPT's LSL ineptness.)

sl-service-account commented 1 year ago

Extrude Ragu commented at 2023-04-12T04:45:20Z

I'm not a fan of the idea of letting ChatGPT or similar tools dictate how LSL should work, ChatGPT frequently hallucinates whole new function names and LSL behaviour in all kinds of inconsistent ways. ChatGPT is what needs to get better in this regard IMO.

With that said, as a user who very frequently scripts in SecondLife, I would greatly appreciate being able to inline variable initialization for loops etc. If nothing else, the more weird quirks of LSL that can be ironed out to behave like modern languages the better, it's a whole lot less weight on my brain remembering all of the weird behaviors,

 

sl-service-account commented 1 year ago

Peter Stindberg commented at 2023-04-12T06:08:02Z

I refrained from commenting when I saw it yesterday, and only shared it for a chuckle among fellow scripters. I totally agree with the two other commentors that wrong results from ChatGPT should not - under any circumstances ever - influence the development of LSL.

That said, is missing inline declaration really the big deal? Yes, I stumbled across it as well when I started scripting. Once or twice. Then I knew it and didn't stumble across it ever since. There are other, way more pressing, shortcomings of LSL that beg for fixing.

In fact, a point could be made that NOT being able to inline-define variables might even be BETTER for newcomers to LSL, as it helps/forces them to write more structured code.

sl-service-account commented 1 year ago

Spidey Linden commented at 2023-04-12T18:22:42Z

Issue accepted. We have no estimate when it may be implemented. Please see future release notes for this fix.