DEV Community

Cover image for Claude built me a high-level coding system in 4 European languages
Graham Trott
Graham Trott

Posted on

Claude built me a high-level coding system in 4 European languages

Years ago I wrote myself a high-level scripting language, mainly because I'm not a great programmer and I wanted something easier to handle all the jobs waiting to be done. It was pretty successful, in that the jobs got completed and they're easy to dive into years later to fix problems.

When I discovered agentic AI about a year ago I aimed it at one of those projects, to help me write a language extension needed for a new feature. To my surprise, after a while the AI started offering me code in my own scripting language, not just in the Python it was built with. The code was pretty awful but it gradually got better.

I moved the project over to Claude Code a couple of months ago, and with careful prompting Claude was soon able to do virtually all my coding for me in script rather than Python or JS. This made code verification simpler because English-like scripts are much easier to read than the traditional high-level language code needed to carry the same meaning. Occasionally we come across something the script doesn't handle well, so we go back to Python/JS to extend or revise the compiler and runtime. For more complex, self-contained chunks of functionality we build plugins, also in Python or JS, that seamlessly extend the language and can be imported when needed rather than having to be present all the time. We drew in various bits and pieces from the original project, such as a reference manual, a tutorial and a programmers' playground, and built a website to describe what we were doing.

Bonjour / Guten Tag / Buongiorno

At some point I had the crazy idea of internationalizing the scripting language. All mainstream programming languages are based on English words, which gives native English speakers a distinct - and to my mind somewhat unfair - advantage. I consulted Claude, who explained that it wasn't necessary to rewrite the whole thing, just put a language pack - mostly just a large JSON script - in front of the compiler, to deal with different vocabulary, syntax, word order and so on. The 'intents' remain the same; addition is still addition and a subroutine call is still a subroutine call. The system comprises a single compiler and runtime, plus a set of language packs.

I picked Italian, the language I know best other than English, and told Claude to get on with it. This went way better than expected, so I added French and German and named the project AllSpeak*. For all three languages, the translations are a bit clunky in places and could do with being proofread by native speakers (any volunteers?), but there's little doubt the meaning is clear. At worst they come over a bit like Yoda, with mangled syntax and odd word order.

Take a very simple example:

  variable Greeting
  put `Hello, AllSpeak!` into Greeting
  log Greeting
Enter fullscreen mode Exit fullscreen mode

in French is

  language fr

  variable Salutation
  mets `Bonjour, AllSpeak !` dans Salutation
  journalise Salutation
Enter fullscreen mode Exit fullscreen mode

in German is

  language de

  variable Gruss
  lege `Hallo, AllSpeak!` in Gruss
  logge Gruss
Enter fullscreen mode Exit fullscreen mode

in Italian is

  language it

  variabile Saluto
  metti `Ciao, AllSpeak!` in Saluto
  registra Saluto
Enter fullscreen mode Exit fullscreen mode

So what use is a set of multilingual scripting languages? Well, with the right primer packs to describe the vocabulary and syntax, Claude Code and other agents can use them in place of mainstream computer languages to handle a wide range of software applications, including where those doing the prompting are not native English speakers. With AI doing all the coding, the choice of programming language is not important; the main thing is readability by those charged with validating the code. Unlike mainstream programming languages like Python or JS, the code produced by AllSpeak can be read and understood not just by professional coders but also by some of the people who will be using the finished software. And with the help of the language packs, the AI agent generates code in the same language as the prompts it was given; code that compiles and runs exactly the same way as the English version because it uses the same compiler and runtime.

But in the end, I don't know. This was mostly an intellectual exercise; an exploration of what's possible. I have a feeling it's an indication of one direction that coding could be heading, but only time will tell.

Anyone curious enough to try it out is welcome to visit the AllSpeak website.

Photo by Drew Beamer on Unsplash

*Allspeak is the divine language of the Norse gods - anything that can communicate can understand it, and be understood in turn.

Top comments (0)