And the winner is...Go!

And the winner is ... Go!

Introduction

We at TeskaLabs develops a lot of microservices. Our first venture into this software architecture concept happened more than three and half years ago.
We started with Python (version 3) with substantial utilization of its asynchronous feature. We also created a universal framework that simplifies and unites the way how we build microservices. It turned to be a very successful move; till today, we've constructed many microservices this way.

To move our technological stack to the next level, we've started to look around for a compiled computer language that will enable us to build microservices with higher performance. Now, don't get me wrong, we don't depart from Python at all. It is the extension of the portfolio. Also, Python can be surprisingly powerful, especially if you master Cython as we did. The mix of the productivity and performance offered by Python is unparalleled.

But we are in the performance game, and it started to be more and more evident that we need to employ compiled, thread-friendly language for some of our tasks.

So we started by defining significant criteria: Compiled into a machine code, ideally using LLVM Must support the same architectural and design concept as our microservices in Python Fast learning curve A reasonable degree of safety (e.g. preventing against buffer overflows) Good documentation and community

Shortlist

Here is a quick summary of shortlisted technologies, with observations:

C

C language offers excellent performance but at the cost of lower productivity and a higher risk of critical errors. Also, there are no async/await concepts in the grammar, so writing event-driven code is quite painful, and reading such code is even more unpleasant.

C++

C++ offers similar performance as C, with higher productivity if you are a master of that language. For beginners, C++ is a complex beast with a lot of tricky features. Also, async/await is not directly supported by the language.

Rust

Rust has been a favourite candidate for a long time. It delivers outstanding performance and a lot of safety. On the other hand, it has a steep learning curve, and it requires a different design approach for async/await code. Subjectively, Rust feels like a new C++, which is not wrong, but it drives complexity up in my eyes.

Go

Go is a small and friendly language. You can learn it in a few days if you know Python or C. Goroutines and channels are a reasonable alternative to async/await concepts, although they feel a bit hardcoded into the language. But that's fine for us. It matches perfectly with our needs in microservices, and I don't think that's a coincidence.

Swift

Swift is a fantastic language, well-designed and compelling. From its release for Linux, one can smoothly write microservices in it. The downside - relative, of course - is a runtime and/or its standard library. It is very connected - unsurprisingly - to the Apple ecosystem, which feels very distant on Linux.

Haskell

Haskell is a compiled functional language - the only non-imperative representative that made it into this shortlist. We learned that functional programming is a handy concept. We use React Hooks; our own declarative language is functional. It absolutely makes sense to build microservices using functional language. I only recommend it - if you are in that zone, which we are not (yet?).

Zig

Zig is not that well-known compiled, new language with a lot of features. It definitively deserves attention, and for enthusiasts, it is already a good choice. For professional software development, Zig is a niche that will not improve your CV. And I hope it will change one day.

Nim

Oh, this one looks so good, especially if you came from Python. But Nim similarly to Zig, it is not a widespread language that will not be seen as a good career option for developers. And I hope that this will improve in the foreseeable future.

What our software engineers want

So far, our research has been oriented on features of each language and its ecosystem. But equally important is the opinion of our software engineers, they will work with selected language daily, and for that reason, they need to be comfortable with that. So we ran a quick survey with the following result:

TeskaLabs survey

Conclusion

At the end of this research, we encounter a rare situation where technological evaluation and people agree. We selected Go, and we will shortly start writing some of our new microservices in this language. Many of these microservices are open-sourced, so you will be able to track our progress on GitHub

Visit and follow TeskaLabs GitHub here: https://github.com/TeskaLabs

A vítězem se stává... Go!

Úvod

V TeskaLabs vyvíjíme spoustu mikroslužeb. Poprvé, kdy jsme se pustili do tohoto konceptu softwarové architektury, bylo více než před třemi a půl lety. Začali jsme pracovat s Pythonem (verze 3) s výrazným využitím jeho asynchroní funkcionality. Vytvořili jsme také univerzální framework, který zjednodušuje a sjednocuje způsob, kterým mikroslužby vytváříme. Ukázalo se, že to byl velmi úspěšný krok; dodnes jsme tímto způsobem postavili celou řadu mikroslužeb.

Abychom posunuli náš technologický stack na další úroveň, začali jsme se poohlížet po kompilovaném programovacím jazyce, který nám umožní vytvářet mikroslužby s vyšším výkonem. Nechápejte mě špatně, o Pythonu se neodkláníme. Jedná se o rozšíření našeho portfolia. Také Python může být až překvapivě výkonný, zejména pokud zvládnete Cython, jako jsme to udělali my. Kombinace produktivity a výkonu, kterou Python nabízí, nemá dle mého názoru soupeře.

My se však pohybujeme ve výkonnostní oblasti a začalo být více a více zřejmé, že pro některé naše úlohy potřebujeme použít kompilovaný jazyk, který umí dobře pracovat s vlákny.

Užší výběr

Zde je stručný přehled technologií, které se dostaly do užšího výběru:

C

Jazyk C nabízí vynikající výkon, bohužel ale za cenu nižší produktivity a vyššího rizika kritických chyb. V gramatice také neexistují koncepty async/await, takže psaní kódu řízeného událostmi je poměrně bolestivé a čtení takového kódu ještě nepříjemnější.

C++

Jazyk C++ nabízí podobný výkon jako jazyk C a zárověň vyšší produktivitu, pokud tento jazyk ovládáte. Pro začátečníky je C++ složitá bestie s mnoha záludnostmi. Jazyk také přímo nepodporuje funkci async/await.

Rust

Rust byl dlouho oblíbeným kandidátem. Poskytuje vynikající výkon a velkou bezpečnost. Na druhou stranu má strmou křivku učení a vyžaduje odlišný přístup k návrhu async/await kódu. Subjektivně Rust působí jako nové C++, což není špatně, ale v mých očích to zvyšuje jeho složitost.

Go

Go je malý a přátelský jazyk. Pokud znáte Python nebo C, lze se jej naučit za pár dní. Rutiny a kanály v jazyce Go jsou rozumnou alternativou ke konceptům async/await, i když se zdá, že jsou v jazyce trochu natvrdo zakódovány. Ale to nám vyhovuje. Dokonale to odpovídá našim potřebám pro práci s mikroslužbami a nemyslím si, že je to náhoda.

Swift

Swift je fantastický jazyk, dobře navržený a přesvědčivý. Od jeho vydání pro Linux v něm lze bez problémů psát mikroslužby. Relativní nevýhodou je běhové prostředí a/nebo jeho standardní knihovna. Je nepřekvapivě velmi propojen s ekosystémem společnosti Apple, což v Linuxu působí velmi odtažitě.

Haskell

Haskell je kompilovaný funkcionální jazyk. Je to jediný neimperativní zástupce, který se dostal do tohoto užšího výběru. Víme, že funkcionální programování je šikovný koncept. Na frontendu používáme React Hooks. Také jsme si vyvinuli náš vlastní deklarativní jazyk, který je funkcionální. Vytvářet mikroslužby pomocí funkcionálního jazyka dává naprosto smysl. Mohu to jen doporučit. Pokud jste v této zóně, což my zatím nejsme.

Zig

Zig není tak rozšířený, nový kompilovaný jazyk s mnoho zajímavými vlastnostmi. Rozhodně si zaslouží pozornost a pro nadšence je již nyní dobrou volbou. Pro profesionální vývoj softwaru je Zig prostorem, který váš životopis nevylepší. A doufám, že se to jednou změní.

Nim

Nim vypadá velmi dobře, zvlášť pokud jste přišli z Pythonu. Ale podobně jako v případě jazyka Zig se nejedná o příliš rozšířený jazyk, který nebude pro vývojáře vnímán jako dobrá kariérní volba. A doufám, že se to v dohledné době zlepší.

Co chtějí naši softwaroví inženýři

Náš výzkum se dosud zaměřil na vlastnosti jednotlivých jazyků a jejich ekosystémů. Stejně tak důležitý je ale i názor našich softwarových inženýrů, kteří budou s vybraným jazykem pracovat denně, a proto jim musí vyhovovat. Proto jsme provedli rychlý průzkum mezi vývojáři s následujícím výsledkem:

TeskaLabs survey

Závěr

Na konci tohoto výzkumu se setkáváme se vzácnou situací, kdy se technologické hodnocení a lidé shodují. Zvolili jsme jazyk Go a brzy v něm začneme psát některé z našich nových mikroslužeb. Mnohé z těchto mikroslužeb mají otevřený zdrojový kód, takže náš postup budete moci sledovat na našem GitHubu.

V tomto hodnocení je skutečně hodně subjektivity a při vašem výběru můžete skončit s různými výsledky, což je v pořádku.

Navštivte a sledujte TekskaLabs Github: https://github.com/TeskaLabs

About the Author

Ales Teska

TeskaLabs’ founder and CEO, Ales Teska, is a driven innovator who proactively builds things and comes up with solutions to solve practical IT problems.




You Might Be Interested in Reading These Articles

SeaCat Mobile Secure Gateway Architecture

SeaCat Mobile Secure Gateway is built using the SeaCat Application Security Platform. It provides strong protection against multiple types of cyberattacks by securing all application components, including the mobile application, network paths, which present an entry point to the enterprise network and application’s backend servers. It reduces an administrator's workload with easy PKI administration of distributed large-scale mobile applications. SeaCat Security Platform has been carefully designed to be flexible, fast, and highly secure.

Continue reading ...

tech

Published on May 18, 2014

SeaCat Tutorial - Chapter 5: Using Parse.com with REST Integration (iOS)

As the market with Cloud Computing and Mobile devices is getting bigger, there is another specific option available. It's called (Mobile)Backend-As-A-Service (BAAS) and it is extremely useful in situations we want to subscribe a complex backend service (alongside the core backend solution, there is usually a lot of additional functionality and statistics) and primary focus on development of client part of mobile apps for instance.

Continue reading ...

tech tutorial ios osx

Published on January 31, 2015

The Golden Age of Black Hats

I experienced a precious moment, discovering the cause which contributed to today's dire state of mobile application security. App developers think that if their apps do not deal with money, they should not have to care about app security. Is it true?

Continue reading ...

security development

Published on February 24, 2015