AI and FC..

For general Flowcode discussion that does not belong in the other sections.
Post Reply
MJU20
Posts: 249
http://meble-kuchenne.info.pl
Joined: Tue Dec 08, 2020 5:11 pm
Has thanked: 75 times
Been thanked: 51 times

AI and FC..

Post by MJU20 »

Been playing with AI chats for a while now. This is a nice way to generate code too..

I've made several complex VBA projects and even MS Dos batchfiles (don't ask me why) :-)
But.. this can be handy in FC too.

Just ask the AI engine to generate code that does something specific and with a click of the mouse: there it is..

How will FC deal with this new "technology"?
I generated this code that calculates the day of the year:

Code: Select all

#include <stdio.h>

// Functie voor het bepalen of het jaar een schrikkeljaar is
int isLeapYear(int year) {
  if (year % 4 == 0) {
    if (year % 100 == 0) {
      if (year % 400 == 0) {
        return 1; // Schrikkeljaar
      }
      return 0; // Geen schrikkeljaar
    }
    return 1; // Schrikkeljaar
  }
  return 0; // Geen schrikkeljaar
}

// Functie voor het berekenen van de dag van het jaar
int getDayOfYear(int day, int month, int year) {
  int daysInMonth[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
  int dayOfYear = day;

  for (int i = 0; i < month - 1; ++i) {
    dayOfYear += daysInMonth[i];
  }

  if (month > 2 && isLeapYear(year)) {
    ++dayOfYear; // Voeg 1 dag toe aan februari in een schrikkeljaar
  }

  return dayOfYear;
}

int main() {
  // Datumwaarden
  int day = 12;
  int month = 7;
  int year = 2023;

  // Bereken de dag van het jaar
  int dayOfYear = getDayOfYear(day, month, year);

  // Uitvoer
  printf("Dag van het jaar: %d\n", dayOfYear);

  return 0;
}
And ask myself if this will work in FC on a MCU that I choose?
Let's open the discussion in this topic.

At this moment I don't have the access to program an MCU (to test the code) but will be glad to read what other people think about FC and AI.

kersing
Valued Contributor
Posts: 162
Joined: Wed Dec 02, 2020 7:28 pm
Has thanked: 68 times
Been thanked: 58 times

Re: AI and FC..

Post by kersing »

The only thing the AI does is copy someone else’s code. It doesn’t know if that code is correct and performs to requirements. As a result I am very wary of AI generated (copied) code because I don’t know the copyright status (or worse, maybe the code implements a patented algorithm) and if I’m not familiar with the programming language there is no way for me to determine if the code is correct.
I prefer to think about the problem and solutions myself so I can incorporate the exceptions that require handling as well. For microcontroller applications that need to perform tasks for years without reset that (at least to me) still feels like the safer option.

chipfryer27
Valued Contributor
Posts: 1181
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 287 times
Been thanked: 417 times

Re: AI and FC..

Post by chipfryer27 »

Hi

A well known AI informs that is doesn't include anything after a few years ago (well maybe if you pay them it might). That reinforces Kersing's comment about only copying, or rehashing what's already published within defined parameters.

If it hasn't "read" it before it doesn't know about it. That brings the thought that if it can only rehash existing work, and we adopt AI mainstream, where is the creativity? Will anything truly new be created? Surely no difference from giving a team of monkeys typewriters and waiting for them to randomly write Shakespeare, except quicker?

I find it laughable that at present "Hollywood" is on strike. The poor little grossly self obsessed, overpaid luvvies have eventually realised that they aren't really needed. Boo-hoo CGI/AI etc will soon do away with me.... that isn't write (pun intended). Funny, I didn't see them on strike or supporting other industries truly affected by automation. Didn't see Streep & Co boycotting cars as factories turned to robots or the like. Don't recall hearing many speeches during the Oscars about industries moving production to countries offering cheaper labour. I see no difference in principle.

To me, it can rehash existing works very efficiently within given parameters, but it isn't creating as such and has no understanding (much like the luvvies :) ).

Regards

PS
I just asked "AI" to create a joke about a duck and a ball point pen. The result:-
Why did the duck become a writer?

Because it wanted to put its quack into ink and become a "quill-iant" ball point pen!
Don't think the writers of "Big Bang" have much to worry about :)

MJU20
Posts: 249
Joined: Tue Dec 08, 2020 5:11 pm
Has thanked: 75 times
Been thanked: 51 times

Re: AI and FC..

Post by MJU20 »

I expected such reactions already :-)
Are there really no benefits to consider?

I used to be "orthodox" in website development as well. I learned HTML by sitting in Notepad for hours, days, and weeks practicing, testing, trying, and starting over.
When a friend introduced me to an HTML editor, I was truly "anti."

After a while, my friend started creating faster and more beautiful websites than me, while I was still stuck with my <HTML><HEAD>...
Then another friend introduced me to a content management system for websites, and I have to admit, it was a significant advancement.

What I mean is that I still have friends who insist on programming everything in C, maybe they'll consider using LUA, but they think "Python is a mess"... If we all keep digging in our heels, we won't progress.
When you've invested a lot of time and effort in learning something, it's not easy to simply let go and adopt a simpler method.

I believe that based on the resistance I'm seeing, AI might become the new normal in the coming period.

I understand the copyright issues, but we no longer have control over that on the internet. Images, music, texts, everything can be copied. That's a discussion from the 2000s.

So, what can we use AI for in a positive way in for example Flowcode, given that we understand its limitations?

It's a fact that AI mostly generates reproductions of what it has been trained on.
However, it's amazing what I've been able to accomplish with it so far.
I also feel like these systems can think along with me.
I have had them generate scripts that I believe are not easily found on the web. Somewhere in there, they seem to be thinking along.

I think we'll have to learn to live with it (love it or hate it).
Can we make something positive out of it for the time being?

kersing
Valued Contributor
Posts: 162
Joined: Wed Dec 02, 2020 7:28 pm
Has thanked: 68 times
Been thanked: 58 times

Re: AI and FC..

Post by kersing »

Currently AI is just rehashing someone else’s (possibly faulty) code. That means you can use what it generates if you are able to judge if the result solves your problem. For flowcode that code generation be more difficult as it is a visual programming language and it works close to the hardware, Python and C are easy to generate text for and there is a larger code base for training.

Dismissing the copyright and patent issue is a mistake. There are several organizations in the USA that are starting procedures against those exploiting AI because their copyrighted works have been used to train the AI. Until there is clarity you expose yourself to litigation. Probably not an issue for the average amateur using an AI to generate some code for home use, definitely a consideration for commercial entities that make money from the results. Consider the Oracle against Google lawsuit regarding Java API an example of a situation where you don’t want to find yourself.

chipfryer27
Valued Contributor
Posts: 1181
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 287 times
Been thanked: 417 times

Re: AI and FC..

Post by chipfryer27 »

Hi

I guess it's a bit of which side of the fence are you on? My bug is calling it AI, implying it has intelligence, the ability to understand and learn well, and to form judgments and opinions based on reason. Much debate in a similar vane has taken place regarding driverless vehicles, what to do in an emergency, crash into a child or an elderly person? Perhaps an actual driver would have read the road better and not got into the situation in the first place?

I think we should differentiate between AI "chat" and other AI too (but the media doesn't appear to).

I get that there are huge opportunities. Recently a well known Telco announced that it's moving customer service to AI to better serve us (or words to that effect) but as we all know from experience, any such move is not designed to help us, but for them to be more profitable. Online banking etc was to help us, but now there are few High St. banks. We chose that route now we live with it.

I do think it has a place in some quarters. If it can analyse a particular scenario i.e. it has parameters, then it can quickly look at every similar scenario and return not only the most popular/suitable "answer" but obscure ones too. To me at present it is just a glorified search engine. If there are no examples to copy then there are no great answers (well apart from the quillarious duck pen joke that I'm now taking to the "Fringe" this year).

In research it probably has a great future. History is basically knowing what happened through someone telling you about it. If I could quickly scan through everything written about an event then I'd appear to be very smart indeed if you asked me about the subject. Teachers are facing big issues with the use of AI by students.
I understand the copyright issues, but we no longer have control over that on the internet
I think there are many governments, police forces and lawyers that would disagree with you on that. You mention that it is saving you time by producing code, but that work originated from a human, somewhere. If we no longer care about copyright, please forward all your hard work as that is what you are advocating and if you include your customer lists too I will buy you a beer, virtually of course :)

To narrow it down to writing code, I still agree with Kersing's comments above. However I might use it in a non critical way, say to quickly knock up a web page (or even content) but how long before each lawyer's web page quickly looks like every other?

Is the future really just employing someone to operate a keyboard connected to an AI machine? and if so how long before I ask the AI the same question you do and eliminate the need for you (as an employee or web designer or the like, not like a Terminator would)?

In saying that I'll end with this
David Krueger, a Cambridge University assistant professor who signed the Statement, said: "Future AI systems may be more dangerous than nuclear weapons. We should think long and hard before building them.

Possible future headline: Maybe the spotty twenty something that was the root cause of the nuclear exchange didn't understand the code he entered as his degree was obtained from an AI generated thesis.......

Regards

PS
I'm not totally against current AI "chat", I just don't believe in the hype I read about it

BenR
Matrix Staff
Posts: 1756
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 446 times
Been thanked: 606 times

Re: AI and FC..

Post by BenR »

There are certailny uses for it, for example AI is finding better more optimised ways of doing things that are used all the time, for example the recent matrix multiplication optimisation. Here there was a clear proplem and a clear goal and the AI tried solution after solution until it came up with a more optimised answer that was previously unknown.

https://www.quantamagazine.org/ai-revea ... -20221123/

For these types of clear situtaions AI could be very useful. The next advance being talked about is in biology and medicine and so may lead to new cures and preventions which would be amazing.

I think the general AI being worked on is less exciting, far more dangerous and thankfully still a way off. It's certainly useful to get your foot in the door e.g. with an algorythm to do something specific but in the real world you still need to take that generated algorythm and both understand it and tweak it to be able to properly fit the situation and the rest of the software. Just taking code and running with it is likely to lead to problems you have no idea on how to solve. This also goes for copying code direct from e.g. stackoverflow.

The main problem I see with generative text/video/audio models of AI is it being used by scammers, this is going to become more and more of an issue and may well flood and undermine the internet as a whole. Saying this I am in my spare time working on a java game and I used to use fiver to generate the odd bit of artwork via freelance artists. It was time consuming and frustrating. Using midjourney I was able to completely redo all of the artwork for the entire game in a few hours and now it's all themed and flows well together and looks great. I also tried to generate dialogue for a mission and in 5 seconds it generated a more detailed and well structured mission script then I could ever have done. How much of this is copyrighted who knows? The good thing was it took my ideas and fleshed them out so it still needed me as the inspiration. Nice to feel like your having an input :lol:

Post Reply