I think to make a computer sentient, its not what you can code that makes the difference, it's what the computer itself can code. If you can tell the computer to alter its own programming, and make it for the majority bug-free, even if it only alters simple things, it can theoretically do anything, because simple changes lead to larger ones.

Of course, many problems would lie in the way, for example, this would still be progressing at the same rate as real evolution, which takes millions of years- and batteries/power won't last that long without shutting down. So, we need to not only develop a computer which powers itself, but can safeguard itself.

If it can modify its own coding, no safeguard made by you can protect it. So you would first need to develop a dynamic language, with EVERY possibility to expand, and place additional protections to 'guide' the growth in a safe manner. To make an iRobot style robot, would be a piece of cake... Well, compared to making a real sentient robot.

An iRobot style robot (although the movie wants it to come across as not scripted) you would simply have to script a reaction to every possible event. Over say a hundred years we could have a robot that would react to anything in the world, short of repairing itself (and even possibly that) but it still wouldn't be sentient. It wouldn't even be conscious.

For it to become conscious or sentient, it has to be able to make its own decisions. For it to make decisions, it needs a reason. For example, we will assume this robot can alter its coding... in a safe manner:

'iRobot' is walking around. It knocked a vase over.

Its possible it could realize that knocking a vase over is innapropriate, alter its code so it can realize when it is about to knock over a vase, and have time to stop itself. If it could advance further, it might develop a reason to want to knock a vase over.

In the end, anything that a person can code, is always going to be static unless a person updates it. If it is static, it leaves no room for expansion. Without expansion, learning is nearly impossible, and what is possible is extremely limited.