Shop OBEX P1 Docs P2 Docs Learn Events
ChatGPT as a coding tool — Parallax Forums

ChatGPT as a coding tool

I am surprised there has not been any discussion on ChatGPT as a tool for coding in SPIN.

I see Adafruit is using ChatGPT openly as a driver coding tool;
https://blog.adafruit.com/2023/09/17/adafruit-weekly-editorial-round-up-audio-synthesis-with-circuitpython-attribution-of-openai-chatgpt-in-open-source-code-published-by-adafruit-more/

According to the email ChatGPT used Adafruit libraries as a training tool because they were freely available.

So I wonder if anyone has used ChatGPT on SPIN1 or SPIN2 in a similar way.

How would we know if SPIN is included in ChatGPT's training?

Comments

  • evanhevanh Posts: 15,910

    There's been something like four topics on this already. They got dumped on pretty quick though - the code gen is unreliable for all languages. Spin is a little worse though because ChatGPT plain gets the syntax wrong here too.

    ChatGPT works about as good as a search engine at finding snippets. Funnily, that's kind of what the answers look like too - Mashed up snippets.

  • Can't find the thread but @Wuerfel_21 summed-up this AI illusion perfectly.

    Try throwing it a task in a more familiar language, it's a joke.

    Craig

  • While my personal opinion is that ChatGPT has a long way to go for coding, it does work quite well for certain tasks when prompted properly. The current success of my ChatGPT usage revolves heavily on my research on how to write high quality prompts which was driven by a conversation I was involved in at the University of Texas at El Paso's Aerospace Center at a time when I zero experience with AI. In a nutshell, one example given was
    "the difference of asking ChatGPT to write you a poem about a mountain peak view versus asking it to write a poem about the view from mountain peak where both lakes and forests can be seen in the distance that you reached after a 4 hour hike and a day with spectacular weather and puffy clouds."
    You will get two vastly different results, with one being rather decent.

    I have two different SPIN1 programs that I asked ChatGPT to write for me that work fine, contain rather clean code, actually include understandable comments, and abide by SPIN1 techniques I see from experienced SPIN1 coders. Although, keep in mind that both were rather simple programs that in "real life" would really only be a portion of a typical Propeller based project.

    I was at PCB West in Santa Clara yesterday and several people spoke about AI utilization in PCB Design. There were some varying opinions, but companies are developing solutions now. It may be 5-10 years before AI is directly involved in PCB Design, but it is coming. I was part of a 4 person panel for one of the free sessions and a question about AI was asked of us on the panel. My response was that as of today, AI is simply another tool in the toolbox that might help you solve something or it might just help you fine tune things, but it isn't taking over any jobs soon.

  • evanhevanh Posts: 15,910

    There is a marketing tendency to relabel existing tools and algorithms as being AI when they previously had a different name. So, optimising tools of days gone by get an AI badge added with no neural nets involved at all.

    Also, where actual neural nets end up being used for real will obviously expand. As you've mentioned, many tools for optimising laborious tasks will continue to spring up. Some might even replace older tools I guess.

  • Keeping the post alive . . . .

    I see in the latest Parallax Education newsletter, Ken said

    "We're starting to answer these questions in our new AI tutorials.
    The tutorials show the student how to apply a chatbot to write Python scripts for the micro:bit and cyber:bot.
    We need to introduce this to our students so they can begin to develop the skills to productively use AI, and we're doing it with microcontrollers and robots.
    Please let us know what you think of the new AI tutorials"

    Is it possible to implement similar ideas for SPIN1 and SPIN2 programs?
    Can an AI chatbot be trained on existing SPIN programs in OBEX or elsewhere?

    Recall from the header post, ChatGPT was trained on Adafruit libraries;
    https://blog.adafruit.com/2023/09/17/adafruit-weekly-editorial-round-up-audio-synthesis-with-circuitpython-attribution-of-openai-chatgpt-in-open-source-code-published-by-adafruit-more/
    According to the email ChatGPT used Adafruit libraries as a training tool because they were freely available.

  • I tried ChatGPT out with a simple request. It knows Spin and gets most of it right, but makes mistakes typical of requests I've seen in other languages.

    Try this and see what you get:
    For the Parallax Propeller 1, write code that blinks an LED on for two seconds, then off for two seconds, in a loop

  • On the other hand, Phind.com (designed on top of ChatGPT for coding) got it right the first time. Its first response was in C - then I asked it for the same thing in Spin and it worked.

    Also, Phind will explain how the code works and gives links to where it learned it.

    https://www.phind.com/

  • HH Posts: 21

    Its a tool; as with most tools, you need to understand your tool (chatGPT) and what your working on (programming / language) to use it properly.

Sign In or Register to comment.