Elixir

Elixir

Application and Data / Languages & Frameworks / Languages
Lead Architect at Fresha·

When you think about test automation, it’s crucial to make it everyone’s responsibility (not just QA Engineers'). We started with Selenium and Java, but with our platform revolving around Ruby, Elixir and JavaScript, QA Engineers were left alone to automate tests. Cypress was the answer, as we could switch to JS and simply involve more people from day one. There's a downside too, as it meant testing on Chrome only, but that was "good enough" for us + if really needed we can always cover some specific cases in a different way.

READ MORE
28 upvotes·3.9M views
Lead Architect at Fresha·

Coming from a Ruby background, we've been users of New Relic for quite some time. When we adopted Elixir, the New Relic integration was young and missing essential features, so we gave AppSignal a try. It worked for quite some time, we even implemented a :telemetry reporter for AppSignal . But it was difficult to correlate data in two monitoring solutions, New Relic was undergoing a UI overhaul which made it difficult to use, and AppSignal was missing the flexibility we needed. We had some fans of Datadog, so we gave it a try and it worked out perfectly. Datadog works great with Ruby , Elixir , JavaScript , and has powerful features our engineers love to use (notebooks, dashboards, very flexible alerting). Cherry on top - thanks to the Datadog Terraform provider everything is written as code, allowing us to collaborate on our Datadog setup.

READ MORE
3 upvotes·219K views
Needs advice
on
ElixirElixirPythonPython
and
RustRust

which is great for web development? Elixir with Pheonix or Python with Django? or Rust with Rocket? which stack provides low latency, almost real-time, quick data updates? and also does not put a burden on CPUs for Cloud Software Development?

READ MORE
6 upvotes·74.4K views
Replies (2)

Summary Statically-typed, compiled languages will deliver better performance than their competitors. Golang and Rust are excellent options. Golang will be slightly more latent but has excellent concurrency, built-in garbage collection, and was designed by Google high throughput with minimal blocking time. Rust will be more performant and will use fewer CPU cycles and memory per unit time. Still, your development time will be longer than Golang, especially if you're coming from a dynamically typed language. If you chose Rust, Rocket is a good option (Nickel is another one you can check out for high performance); if you chose Golang, FastHTTP is highly performant.

If you're looking for near real-time performance with minimal CPU utilization: statically typed, compiled languages deliver the most optimizations. Their compilers can best optimize the executable because they know which data type to expect for every variable instantiated. If you're coming from a dynamically typed language, Golang features real-time garbage collection, concurrency, and dynamic-like variable assignment. Rust does not have garbage collection and relies on a program's developer(s) to clean up after themselves. Not having garbage collection in a language leads to highly performant code, however, as the programmer determines when garbage is collected and memory deallocated or reassigned.

For a look at Rust vs. Golang vs. Python's execution times, you can look at these two pages: Golang vs. Python Benchmarks and Golang vs. Rust Benchmarks. On average, you will see Rust is faster than Golang is faster than Python. Rust and Golang are close to each other in performance terms (compared to Python especially), but Rust uses less memory and CPU cycles per unit time.

If concurrency or high throughput is more important than latency, use Golang. Golang has a built-in concurrency mechanism that is amazing at yielding high throughput and eliminating, or controlling, when a subroutine blocks the rest of the main routine. Golang also supports defining structs in a way similar to classes, allowing you to access the function like a Python class method (using the dot . operator). Golang also allows for dynamic variable type assignment using the walrus := operator within a function, easing the switch from a dynamically typed language to a statically typed one. Golang's built-in garbage collector and concurrency methods, dynamic variable assignment via the walrus operator, method-like function calling will minimize your development time between Golang and Rust if you're coming from a dynamically typed language.

We all know that when performance matters, though, it really matters. Rust does not have a garbage collector, allowing code executions with the smallest latency. The rust compiler is very helpful and has been known to catch most possible runtime errors helping to prevent your code from throwing an error and stopping execution. Rust will deliver faster performance over Golang.

READ MORE
Rust vs Go — Bitfield Consulting (bitfieldconsulting.com)
4 upvotes·441 views
Recommends
on
Elixir
Rust

Great for web dev? All are pretty great, but my experience with Elixir is pretty limited, less so with Rust but still, it's not my day-to-day language, so take my words with a grain of salt.

Performance-wise, Rust is unbeatable if you are aiming for low latency and CPU bounded tasks as well. For data updates, that really depends on how good the database connector or ORM is. It may vary a lot in real-world scenarios but in TechEmpower benchmark at least, a Rust framework + Diesel ORM is the best of the three. However, if you are talking about very high and spiky traffic, a queueing system is almost 100% required. Your normal RMDBS will not handle that well. But then again, I don't think performance should be your first priority when you start your project.

Python w/ Django is super mature and great for productivity but performance isn't this combo's strength. With the recent and upcoming work on async, I believe it will get much better but still, Python as a language is the slowest of the three. Check out FastAPI, Starlette, or other async frameworks + uvicorn for better performance. I like FastAPI and Blacksheep the best, with good performance and a beyond great typing story, which is a strong booster for productivity.

For Rust, check out Warp, Axum, and Actix-Web as well. I like Axum and Actix quite a bit better as I am not a great fan of macros. Also, Axum comes from the tokio-rs team, so I think (hope) it will receive sustained active development.

READ MORE
3 upvotes·1 comment·494 views
Manuel Rubio
Manuel Rubio
·
October 18th 2021 at 12:24PM

In my opinion, because I'm not a current developer of Rust (yet) but I was for Python and Django and I'm at this moment for Elixir and Phoenix, the point of Elixir and Phoenix is to get easy the scalability of your system, and for sure, whatever you build on top of it, should be easier to scale than others. While Python is a system that helps you with fast development and putting your project fast for time-to-market, it's easier to get more people which are good developers on that language, Elixir is helping you in the same way and even it's prepared to grow with you without hassle. Rust I'm pretty sure that could be more performant and if you need to do something which isn't scalable or should be staying compulsory in only one machine, it's the best choice. Otherwise, go with Elixir and Phoenix, no regrets I can ensure it :-)

·
Reply
Needs advice
on
AngularJSAngularJSC++C++
and
JavaJava

I will use Elixir for personal projects. It's productive, reliable, secure, simple, etc. But when performance is critical, I need job opportunities, when I work with mutability, which do I pick? I need advice on which "bureaucratic, mainstream" programming language to pick when wanting performance and jobs. Elixir is often "slow", and it hasn't boomed yet the way Golang and Rust have, so which?

READ MORE
4 upvotes·123.2K views
Replies (1)
Lead Software Developer at Blaqueyard·

Well for those performant tasks maybe you can use Rust nifs for elixir. Elixir enables to write fault-tolerant, scalable code for concurrent systems, and as such, it is perfect for messaging systems and web applications that might need to handle a lot of users efficiently. But if you need speed you can plug in Rust or write a microservice using Goland/Rust.

READ MORE
Writing Rust NIFs for Elixir With Rustler | Blog | simplabs (simplabs.com)
3 upvotes·58.3K views
Needs advice
on
ElixirElixir
and
RustRust

I've been working with Js/Ts as a backend developer and I would like to get some suggestions about what new language to learn right now. I've been thinking about Elixir or Rust, focusing on creating WebApis and Blockchain technology. I am passionate about the funcional way but I'm now confident about Elixir in Blockchain. Rust seems like have more jobs about it than Elixir in a little research. Someone could give me some advice? Thank you.

READ MORE
5 upvotes·121.3K views
Replies (2)
Lead Backend Software Engineer at Suda Outdoors·
Recommends
on
Elixir
Golang

For web development I would suggest to take a look into Elixir. Elixir is extemely good for real time apps through websockets, apps with a need of high concurrency and / or apps where you need to process hundreds of thousands of states of differents users in parallel thanks to the actor model that comes with Erlang virtual machine. To solve these kind of problems in another stack could be really hard and painful (including your current stack).

It's true that Elixir is a niche stack ( It deserves way more popularity in my opinion), so, if your concern is to learn something that would keep you inside the trend and market, instead of Rust or Elixir I would suggest Go. Go it's another outstanding language, will a lot of virtues, small and easy to learn, with it for example, you could compile the same application to different operating systems just with a special compiler command (And the compiler is blazing fast). You can also start with a lot of good libraries that helps you to keep your code clean and under control and of course, it's performance is very good too.

Hope my suggestions could be helpful.

Best regards, and happy coding!

READ MORE
8 upvotes·1 comment·53.9K views
Jean Casteaux
Jean Casteaux
·
September 11th 2022 at 12:36PM

Elixir is very interesting and have great parallel and safety features. Go is too simple in my opinion. Sure, it's easy to learn, but when you implement an application it doesn't feel as productive as higher-level languages. Sure, it's a bit better than C but we have plenty of other choices!

* String interpolation? None, use the error-prone sprintf.

* Error handling? Go only provides multiple return values, and you'll make one of these values an error. Be prepared to write `if err != nil { return nil, err }` millions of time.

* Generics? They have finally arrived but in a simplified way, which doesn't allow to remove all duplicated and boilerplate code. No functional programming for you!

* Default arguments? Not with Go. Well, that's a pity.

* Dynamic libraries for plugins? Somewhat supported but that's going to be removed (see discussions on golang's github repo)

IMO the only benefit of the Go language is its lightweight and easy-to-use concurrency runtime.

·
Reply
Lead Developer at Black Swan Data·
Recommends
on
Golang

Golang is to my mind by far the greatest bang for your buck in terms of investing your time it has a low barrier to entry. Elixir is fun and all, but it is VERY VERY niche. You are very unlikely to find a job directly requiring Elixir. Rust is a good option depending on what you want to achieve but golang is a great general-purpose language that has a very approachable learning curve, great documentation and a lot of jobs available. There are some very high profile projects written in golang. Docker, Kubernetes, InfluxDB and Grafana just to name a few. I was at this same junction at the end of 2018 having spent a lot of time in JS/TS & Ruby. I had already learned Elixir and done a couple of projects in it and I switched to Golang as I didn't want to learn niche languages. I have never regretted my choice. Obviously, every tool has its place but golang is a winner if you want to learn something new :)

READ MORE
7 upvotes·53.1K views