Machine programming is an emerging field of research and practice. It aims to automate the development and maintenance of software. Such automation can increase the productivity of programmers and the quality of software they produce.
Simply put, machine programming is the automation of software development. It is about using software to write software. We are standing at the cusp of a paradigm shift in software development. Machine programming will profoundly alter the way we develop software in the future.
Machine programming techniques have been utilized since the early days of computing. Assemblers, compilers, and spreadsheets are examples of software that helps “write” executable code. But research in the last few years has led to numerous breakthroughs. Advancements in programming languages, compilers, and machine learning are contributing to new successes. Machine programming holds promise to automatically create, optimize, test, debug, and port software.
Why is software Development hard?
The definition of software in the quote that leads off this article is rather simplistic. Here is another possible definition of software development:
In a timely fashion, precisely and exhaustively express a complex process using one or more foreign languages so that it executes correctly and efficiently on the most complex machines ever developed.
This definition sheds a little light on why software development is so difficult. Writing software can be IMMENSELY complicated. In fact, studies have shown that software projects have a success rate of only about 30%. This success rate has changed little since the 1970’s despite industry-wide efforts to improve it.
To be successful, developers must thoroughly understand how to solve the problem. Even rare corner cases must be considered. Then, a solution to that problem must be expressed in what is essentially a foreign language (or two). Programming languages have long sought to make programmers’ lives easier. But challenging vocabulary, grammar, abstractions, nuances, and idiosyncrasies can take years to master.
When the solution is coded, it is likely to function incorrectly at times. Testing the code with a variety of input data is paramount to ensure that it works successfully when deployed. Software testing can make up a sizable portion of the software development task. Defects fixed in the software can often produce new defects or performance regressions.
Finally, there is the matter of deploying the software on a processor. For quite a while, programmers had only CPUs to consider. But then GPUs came along with dramatically different architectures and execution characteristics. Today we also have processors called VPUs, TPUs, NPUs, FPGAs, and custom ASICs. The complexity and diversity of processors is rapidly increasing. Each type of hardware has its own general performance characteristics. And each type of hardware requires specific methods to achieve optimal performance. Processors may contain additional performance-enhancing features to exploit. Examples include extended instruction sets, vector units, differing cache sizes, and the like.
The definition of software development included above could go even further. We could add “…and implement the code in a simple and elegant way so that it can be understood by others, properly maintained, and extended or reused to provide additional benefit.” The environment in which an application is executed is constantly changing. Drivers, support libraries, run-times, and the like are frequently updated. Even maintaining software requires considerable effort.
So yes, there are reasons why software development is INCREDIBLY difficult. The question is, what can be done about it?
What is machine programming?
Some of you may have found the previous section tedious. The difficulty of software development is well known to its practitioners. But this discussion has laid the foundation for discussing a new alternative. Can we use computers to automate the precise, exhaustive, and complex portions of software development? Researchers at Intel have started calling this area machine programming.
Intel’s motivation for this research is simple. Intel makes computer processors – the most complex machines ever devised. Without software to make them do useful things, these devices are nothing more than little heaters. Intel’s goal is to enable the global population to create software. Software makes Intel’s hardware products useful, usable, and even essential parts of our everyday existence. A rich universe of experiences made possible through software increases the need and the demand for Intel hardware products.
More precisely, Intel’s Machine Programming Research team has established the following goals:
- Automation of software (and hardware) to improve:
- Productivity (1000x improvement over work performed today)
- Quality (Superhuman correctness, performance, security, etc.)
You may have encountered other terms that describe the upcoming software development revolution. These terms include program synthesis, AI/ML for code, or even the nebulous “Software 2.0”. Intel has started referring to this area as machine programming because:
- It is broader than program synthesis (debugging and testing can be automated, not just code creation)
- It doesn’t strictly require the use of AI/ML techniques (though these are prevalent in machine programming)
- It is a more concrete term than Software 2.0 (what was Software 1.0? and when will we get to Software 3.0?).
Machine programming is thoroughly described in the paper The Three Pillars of Machine Programming, by Justin Gottschlich, et. al. The three pillars are defined as:
- Intention: Discover the intent of the programmer
- Invention: Create new algorithms and data structures
- Adaptation: Evolve in a changing hardware and software world
Examples of machine programmingLet’s just think through some of the implications of letting machines do the heavy lifting when it comes to software development. It’s almost like changing the laws of gravity. With machine programming, it will be possible to:
- Let developers express their intent and automatically create the software to realize that intent. (Remember, any can be a developer).
- Build new software correctly so that software debugging is not required
- Port legacy code to brand new hardware without human effort.
- Have code that automatically adapts to changing conditions around it. This includes O/S changes, driver updates, run-time libraries – even hardware changes.
- Achieve true performance portability. (I.e., executing the same code with optimal performance on any target hardware platform.)