When given a coding job, humans use their past experience to come up with code snippets on their own, look up or search repositories and pull the relevant code and modify to suit the new program context. Can these program synthesis activities done by humans be done by computers? How can advances in NLP and deep learning be applied to string together a piece of code automatically for a task by looking at corpus in code repositories.
Code generation (also known as automatic programming, generative programming and program synthesis) is not new. Wikipedia defines this type of computer programming simply as a mechanism allows human programmers to write the code at a higher abstraction level. There are plenty of source-code generation tools that augment the creativity of the software developer. There are programming templates, API's, scripts and metadata motels--all generate code.
For example, Altia DeepScreen targets the embedded software community with a graphics code generator that converts your HMI prototype graphics into deployable code. A model-based development tool allows an automotive human-to-machine designer or programmers to select the display portion of the product then click "Generate Code” to churn our ANSI C code in a matter of seconds. Google’s Blockly is basically a "visual code editor" for web and Android apps that applies "interlocking, graphical blocks to represent code concepts like variables, logical expressions, loops, and more. It allows users to apply programming principles without having to worry about syntax or the intimidation of a blinking cursor on the command line.
The formalization of low-code/no-code platforms, that take a declarative and visual approach with very limited hand-coding and zero-touch deployment, are becoming more attractive because they can cut 50-90% off development time vs. a coding language, according to 451 Research. These platforms are cloud-native, work well in a continuous delivery (DevOps) paradigm and are ultra-friendly to citizen developers.
The Future of Code is Machine Learning
The future of automatic programming is intertwined with machine learning. Today, Facebook makes trillions of predictions every day to personalize the stories that you will get to read. A programmer did not create those rules--algorithms rooted them out. Deep learning is used to recognize faces and obstacles for self-driving cars. The neural network models learn how to solve a problem by observing data and figuring out a solution. Today, deep learning is applied with great effect in computer vision, speech recognition and natural language processing.
The programmer is a problem solver, but more so a trainer of a model and capable of explaining its results. Some examples of this new type of data-driven programmer and "coder":
- Microsoft and Cambridge have developed an algorithm, called DeepCoder, that can write brand new code to solve math problems.
- UIzard Technologies is a copenhagen-based startup that has trained a neural network to generate code by simply "looking" at a picture.They can describe objects and translate them into iOS, Android and web based HTML/CSS interfaces with about 77% accuracy for sample inputs.
- MIT researchers created a "automatic bug repair" machine learning model (called Prophet) that can fix certain errors in programs; the model "learnt" the correct code from training data programs
The research above and many others will have significant implications to the very trade craft of programming. Today, HTML is generated automatically from scripts--and programmers focused on solving higher order problems. As machine learning starts to become more mainstream there will new roles for digital developer. The data that is training models--will determine the code. Someone will need to peer into the results and explain the behavior. And to help our clients "compete on speed" Altran is innovating in Development Agility across a number of dimensions:
- Providing natural interfaces for humans to develop, test, debug, deploy and maintain software
- Amplification and augmentation of developer capabilities with assisted recommendations from open knowledge base
- Generative code that translate human intent to machine language or source code in any language that can be further extended by developers
- Radical changes in the way work gets done through digital technologies such as blockchain and machine learning