In the realm of programming, where syntax intricacies and translation hurdles have long been the norm, a duo of seasoned programmers embarked on a bold experiment – developing a Plain English compiler.
The objective was clear: to explore the potential benefits of coding in a natural language, free from the shackles of artificial syntax.
The results of their venture offer compelling insights into the future of programming. Let’s delve into the details of natural language programming and disclose information about it.
Breaking Down Barriers:
1. Simplifying Thought Translation:
The central question posed was whether coding becomes more accessible when programmers can express their thoughts directly in a natural language.
The answer, as derived from their experience, is a resounding “Yes!” The elimination of the translation step from English pseudo-code to programming syntax streamlines the coding process and enhances the natural flow of thought.
2. Parsing Natural Languages “Sloppily”
The project challenged the conventional precision of syntax parsing by adopting a “sloppy” approach, akin to how humans interpret language.
The key revelation here is that, much like a child associating words with mental images, the compiler connects types and routines based on the programmer’s definitions. This flexible parsing model proved to be remarkably stable and conducive to productive programming.
3. High-Level Languages for Low-Level Tasks:
One of the groundbreaking aspects of the Plain English compiler project was the development of low-level functionalities using high-level language constructs.
The integration of English pseudo-code with machine code snippets showcased the potential of a hybrid approach, where natural language prevails, punctuated by code snippets in specific syntax when needed.
Unveiling Plain English in Practice:
The practical implementation of Plain English programming introduces innovative syntax features. For instance, types are defined in a clear, natural language manner:
A polygon contains some vertices.
Routine definitions follow suit, with an emphasis on readability and natural expression:
For adding an x and y coord to a polygon:
Make a vertex with the x and the y.
Then add the vertex to the polygon’s vertices.
A notable departure from traditional programming syntax is the absence of formal names for parameters and variables. Instead, a reliance on natural language descriptions, possessives, and even spaces in names is encouraged, mirroring real-world references.
Addressing Common Concerns:
1. Code Verbosity and Efficiency:
The objection that natural language programming might be overly verbose is met with a detailed analysis.
While Plain English code may require more words, the argument leans towards the ease of typing and understanding, emphasizing self-documentation and readability over brevity.
2. Comparative Examples:
By comparing traditional syntax with Plain English equivalents, the authors illustrate that the alleged verbosity is a matter of preference.
Whether one favors typing words over punctuation marks or desires a self-documenting code, Plain English stands as a viable alternative.
Beyond the Horizon:
The Plain English compiler project is not just an experiment; it’s a glimpse into a potential future where programming languages evolve to match the natural way humans think and communicate.
The authors express hope for extending this paradigm to other languages and envisioning snippet parsers for domain-specific languages.
Embracing the Revolution:
In conclusion, the Plain English compiler project challenges preconceptions about programming languages.
By prioritizing natural language expression, eliminating unnecessary translation steps, and embracing a hybrid approach for low-level functionalities, the project pioneers a new era in coding.
The prototype, a complete development environment, is available for exploration, inviting programmers to embrace the revolution and rethink the way we write code.