top | item 40307678

(no title)

rabbits77 | 1 year ago

I have been unimpressed with ChatGPT4's ability to generate code for problems of even medium complexity. Even if given partial or complete code from another language and told to translate it!

If we're seeing a heavy drop in StackOverflow usage then my guess is that Stack Overflow was getting most traffic from some very basic queries and ChatGPT is eating that base out from under them. Better for StackOverflow that they partner with OpenAI and focus on serving the higher end that they have left.

discuss

order

williamcotton|1 year ago

Does this interaction seem like low complexity?

https://chatgpt.com/share/e92bf633-4815-45bc-8ae9-9068fe257d...

[EDIT: pasted in wrong link]

There is basically no information out there on how to write error tolerant parsers for language servers. My entire knowledge before starting work on this was someone giving me a three sentence explanation on the F# Discord for an approach using an intermediary AST doing a tolerant first pass.

The key with handling medium and large complexity tasks with an LLM is to break it up into less complex tasks.

First, I showed an example of a very simple parser, parsing floats between brackets and asked for a response that parsed just strings between brackets, then I asked:

I'm working on a language server for a custom parser. What I really want to do is make sure that only floats are between brackets, but since I want to return multiple error messages at a time for the developer I figure I need to loosely check for a string first, build the AST, and then parse each node for a float. Does this seem correct?

I get a response of some of the code and then specifically ask for this case:

can you show the complete code, where I can give "[1.23][notAFloat]" as input and get back the validatedAST?

There's an error in the parser so I paste in the logged message. It corrects the error, so I then ask:

now, instead of just "Error", can we also get the line and char numbers where the error occured?

There's some more back and forth but in just a few iterations I've got what amounts to a tutorial on using FParsec to create error tolerant parsers with line and column reporting ready for integration with the language server protocol.

If anyone would like to point me in the direction of such a tutorial that already exists I would very much appreciate it!

JTyQZSnP3cQGa8B|1 year ago

You need an account to see your link.