Introducing Metaphor: an AI-First software development language

Dave Hudson -

AI is rapidly changing the way we build software. It offers expert advice tailored to developers' needs and can quickly automate many tasks. While impressive, these tools are still focused on implementing software in the programming languages we would use if AI didn't exist.

Throughout the history of software engineering, the most significant productivity improvements have come when we move to a higher level of design. So, today, I'm announcing the first public version of a simple new language, Metaphor, that helps make that move to a new higher-level of design.

What problem is it solving?

Like people, AI agents cannot do things without clear, detailed instructions. If we give ambiguous, incomplete, or conflicting instructions, they become confused and do unexpected things. Unlike people, though, they usually won't tell you they're confused unless you ask them.

Metaphor is designed to let you progressively build precise and unambiguous requirements so AI agents can generate software and documentation. Instead of you and your team focusing on how you build software, you can concentrate on what you want and how you want it to behave.

How does it work?

Metaphor has a very simple structure. Within this structure, Metaphor uses natural language.

In this v0.1 release, there are just 5 keywords! These are:

  • Action: the action we want the agent to perform.
  • Context: information that will be required by the AI agent to do its work.
  • Embed: embed another file into the current metaphor file as part of the context.
  • Include: pull other metaphor files into the current metaphor file.
  • Role: the role to be taken by an AI agent (this is a placeholder for now but will be used later).

The idea is to gather all the essential elements of a software design in one place. This includes design considerations that would typically come from many different disciplines. For example, it can capture ideas that usually originate with product managers, software engineers, QA analysts, security experts, and more.

Once read, this is compiled into a "large context prompt" (LCP) for one or more backend AI agents to process. An LCP is designed to provide all the information an AI agent needs to perform an action. Examples of actions might be reviewing requirements for ambiguity, reviewing some existing software against a requirement, or building something completely new.

Metaphor is designed to capture everything within the LCP, so there's no need to rely on a continued dialogue or fine-tuned learning in any AI large language model (LLM). This also makes it easy to discard anything that doesn't work as desired and try out new ideas.

Modular designs are vital in software development, so Metaphor descriptions can be broken into modular components (.m6r files). This makes it easy to build library-like elements that can be reused between projects or leverage a project description for many different actions.

Initial release

The Metaphor prompt compiler, m6rc, is being released under an Apache 2.0 open-source software license to encourage you to experiment with it and to give you the chance to contribute to it.

This is a v0.1 release, so you can expect the language and the tools to evolve quickly over the next few months.

The software is available on GitHub at: github.com/m6r-ai/m6rc

There's also a discussion forum over on Google Groups: groups.google.com/g/metaphor-language

I look forward to seeing what you can build with Metaphor!

A photo of the whiteboard notes for this release of Metaphor.
The whiteboard notes for Metaphor v0.1