Why I built an alternative to plug (Raxx), and why I based it on Rack

There is now a channel on slack for this project. https://elixir-lang.slack.com/messages/C56H3TBH8/details/

A post was split to a new topic: Raxx -

Canā€™t believe it took me this long to find this paper ā€œYour Server as a functionā€

Operations are phrased as value transformations,encouraging the use of immutable data structures and, we believe,enhancing correctness through simplicity of reasoning.

While most of our engineers find the programming model un-usual, they tend to internalize it quickly.

The whole paper is discussed in a Scala/Java context so some parts donā€™t translate well, e.g. there is no need to talk about Futures. However it is interesting to see some of these ideas explained more rigorously than I ever managed when talking about Raxx.

There is also a discussion about interrupting ongoing processing, for example in the case of a timeout.
This is an equivalent here, in Elixir/Erlang. e.g. a Gen call can timeout, but the processing will continue and the reply potentially be returned to the mailbox later.

Is anyone sending interrupt message to processes in the case of a call timeout.

Finally the paper is in a typed language. The idea of statically verifying that only authenticated requests are passed to a service(http handler) that requires authentication is very appealing.
Although less easy to see how this can be useful in Raxx, it might be useful to Midas,

4 Likes

Aw man, just as I ā€œgot into itā€ he started talking fast as hell. Streaming actually sounded nice, is there any ā€œfullā€ version of his speech?

You can slow down the playback speed on YouTube Mr GD :smiley:

I think Peter has done a few talks about Raxx and this one seems to be one of the latest:

IIRC I think he shifted focus on to a Raxx-like framework for Gleam, called Midas: GitHub - midas-framework/midas: A web framework for Gleam, Midas makes shiny things.

Perhaps @Crowdhailer can give us a little update on what heā€™s up to these days :003:

2 Likes

Sorry about that, You found the very first, I hope Iā€™ve got better with time.

Iā€™ve done quite a few talks on Raxx, though not very recently. I think itā€™s now so stable to not be interesting. It gets a lot of downloads on hex. Though not that many PRā€™s to fix the depreciation warnings.

@AstonJ is right that right now my focus is on Gleam. Basically with Raxx I felt like I was fighting against the Elixir ecosystem to get to simplicity and solid functional programming principles.
In Gleam basically every interface is as nice as the Raxx one, and you get a compiler to tell you when youā€™ve made a mistake. I love Gleam but itā€™s pretty early days for it.

Anyways donā€™t take anything away from Raxx itā€™s still solid and useful, just not making much noise about it.

3 Likes

I tried to understand the pricipal difference between Raxx and Plug and I believe it is that

  • Raxx uses a middleware stack that wrap each other: they call the next middleware and can work with the return value of the ā€œinnerā€ call
  • Plug uses a ā€œforwardā€ model where each middleware is called in order, their return value is passed to the next middleware.

Is that is ?

1 Like

I think Raxx fell into the same trap that Sinatra did - it focused on simplicity but people wanted all the bells and whistles of frameworks like Rails and Phoenix :lol: however the Elixir community has grown a lot since then, and I wonder whether you might find that enough people now may be interested in such a framework?

Iā€™m curious what you mean by the latter part of your sentence - in what way did the Elixir ecosystem get in the way of functional programming principles?

1 Like