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

PragTob
Hello everyone, I know we had quite some threads (read through lots of them) about background job processing but it remains a hotly deba...
New
blackode
Elixir Upgrading is so Simple in Ubuntu and It worked for me Ubuntu 16.04 git clone https://github.com/elixir-lang/elixir.git cd elixir...
New
arpan
Hello everyone :wave: Today I am very excited to announce a project that I have been working on for almost 3 months now. The project is...
New
Fl4m3Ph03n1x
Background A few days ago I was listening to The future of Elixir from Elixir Talks, with Dave Thomas (@pragdave ) and Brian Mitchell. I...
New
New
nburkley
AWS re:Invent is on at the moment with some interesting announcements. One new feature in particular is the Lambda Runtime API for AWS La...
New
Qqwy
Looking at the stacks that existing large companies have used, WhatsApp internally uses Mnesia to store the messages, while Discord uses ...
New
rms.mrcs
A couple of days ago I was discussing with a friend about different approaches to write microservices. He said that if he was going to w...
New
klo
Got a question about when to concat vs. prepending items to list then reversing to achieve appending. So i know lists boil down to [1 | ...
New
dogweather
I wrote this comment on r/haskell, and it’s not popular there. :wink: But I think I’m on to something… Haskell reminds me of Java, and e...
New

Other popular topics Top

sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
985 42842 311
New
aesmail
Hello guys, I have finally made it. I created an admin interface for a framework. It’s been on my todo list for years and with the curre...
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
chrismccord
This release brings a number of exciting features, including integration with the new Phoenix LiveDashboard and Phoenix LiveView. There h...
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
jason.o
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New
KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 35953 110
New
dblack
I’ve got an issue with an app and I’ve no idea of how to troubleshoot it. I’m hoping someone here might have seen something similar. I p...
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
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

We're in Beta

About us Mission Statement