Rust vs. Go vs. Elixir Programming Language

Introduction

The global pandemic, which began in 2020, led to people flocking online for remote work and online shopping. This caused a significant load on servers that had to be scaled up to accommodate the increased traffic. This, in turn, led to increased server costs, which eventually made some developers abandon slow, interpreted languages such as Ruby, PHP, and Python and adopt fast, compiled ones like Go, Rust, and Elixir.

The number of GitHub proves this pushes for the languages mentioned since 2020:

Programming Languages Chart 1

The fall of PHP and the rise of Go

Go is way ahead of Rust and Elixir

Below are some differences between Elixir, Rust, and Go:

ElixirRustGo
Purpose for building scalable and fault-tolerant distributed systemsfor low-level system development, such as operating systems, device drivers, and embedded systemscommonly used for building web services, networked applications, and distributed systems
Type SystemDynamicStaticStatic
Concurrencyhighly concurrent and fault-tolerant systems through the Erlang VMprovides fine-grained control over threads and memoryincludes goroutines and channels as first-class concurrency primitives
Ease of LearningHardVery HardMedium

Rust and Go are great for server-side programs, while Elixir is suitable for web apps through the Phoenix Framework. Many tech companies have saved money by switching to Elixir. 

Elixir And Erlang

Elixir was born out of the need to address scalability and maintainability issues in the Ruby on Rails framework. It was created by José Valim, a well-known Ruby developer and contributor to Ruby on Rails, in 2011.

It runs on the Erlang Virtual Machine (BEAM) to have the productivity of Ruby while taking advantage of Erlang’s concurrency and fault-tolerance capabilities.

Elixir Saves Money (And The Earth)

Paraxial says Elixir saves Pinterest $2 million a year in server costs. 

Steve Cohen of Pinterest says they reduced their servers by 95% from 1,400 after converting several parts to Elixir. According to him, one of the systems that ran on 200 Python servers now runs on 4 Elixir servers.

The combined effect of better architecture and Elixir saved Pinterest over $2 million per year in server costs. In addition, the performance and reliability of the systems went up despite running on drastically less hardware. 

When their notifications system was running on Java, it was on 30 c32.xl instances. When they switched to Elixir, they could run on 15—despite running on less hardware, the response times dropped significantly, as did errors.

Analogy With Other Languages

The table below will help people understand the rough counterparts of Elixir with other more popular languages. 

LanguageErlang Java Ruby Python  Javascript (Dart)
Easier LanguageElixirKotlin, GroovyRuby DSLPython DSLDart
VM or InterpreterBeam
JVMRuby InterpreterPython InterpreterDart Compiler
Libraries

OTP, PackagesJDK, DependencyGemsPackagesPackages
ORMEcto SQLJDBCActiveRecordSQLAlchemyPostgres
JobsGenServerJobRunrSidekiqCeleryIsolates
Build ToolMixMaven, GradleBundlerPipBuild
WebPhoenixSpring MVCRailsDjangoFlutter Web
Websockets: LiveViewSpring-WebsocketActionCableDjango SocketsFlutter web_socket_channel

Issues With Elixir

The big problem with Elixir is its lack of jobs and interest. Despite its high performance, this is because it is a problematic functional programming language with a steep learning curve, though not as tricky as Rust. 

Elixir differs significantly from object-oriented programming languages, such as Java and C#, taught in schools. As a result, few people commit to learning it, leading to a lack of popularity and subsequent interest.  

However, the attractive roadmap of Elixir, heading towards LiveView and deep learning via Nx and Axion, is enough to offset its initial disadvantages.

Juan Dalisay Jr.https://www.pantrypoints.com/
I am Juan Founder of Superphysics and Pantrypoints Technologies.
Freeduhm - A Global Digital Tech Media Company
Exit mobile version