Is AI not well trained on CIL/assembly code?
Is AI not as well trained with low level languages due to the relatively low amount of information online compared to high level languages?
You have StackOverflow and many other websites with tutorials and QnAs to do with high level languages, but not many for CIL.
I prompted ChatGPT with this:
>Write a C# method called MethodA that calls MethodB.
MethodB does a mathemtical task that will result in an overflow.
MethodA should make sure MethodB is "checked" so that it throws an exception if an overflow happens.
And it provided me this solution which doesn't work:
public class Calculator
{
public void MethodA()
{
checked
{
MethodB();
}
}
public int MethodB()
{
int a = int.MaxValue;
int b = 10;
// This will overflow and throw OverflowException because of MethodA's checked context
return a + b;
}
}
You need to understand the CIL to understand why this doesn't work (hint: it's because it changes the add instructiont o an add.ovf instruction only for code directly inside the checked block).
I'm wondering if this lack of training could cause issues further down the track as AI develops and more developers focus even less on understanding how code works behind the scenes.