Skip to content

Picking a Programming Language SDK for our Gateway API bridge

Moritz Stückler edited this page Mar 25, 2022 · 8 revisions

To get started with actual implementation work, we need to pick a tech stack for this project. Since there are two sides involved (Matrix and Threema), we also need to decide if we will use the same language for both sides of the bridge or if we want to have bridge made out of multiple parts (which could be written in separate languages).

Official Threema SDKs

Threema offers the following SDKs according to their official Gateway API documentation – despite some of these SDKs belonging to private GitHub accounts.

In general most of the Threema SDK seem to be thin wrappers around their REST API. So we could also build something like this in any other language that does HTTP.

Matrix SDKs: too many to list

The Matrix side of things has a lot more options. There's too many to list them all here. It seems that all of the languages mentioned above also have some kind of SDK for Matrix available – except PHP (the reason seems to be that there is no libolm suport/binding for PHP). In general the Matrix SDKs seem to have more logic / are heavier than the Threema SDKs.

As for our personal preferences and experiences: We both have a degree in technical Computer Science, so we have experiences in many languages (both low- and high-level, compiled and interpreted) and also know how to quickly learn a new language. From the languages mentioned by Threema, we do have noteworthy experience in Java and PHP.

Maintainability, Popularity and Community

So, PHP probably would have been our preferred choice if there was libolm support (because PHP is so widespread and PHP compatible servers and webspace is really cheap and easy to come by). But both on the Threeema and Matrix side, the code quality, popularity and community interest in the Rust SDKs seem to be better than with the rest of the languages. Especially Matrix has recently been pushing their Rust SDK a lot. So for now, we decided to go and try to build a monolithic bridge (meaning, we will have one single executable) using Rust as our programming language.