Motoko - what?
I know, I know, there are many programming languages around and steadily more being created. So why would I write about yet another one? Because even though Motoko really is shiny and brand new, it not only offers some interesting aspects to learn about but also comes with a complete cloud infrastructure behind it to amplify its growth. Curious? Next chapter, please!
A new one for the modern web
Motoko uses a strong type system and was created with complete asynchrony in mind. Its architecture is built around the concept of Actors. Sounds familiar? Probably not, but if you’re craving for a really great rabbit hole, try searching for the Telescript language, something far ahead of its time. Links are available at the end of this blog entry, too. Discussing Actors is out of the text’s scope, but here’s a brief introduction: Actors look and behave very similar to classes in OOP, but they’re enhanced with the ability to send messages to other Actors. Each Actor uses a queue to automatically manage the ordering and processing of incoming messages.
Similar to ES6+’s Promises, Motoko uses Futures to represent the results of each Actor’s operations. The usage of Futures therefore allows sending messages concurrently, as the result can come at any later point in time after the operation has been called.
Dfinity and the Internet Computer
Remember when I promised to talk more about the usage of Motoko in embedded systems and IoT? Here we go: Motoko was developed by a foundation called Dfinity, which offers a solution for decentralized applications in the modern web called Internet Computer. The idea is to move the current web stack away from proprietary salutations (AWS, GCP, etc) to an “open” platform, a decentralized governance system defined in its protocol. Its architecture enables multiple computers to operate like one, very powerful, virtual machine.
That’s about it for a quick overview of Motoko, a new programming language with some interesting features like Actors. To try it out, you need to install Dfinity’s Canister SDK. The whole project is still very young, but worth checking out - even if you just want to stay on the edge of the web.