vegabook

vegabook

Elixir vs ReactiveX

Are there any Elixir libraries which are similar to the Reactive Extensions? For example rxpy or rxjs ? I have been using rxpy and find it amazing. I know it is fairly easy to replicate this with Erlang/Elixir “primitives” but it’s still quite a lot more work to re-implement many of the operators. Is GenStage supposed to kind of do the same thing as ReactiveX? Any other, well-maintained, library for reactive programming?

Any advice on functional reactive programming in general in Elixir?

Most Liked

peerreynders

peerreynders

ReactiveX programming isn’t FRP.

Research into Functional Reactive Programming was popularized by Conal Elliot back in 2008 - though it actually goes back to his 1997 paper “Functional Reactive Animation” with Paul Hudak.

The Essence and Origins of FRP

peerreynders

peerreynders

Hmmm…

Reactive Extensions solve certain problems well in certain environments.

It just so happens that being “reactive” is only one single concern that any Erlang/Elixir solution design/architecture has to address. How “reactive” a solution is depends on certain design choices.

But in my opinion a problem that Rx is suited for is probably too large to fit in a single BEAM process (where everything happens sequentially) and once you break up the problem across multiple BEAM processes the use case for Rx typically goes away.

Some data stream transformation can be handled with GenStage - visualization would likely be a separate (front end) concern but I guess Phoenix channels could be used to inform the users of the transformation progress.

Imagine a BEAM process for every active cell in a spreadsheet - only each process can send an event to any other process that it knows about; incoming events are (usually) processed in the order they arrive; typically a single process has more responsibility than a single spreadsheet cell. Code execution within any one process is strictly sequential. Concurrency happens between processes.

peerreynders

peerreynders

For the time being you can use Pyrlang to reuse what you already have - then Erlang/Elixir can interact with that Python code (and the C code doing the real work) just like with any other node.

See also Elixir call python by ports.

Last Post!

vegabook

vegabook

Many thanks anyway. I have taken the liberty of pointing this hardcoded address out on the github issue.

Where Next?

Popular in Questions Top

Tee
can someone please explain to me how Enum.reduce works with maps
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
LegitStack
I’m trying to make a websocket server in Phoenix or raw Elixir. I heard about gun, I think I could use cowboy, but since I’m not that sma...
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
srinivasu
How to handle excepions in elixir? Suppose i have A, B, C ,D, E modules. and each module has get() function. A.get() method will call t...
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
PeterCarter
There are pre-rolled solutions for other frameworks that do work. However, Phoenix does not seem to have these. Have people had good expe...
New
shahryarjb
Hello, I get Persian date from my client and convert it to normal calendar like this: def jalali_string_to_miladi_english_number(persi...
New

Other popular topics Top

mcarvalho
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
josevalim
Hi everyone, One of the features added to Elixir early on to help integration with Erlang code was the idea of overridable function defi...
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
grych
Hi folks, Few months ago I have announced the proof-of-concept of the library to manipulate the browsers DOM objects directly from Elixi...
639 52774 488
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New
PeterCarter
There are pre-rolled solutions for other frameworks that do work. However, Phoenix does not seem to have these. Have people had good expe...
New
minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New

We're in Beta

About us Mission Statement