TinyGo Programming – Using Artificial Intelligence for Code Generation #5535
Replies: 2 comments 5 replies
|
I think AI is a great tool, but should not be indispensable. I've made heavy use of AI these past few weeks to develop libraries I've always wanted to have but were so far off in the distance due to the speed I could write code at. Thanks to AI I've developed:
So these are fruitful endeavours of developing with heavy dependence on agentic nature of AI. Worth mentioning some of these hit the mark on the first try. Such is the case for ports like the littlefs port which more or less was up to my quality standards out of the first iteration (with some AI introduced bugs). I then put FATFS and littlefs ports through the ringer in the filesystem tests which ironed out bugs present in the original FATFS implementation(!!). Which leads me to the next point: Knowing how to drive LLM tests is Key. Write Red Tests before the implementation and have them fail, then write the actual implementation. After the implementation is done it may have failed due to a bug in the implementation or an incorrect suposition in the test. This is a very productive way to get things done and has let me develop above libraries very effectively. There are other places where I'd never merge a AI driven commit without checking every single line it writes. The abstraction and style of my networking library is something the AI still does not catch on to. This is likely due to there not being high quality, well abstracted networking libraries out there- most of what one finds is just what people could churn out and work and a product of multiple decades of bugfixes upon bugfixes leading to a melding of layers of abstraction when bugfixes cross the layer they correspond to. Similarly LLMs absolutely cannot do 3D design as I've observed in https://github.com/soypat/gsdf, and worse, it's like a black-hole for your tokens. They consume thousands upon thousands of tokens and take many minutes to arrive at a lackluster solution you could have done better in less time. Maybe a more 3D oriented AI model could improve this fact, but LLMs are terrible at this (Claude, ChatGPT, Grok, etc.). Most importantly, write libraries, not applicationsAI is a resource and may not be here forever in the availability and quality we have it today. Leverage it to write libraries that you reuse in the future. Avoid just writing applications and programs that do not allow reusing of the new functionality of value you add to the world. I can't stress this enough, we have the power to basically create an operating system if we so wanted to- but what use is it if we just put all the code in a single repo making it highly unshareable. Build your code library infrastructure and improve the Go ecosystem by adding libraries that were not there for you before. Modularize everything. |
|
Last year, I had an interesting experience that really encouraged me to use AI. Years ago, I decided to build my own dual-slope ADC using a Raspberry Pi Pico and TinyGo. I lost patience and decided to turn to AI. And with AI, I managed to successfully complete the project! Digital Voltmeter with 4 ½ digits - Raspberry Pico |
Uh oh!
There was an error while loading. Please reload this page.
We are experiencing a new technological revolution in which artificial intelligence is changing the way programming is developed, as well as many other sectors.
In recent days, new advancements and features for artificial intelligence—specifically regarding ChatGPT—have been announced.
As a technology enthusiast who really enjoys testing new features, I decided to try out ChatGPT - CODEX.
I’m not here to promote anything, and I know people have other preferences when it comes to AI.
I am developing a power inverter using TinyGo and the Raspberry Pi Pico, with the help of AI.
https://en.wikipedia.org/wiki/Power_inverter
A power inverter is a power electronic device or circuitry that changes direct current (DC) to alternating current (AC).
After providing my specifications to CODEX, I received a ready-to-use program containing all the project details within just a few minutes. From the initial tests, I could see it was running exactly as I had requested. To my surprise, it even suggested additional key features for the project.
The next phase of the project will be hardware development and testing. I will share updates as soon as I can.
My view on AI is that we are embarking on a new path of no return, where those who don't use AI risk being left behind.That is my perspective. I’m not trying to stir up controversy, but I do think it’s important to discuss this.
What do TinyGo developers and users think about this?
All reactions