grych

grych

Creator of Drab

A Year(++) With Elixir Building Drab

or: How I Learned to Stop Worrying and Give Elixir a Try

In the last November I’ve posted here the first mention about Drab library. Let’s do some annual recap then :slight_smile: I am putting it in the lounge, as it will be more on the history and my impressions about Elixir and the community.

Dark Age

Before being a humble alchemist, I’ve spent few years building Rails apps. I like Ruby, I like Rails: when you have some experience, you may create great applications with ease and fun. But, while building an app for my current employer (an app to take over my position, as I am a kind of administrator/dba), I’ve realized that there is a stuff, which is very hard to archive with the standard html/ajax architecture. In details, it was a part of an app, which runs long-running tasks in a background, step by step, with checking a step status and generated data, and user interaction (or not, if not needed), between the steps.

Finally, I’ve made this software, but I’ve realized that the effort I’ve spent on building communication between the interface and the backend was enormous. And ridiculous. Especially the part, when the background process finished the step and should communicate it to the browser. And the background must wait for the user’s answer. Hell.

This is why I wanted to build a software to communicate from the server back to the browser. When Rails 5 comes with websockets, I’ve even started to build Drab-like thingy in Rails, but I’ve quickly realized that I will drown in threads, processes, etc. I wanted to launch a thread/procces to each event coming from the client (just like the modern Drab does) and allow it to access the UI. I gave up.

Enlightenment Age

I really like to learn new programming languages and techniques, so I was on track with Elixir, but not very deep. I’ve got it installed, done a tutorial until OTP (I remember my first though on OTP was simply: WTF?). And then I’ve read a blog or saw a video about concurrency on Phoenix. It was about spawning tons of Erlang processes with ease. That was what I needed. I decided to give Elixir a try.

After few months of reading books, doing all the available tutorials, and asking stupid questions on elixirforum, I realized that I have the basic knowledge to start building Drab on Phoenix on Elixir (I was completely wrong about my knowlege ;)). First, I’ve built a simple Phoenix app, which has only one purpose: to send any JS back to the browser and have a result back.

Then I’ve designed a simple, jquery-like API (I’ve chosen jQuery because I didn’t want to deal with JS at the time) and started to implement Drab core libraries. It was still a part of the proof-of-concept app. I’ve decided to show the POC page to the community and then decide if should continue it or not.

Why “drab”?

In Polish, which is my mother tongue, it means a ruffian, a scoundrel. The name is short, easy to pronounce for almost everybody, and meaningless in English. Yes, I didn’t realize what “drab” means in English at the time, I was too lazy to check :wink:

Golden Age

At November 16th 2016, early evening Geneva time, I’ve posted the idea of Drab to elixirforum. I was afraid of the response. Sometimes you feel you are having a great idea, but it is great only for you, but not for others. So I just asked: “is it worth to develop further, or old good Ajax is good enough for everyone, and websockets are only for chats?”

And the response from the community was friendly and uplifting. It was way more than I expected.

Community

I’ve never saw the community like this in my long live. There is no bad questions asked, there is no anger to beginners asking stupid things, it is a harmony, happiness and hearts :wink:
For the future purposes of Drab, I’ve made a PR to Elixir’s EEx library. The approval process made me happy, it was so constructive and friendly. Show me another programming language where you can modify the stdlib for your purposes with such ease!

Modern Age

After this, I’ve decided to continue working on Drab, and this is where we are now!
Drab is not jQuery dependent anymore (it was a popular request here on forum), it has a magic Drab.Live module to do a live updates of assigns, and it has 268 posts on its thread on elixirforum :slight_smile: A lot of ideas were born here (but some of them died here as well).

Future Age

There is still a lot of work on Drab, but I can solve it step-by-step. Drab core needs refactoring, as the code is ugly and unreadable and overcomplicated. I need to develop the helpers for testing user’s commander functions. Also I need to rethink the whole broadcasting stuff. And finally to provide a stable, production version in the future. So say we all!

Most Liked

benwilson512

benwilson512

Author of Craft GraphQL APIs in Elixir with Absinthe

You should consider submitting a talk proposal to the next ElixirConf with this kind of content :slight_smile:

mbenatti

mbenatti

I saw your job a few weeks ago,
I never used it(drab), but I pretend to use.

It’s amazing to see a guy like you in Elixir community and doing a great work alongside the community,
congratulation for the amazing work,
I expect to test it in near future and I hope that will be a production release soon

AstonJ

AstonJ

Wonderful account of your Elixir & Drab journey Grych!! And likewise, it hasn’t gone unnoticed how you have been helping members getting to grips with Drab :023:

Shall I move this to Elixir Chat btw? (It’s the perfect section for things like this ;-)). This section (the Lounge) is only visible to those who unmute it from their control panel - so not everyone will see it here.

Where Next?

Popular in Discussions Top

pillaiindu
I want to convert a Phoenix LiveView CRUD website to a CRUD mobile app. What do you think is the easiest way to do so?
New
AlexMcConnell
The reason that Rails is as popular as it is is because it’s very easy for relatively inexperienced developers to get a lot of work done....
588 19568 166
New
fireproofsocks
I’ve been working on an Elixir project that has required a lot of scripting. I usually reach for Elixir because I like it more (and in th...
New
rower687
Hi all, I’ve been reading a lot about the “let it crash” term and how supervising processes and the whole messaging passing make an elixi...
New
shishini
I think this twitter post and youtube video didn’t get as much attention as I hoped I am still new to Elixir, so can’t really judge ...
New
RudManusachi
What configs will make sense to put to runtime.exs? – A bit of how I configure apps: I have generic configs in config/config.exs, dev...
New
cblavier
Hey there, It’s been more than a year since we started using LiveView as our main UI library and building a whole library of UI componen...
New
ben-pr-p
In general I’ve been sticking to this community style guide GitHub - christopheradams/elixir_style_guide: A community driven style guide ...
New
acrolink
How does the two languages compare when it comes to server side application development? Any experiences or ideas? Thank you.
New
Markusxmr
Since Drab has been developed for a while in the open, introducing the Liveview functionality in a way it happend appears to undermine th...
New

Other popular topics Top

lastday4you
I wanted to check elixir version in phoenix because i found that my elixir is 1.5 but when i use Enum.chunk_by it said the function is un...
New
TunkShif
This post is an instruction guide to help you setup your Neovim for Elixir development from scratch. It includes general information on h...
274 41539 114
New
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
Nvim
Anybody knows a comprehensive comparison of Django and Phoenix, thanks for the help. Where are they similar? Where do they differ the m...
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod – where is this set? Thanks.
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
sergio
Kind of like when jquery came out, it was super necessary. Existing drag and drop libraries have a bunch of baggage to support old browse...
New

Latest on Elixir Forum

We're in Beta

About us Mission Statement