Thursday, October 3, 2024

Where Will We Go With AI

 As AI becomes a more powerful coding tool I could see it taking us in two directions.  One would be more and more bad high level code that runs slower and requires more hardware, the other would be more efficient low level code that runs faster and requires less hardware to do more than we do today.

Let's explore these two options and see how we can get to option two.

Option one requires looking at the history of coding from the beginning up until now.  In the beginning machine instructions were programmed directly.  It was very difficult and time consuming to get computers to do anything.  It required skills that only a small number of people had.  These people soon realized that they could create easier ways to tell the computers what to do.  

Slowly, new programming languages were developed that could be parsed by the computer and compiled down to those original machine instructions.  As language design matured, higher level languages were created that were more human readable and allowed for more abstract concepts to be represented in code.  These languages allowed more people to begin writing code. This has been great in many ways, but it means that there is a huge amount of poor quality inefficient code running on our computers today.  We responded by building faster computers and finding ways to optimize parsers and compilers to generate better code.  This has gotten us pretty far, but it is hard to keep up with all the ways people find to create inefficient code.

With the help of AI people will be able generate exponentially more code.  Many more people will be able to write code.  Without the correct training AI will not make the best possible code.  It will be so easy to just have the AI write more code, that people wont bother with well designed reusable code anymore.  Left alone this will lead to slower systems and code that humans can't maintain.

Option two requires thinking more about what the potential for AI could be.  Currently we have been training AI to output code in all these high level languages that are easy for humans to use.  AI could be trained to use low level languages, or to generate executable binaries without any intermediate code.  I think we have somewhat of an aversion to doing this since it would be harder to understand what has been produced by the AI.  We would need the to work out ways of testing the end product.  The AI could help with this.  It could write tests in a higher level language that humans can understand and trust.

Option two sounds a lot better to me, but also much harder to achieve.  I'm guessing we will get mostly what I described in option one for now.  Eventually we may move towards something better though.  The only way to find out is to keep moving forward, and maybe try to have a hand in guiding things where we want them to go.

Wednesday, September 25, 2024

Teaching AI to Code is an Example of The XY Problem


The XY Problem (https://en.wikipedia.org/wiki/XY_problem) is when you have a question about a solution that you have already come up with for a much different problem.

Code is written to create programs that solve problems for people.  Programs keep track of appointments, send messages to other people, and various other things that keep our lives running.  A properly trained AI could do all these things without writing any code.

We have to step back and think about the problems that we are trying to solve.  What do we really need computers to do.  These are the real problems we need AI to solve.  This might take several layers of stepping back.  Some whole industries exist to track and store data for other industries that solve some of these problems.  Do we really need traditional websites?  AI could be connected directly to data and display it however we want it displayed.  We will still need computer hardware.  AI has to run somewhere.

As a developer this is much scarier than AI writing code.  This would mean we wouldn't need to write code, or review AI written code.  There just wouldn't be as much code anymore.  AI may still make use of some things, database drivers, video codecs, lower level things that could still be useful to connect to existing systems or display content encoded in specific formats.

These AI systems would of course be different than what we have now.  They would be trained on very different kinds of data, not text, not code.  I don't know how to build an AI like this, but I'm very confident that someone can figure it out.

The future is a scary and exciting place.

Monday, October 25, 2021

Coding

 


I'm not sure where I heard this, and it wasn't worded this way, but it helps to think about coding this way.

Basically, any program you write is just meant to translate your problem into an already solved problem in computer science, or put another way, translate your input data into data that can be passed to an existing algorithm.

Tuesday, September 28, 2021

Python Particle Simulation Update

 I don't have much to update about, other than the fact that the simulation still makes sense.  I haven't run into any problems that will prevent me from completing it.  I think I have found some python libraries that will help me in calculating intersection and with graphically displaying the simulation.  Currently I am using the following:

Pyglet - for graphics and possibly for timing of events

Sympy - for calculating intersection of particles using Rays

That's about all that is happening in my coding life right now.

Thursday, September 16, 2021

Python Particle Simulation

 I have started working on a particle simulator in python.  I have limited knowledge of Quantum Mechanics, but thinking about the weird way particles and entanglement work has lead me to some ideas that I want to try in a computer simulation of particles.  My idea is that certain properties not existing, or being described by probability functions will allow the simulation to run very fast with large numbers of particles.

I have been thinking about this for several years and made other attempts to get started. The current attempt is the furthest I have ever gotten. I have finally gotten it clear in my head what I want to do.

I am going to setup an array of particles.  Each particle will have a position and a direction.  When 2 particles interact I will optionally create more particles and select new directions for each particle.  At that point I will, using the direction of each particle, look for future interactions with other particles.  These interactions will go onto a queue that will be processed starting with the earliest event in time.

My thought is that doing this will mean that I only need to loop over the particles when an interaction happens, not for every frame like you would in a traditional animation type program.

I still haven't worked out all the details.  It is possible that it just doesn't work, or doesn't make sense in some way.

Wednesday, March 18, 2020

Canvas Paint

Here is another small JS project that I built quite a few years ago.  It was basically just an exploration of the canvas tag, which was somewhat new at the time.  I called it "Canvas Paint".  It allows you to draw on the canvas.  You can change the color and width of the brush by changing the numbers in the boxes and clicking either "Set Color" or "Set Width".

Wednesday, March 11, 2020

Life Game

Previously I posted about a game (really a simulation) that I made several years ago.  I called it the Fish Game.  A few years later I made another very similar simulation that I called "Life Game".

It is similar, but quite a bit more complex, and I think somewhat better written code.  In this version there are three life forms; fish, bugs, and plants.  The fish eat the bugs.  The bugs eat the plants.  The plants gain energy each frame as if they are getting energy from the sun.  Each life form has a fairly large set of properties.  These are copied to the individual life forms as they are created.

Where Will We Go With AI

 As AI becomes a more powerful coding tool I could see it taking us in two directions.  One would be more and more bad high level code that ...