• #17 Rust language - trending in 2020

    2020-09-23 08:48:22

    I have been enamoring the Rust programming language for some years now. Never used it professionally but have been trying to do some pet projects on the side with it. I simply love the philosophy and community behind it. One could say that Rust is a reincarnation of Haskell for a modern public. But it is very recent (started on 2010 but got it's first stable industry ready version on 2015) and only recently we saw jobs searching for Rust programmers. I have been hoping for it to grow, it would be amazing to be able to use my pet language professionally, in the real world companies big guns. For some years in a row (5 at least by my counts) it has won the StackOverflow most loved language survey (TypeScript, Python, Go and Kotlin have been next in the top 5 contenders). And this happens with a good reason: Rust is not just a new language with a new syntax in the block, it is a new paradigm trying to solve old hated problems with modern methods - low level system programming memory management is no more a gamble between performance vs risk for the developers. The majority of security problems and bug reports on systems come from memory management issues like buffer overflows, null pointer exceptions etc. Rust tries to solve it with new paradigms (e.g. introduces the concept of ownership for it's variables; has a very good and opinionated compiler, with the philosophy of preventing bugs before they happen - usually if your code compiles correctly with Rust and your logic is ok, it means it is ready to go, the compiler itself is like a test suite). Rust is a great contender for the C/C++ markets, because itself is a low level programming language with a focus on performance, but also competes with the middle ground (C#/Java) because it as a very good repository system (Cargo, similar to PIP or NPM) and a modern syntax with some functional style that can be used like an higher level language (it is not encouraged, but one can not declare variable types in some cases, because the compiler can infer them correctly most of the time; one can manage low level memory and open the hell doors, but if not explicitly declared the Rust compiler will protect the user from that). In the end of the day, you have the C performance power, without the security/bug risks and with a modern syntax and tools. And the community is awesome, Rust have been improved by academics and very smart people at Mozilla. It was built to remake Firefox into a more secure and faster browser. Along the way it has been slowly adopted in interesting projects (e.g. the NPM repository system for JS were rewritten in Rust, in order to improve the performance and security/bugs - there are some nice talks on conferences from the team behind it about it that you can find on youtube; the videogame community has also trying to embrace Rust in order to replace C++, many good game engines have emerged and some companies have publicly declared it). Well, but at the end of the day this kind of momentum and promises have been announced many times before and never C/C++ have seen a scratch to their supremacy. One saw this with Hasckel before for example, but nowadays it is not much more than an academics curiosity. I believed on Rust potential but was afraid that it would go the same road. 4 years ago it was not even in the top 50 TIOBE index (note: it started in 2010, but only in 2015 it went from alpha to 1.0 stable version, so it is a very recent language). But in recent years, after the stable version, many good libraries were created with it (very good async libraries; Rust was a pioneer with the Web Assembly support; very good web frameworks with top benchmarks; interesting voice recognition projects; amazing videogame engines etc.), the Cargo (repo) ecosystem evolved a lot, and Rust were used in real world scenarios by big companies. Because of this the public is embracing Rust more and more, thrusting on it's future. In 2016 it got to the top 50 languages in the TIOBE index. In 1st semester of 2020 it got to the top 20 place in the same ranking for the first time. At the moment (September) it seats at 18th. For a language so young this is very impressive. Recently I searched the September rankings and noticed that Rust is the language with the most growth of all compared to the past year: from September 2019 to September 2020 Rust grew 15 positions, a lot above the average (the 2nd place is for R that grew 10 positions, the 3rdt one is Pearl with 7 positions, followed by Dart with 4). This kind of indexes should be taken with a grain of salt, because they don't reflect 100% the reality. TIOBE is based on searched sentences with special criteria on popular search engines. This does not necessarily reflects how many people are using it or it's health (e.g. one could search for Java on Google with the intent of knowing if it is dying or not, not necessarily for good reasons). But this trend of growing popularity can be found in other indexes with different systems, for example on GitHut 2.0, which indexes by the number of pull requests for each language, Rust is even higher in the 13th position of most used languages with the 3rd highest growth rate of 0.4% (only TypeScript and Go ahead). GitHut index system also does not reflect 100% the reality (many companies/projects don't use it). But again, in other popular index (PYPL - based on number of searches for programming languages tutorials), one can notice this trend again, Rust seats at the 16th position with a 0.3% growth rate trend (again one of the best ones, only in 2nd place with Python in first). The future of Rust is looking more and more brighter. Some people compare it with Haskell, a promising beloved language growing very fast, with a passion from academics, but because of the similarities people also pray that it doesn't follow the same path in the end into oblivion. The current trends seam to show that Rust will succeed where Haskell failed, time to embrace it.

    Indexes sources:

    TIOBE Index GitHut 2.0 PYPL PopularitY of Programming Language

    Quote sources:

    "What killed Haskell, could kill Rust, too" (by R. Martin) "Haskell was the language everybody wished they could program in, but nobody did, except for maybe a few people (...) Haskell ruled. (...) What killed Haskell, could kill Rust, too. Why would I even mention Haskell in this context? Well, Haskell and Rust are deeply related. Not because Rust is Haskell without HKTs. (Some of you know what that means, and the rest of you will wonder for a very long time). Much of the style of Rust is similar in many ways to the style of Haskell. In some sense Rust is a reincarnation of Haskell, with a little bit of C-ish like syntax, a very small amount."

    () comentários