Anything language agnostic is just a new language

Anything language agnostic just means that someone wrote down what things mean, and created a whole lot of adapters to different languages for it.

Signs in an airport with pictograms and text in English and Spanish.
Photo by Rob Wilson on Unsplash

Here we can start the long long conversation of what the difference is between a programming language and a markup language. It’s somewhat accepted that, for example, PHP is a programming language, while markdown is markup. Pun very much intended. The more contentious ones are HTML and CSS.

That said the reason for this very article is me thinking about gRPC. gRPC and protobuf go hand in hand. Protobuf is a way to encode data in a language agnostic way. Per their website:

Protocol Buffers are language-neutral, platform-neutral extensible mechanisms for serializing structured data.

What it actually means is that each language that they are targeting has a translation layer that goes in between whatever data shapes that language has and protobuf. Given 8 languages – PHP, Go, Python, Ruby, Java, Objective-C, C#, C++ – protobuf is the 9th. Notably Rust and Javascript are missing from their official website, but there are libraries you can use for them. In Rust there’s Prost in the Tokio ecosystem, in JavaScript there’s protobuf.js.

gRPC builds on top of protobuf, and the support is roughly the same as protobuf’s. Notably in PHP you can only create a client, and Rust is also provided as a third party library in the form of tonic, also included in the Tokio ecosystem.

But this also means that your popular language agnostic stuff, like JSON, yaml, toml, csv, markdown for document formats, and then kafka, sqs, rabbitmq, and so on for queues are also just yet another implementation that each of your languages that you use also have an adapter to.

If you want to create anything that you want to be thought of as “language agnostic”, then you need to do two things:

  1. create a bunch of libraries or adapters in the most important languages you want to target, and
  2. have clear documentation and standard, so when someone else wants to create an adapter or library in a language you haven’t done the work for, they can

And that’s pretty much about it. If you want to be super fancy, you can get your thing to have an ISO standard (C, the language, is ISO 9899), or your own RFC (for example JSON is RFC 8259, LDAP is RFC 4511).

I include C here for a reasons as a language agnostic, er... language. I work with C a bunch during my day job, even though I’m just learning how to write C itself. I still had to interface to it a lot. This article is an excellent writeup of why C is here:

C Isn’t A Programming Language Anymore - Faultlore

And as with most things in programming, an xkcd strip exists for this: 927:

Standards

What do you think? What’s the last language agnostic language that you used?