paralleldrive / sudolang-llm-support

SudoLang LLM Support for VSCode
MIT License
1.08k stars 74 forks source link

This explains how GPT-4 understands sudolang #9

Closed liusida closed 1 year ago

liusida commented 1 year ago

Using pseudocode to interact with LLMs is definitely a brilliant idea!!! I think it is very useful and helpful, thanks!

To add my two cents, I also asked ChatGPT(GPT-4) to explain the Minimum Salary example to see how GPT-4 understands the code. Here is the conversation:

https://chat.openai.com/share/fe27a52f-44c0-460a-b857-e848469048c5

It seems that, because we instruct GPT-4 to give a definite response, GPT-4 is trying to do that with many assumptions. GPT-4 said it would be "educated guesses". So, it seems we can also use other pseudocode, e.g. python-like or c-like, etc, as long as it is based on some popular languages, it'll work as well.

ericelliott commented 1 year ago

Yes, you can use any popular language, but SudoLang has significant advantages over Python and Javascript. Simple syntax, a virtually infinite library of functions that can be automatically inferred, declarative, natural language constraints which can express complex ideas and algorithms with a few words, composable interfaces with optional typing and type inference, semantic pattern matching, /commands...

It's a curation of all the best features from the best programming languages in history, and once you get familiar with it, it's easy to miss its features and usability in other languages. In fact, I only write SudoLang these days, and transpile to other languages.