D4no0

D4no0

It seems that people are very fired when it comes to discussions about static typing, namely these 2 topics received a lot of interaction:

  1. Type system updates: moving from research into development
  2. https://forum.elixirforum.com/t/discussion-on-the-benefits-of-static-typing/56874 (this is actually offtopic from the first thread, but don’t tell anyone)

One of the prominent conclusion was that enforcement of something (in that instance types) in a language is a good thing.

Now we can all agree that immutability is thing that makes concurrency and distribution a 100 times easier, as there are strong guarantees that data passed around will not be mutated, however this is not a feature, but subtraction of feature from the language just as types are enforcement to specify types for everything.

If we agree that enforcement is a great thing, as it brings a lot of guarantees to the table, how comes the usage of functional languages is not the norm? For example haskell not only enforces types, immutability but also there are no side effects in the language, all effects are managed, another enforcement that is very powerful and can bring guarantees to the table.

From my personal understanding, here a few things that stop adoption of functional languages at large scale:

  1. Steep learning/relearning of new base concepts and a new style of programming, this is especially true for people used to OOP and mutable code style, I found that new people coming to development find functional approach much more easier and natural to understand;
  2. The misconception that immutable languages are not efficient because they cannot mutate state, this great talk shows that this doesn’t have to be the case: https://www.youtube.com/watch?v=vzfy4EKwG_Y;
  3. People thinking in designing software in terms of Classes/Objects and not data flow/transformation, witch has to be the biggest stopper, as people cannot leave the OOP behind.

I am sure that there are people here who worked in a pure functional language in production and can tell their findings/conclusion on this, because as much as we love elixir, it partially a functional language that cannot be classified as a full-fledged functional language.

PS: When we talk about performance, I would like to point that the comparisons are made in regard to high-level languages, languages like c/zig/rust are out of the question as they are targeted at low-level things.

Showing Posts 1 to 1

adw632

adw632

Some of my thoughts and this is not exhaustive..

In some respects Erlang/Elixir is kind of object oriented when we consider processes. Processes as objects hide their state and respond to messages, they also run in a isolated execution context from other “objects as processes”.

The value proposition for me in Elixir/Erlang was scalability and fault tolerance using a concurrency model that didn’t expose threads, mutuxes, critical sections, semaphores or condition variables. It provided a paradigm that was free of race conditions with a sane approach to serialisable state management through process isolation and inter process messaging built into the core of the language.

Those things and supervision trees/process monitors with guaranteed notification all work together to provide distributed fault tolerance, scalability and mostly lock free execution within a single process/object context.

How many other languages were designed with these realisations?

When I consider OO systems you basically have a complex global mesh of object references and multiple threads of execution crawling all over it and mutating it in parallel. It is no wonder the number of possible edge cases is so much higher and the determinism and reliability of the resulting systems are so much lower.

Object state management in OO was never fully thought through from a concurrency perspective IMO.

Erlang did approach things differently with cheap isolated processes managing state, userland scheduling and process monitors which is why latency is very predictable and we get scalability and resilience with very little effort.

It is also not enough to bolt on immutability on a language where it is not enshrined from inception. The ecosystem is not able to support the developer being immutable everywhere because the standard libraries and community packages don’t fully adopt the paradigm.

When Jose came along and gave Erlang a modern fresh face he dramatically improved the usability and approachbility of the language IMO.

Elixir code can also be a thing of beauty with the functional Create |> Reduce |> Convert (CRC) pipeline paradigm which many other languages would have you writing the steps inside out.

In my view Elixir provides the sweet spot of what I care about from a expressibility, testability, scalability and reliability perspective. I can build solid systems without requiring lots of other tools and supporting components that I would need using other languages.

When I consider the full end to end costs of developing, maintaining and operating a robust service over time, Elixir is the most cost effective technology I have used.

The kind of developers I want on my team can pick it up quickly and appreciate the features that make it a killer solution once you’re live. Even if Elixir is not the most popular language, that is fine by me, the competitive advantage it offers is what actually matters.

— All posts loaded —

Where Next? Top

Trending in Discussions Top

AstonJ
As the title says, please share what you’ve been up to with Elixir. Whether that’s been learning it, looking into it, making stuff with i...
2977 91898 914
New
AstonJ
The obligatory hello world thread! Who are you and where are you from? :stuck_out_tongue:
4616 55835 594
New
byu
@chrismccord : I just saw the Extract AGENTS.md from Phoenix.new into phx.new generator commit to the phoenix project. My initial shotgu...
New
arcanemachine
I was working on an Ecto migration and I needed a timestamp. So, for the nth time, I looked up the different data types for timestamps, a...
New
alexslade
Fly’s CEO posted this recently - Turn And Face The Strange · The Fly Blog It says that Fly is going all-in on sprites, which is a worry ...
New
Herve37
We’re evaluating API mocking tools for OpenAPI-based projects and would love to hear what other teams are using. We’re particularly inte...
New
matt-savvy
Is there a word for the ~> symbol used in Version strings? Do you also just call it a Squiggle Arrow™ ?!
New

Other Trending Topics Top

JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
mcass19
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
ausimian
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews