What are some good programming languages to program for machines and robots?

C/C++

Number 1 programming language in robotics! Many people agree that C and C++ are a good starting point for new roboticists. Why? Because a lot of hardware libraries use these languages. They allow interaction with low level hardware, allow for real time performance and are very mature programming languages.

Python

There has been a huge resurgence of Python in recent years especially in robotics. One of the reasons for this is probably that Python (and C++) are the two main programming languages found in ROS (Robot Operating System).

There are many other languages like prolog and lisp which is used in AI choose according to your requirement.