Spawnfest 2017!

Last weekend (9-10.12) I took part in SpawnFest2017 and I’ve got some thoughts to share

What is it?

SpawnFest is a hackaton (programming challenge to write a project in some limited time) that was all about BEAM – Erlang’s virtual machine. All projects have to run on top of that (so you had to write it in Erlang/Elixir/LFE or something other from this family). You could add JS for frontend, use some third-party libs, etc. This was first edition in 5 years, so I had to take a part as I’m big BEAM enthusiast.

Warning, personal stuff below!

It was my firs (organised) hackaton. 48h deadline was quite stressful, and a lot of things didn’t work. Being at beginner+ level didn’t help either. But it was so much fun! I worked with my 3 friends on silly idea that we managed to bring to life. I learned a lot about not only Elixir, but developing and working under that kind of a stress. Memes were created and we never lost good spirit. A lot of code created was poor quality, but it didn’t matter. We did something in language we’re excited about, together, in less than 48 hours. That was magical. I cannot recommend enough taking part in SpawnFest – it was well organised, everyone was welcome and all the good things I cannot describe with words. It felt really awesome! Funny thing, when this all was over I was reminded that there are winners and prizes (Judges are still voting), but for me I already got the best prize – which is experience from this event

So, what did we do?

Application to monitor plants. We planned to have thermometer and proximity sensor, but we didn’t manage to get it work in time, so we added buzzer to hydration and humidity sensors. This app (written using Nerves) communicated from Raspberry Pi to our webapp written in Elixir, that was deployed in Heroku. What was shocking – how damn fast it was! Below I’ll paste README description of short video demo that we made.

There’s Elixir app with Phoenix fronend opened, showing sensor output. Sensors are connected to raspberry pi. When sensors are dry it will show cactus, when wet it will show water drop. First there’s humidity sensor – if we spray it, the second image will change. As it was not dried properly you can see some changes later, as water drops flows down the sensor. Next there’s hydration sensor put in the glass of water – first image will change. Below the images are charts with sensors data grouped by hour.

Finally “warning” button is pressed, and buzzer turns on. “Warning” button is a switch, so pressing it again turns the buzzer off.

VIDEO

See you next year! 🙂

PureScript: The First Look

After ElixirConfEu I decided to try PureScript. Partly for yet another frontend try, party because it looked interesting and partly because I wanted a little break with something way different and new.

I read a bit of this awesome book and did some of the exercises. Here are some first thoughts:

The bad:

  • Install npm, to install bower, to install dependencies. I get it, it’s JS. It’s frontend. It’s too young to have its own package manager and it’s even better that it uses a common tool. But come one, you can do it better than this. Especially if apparently you can compile to C/Erlang/someothers – not only JS.
  • Haskell-like docs. It’s not the worst, but it’s really not newbie friendly.

The good:

  • Types! This is the most awesome thing, really. You specify what type goes in, what goes out. It’s marvelous, especially for someone with a strong C# background.
  • Quite obvious, FP approach
  • Book (mentioned earlier) is a great learning resource. It’s free and written by PS creator
  • I know that it’s not something crucial, but I really like the syntax
  • How easy is to start, VSCode tools are great, you can google stuff and get some answers already
  • The community seems small but nice
  • Error messages are really, really helpful!

As you can see, there are way more “goods” than “bads”. Should you try it? Definitely? Should you use it in your pet project? Sure! Should you use it in production? It depends 😉 After going with dotnet core RC1 in production I’d say “hell yeah” but this requires the team that wants (not “can“; want!) to handle it, so my answer here is “it depends”. Nevertheless, I’m hyped and will do something more with it, but the break is over and I’m heading back to Beam world now.