Introduction

I am a rubyist and have been since 2006 – I still totally love it.

But, it has its weaknesses mainly around concurrency, the GIL etc… But, we are all hoping that ‘guilds’ will sort that and its coming in ruby 3.

But, I still keep looking for something else that is not going to be a replacement for ruby, but potentially a partner for it.

I have studied (and loved) Elixir and Go – both are fantastic and I would use them given a project that wanted them. Then, along came ‘rust‘ to divert my attention.

If this were a language competition I wouldn’t have a clue where to start saying what is better at what, so my measure of the best partner for me to use with ruby when serious performance or scalability is required is the ability to work with ruby – so I could take a system that I had written in ruby and take a part of it and re write in rust for example.

My Venture Into Learning Rust

This whole venture might just be me wanting to learn something new – I’ve done it lots of times before and came back a better ruby developer – learning from all of the other fantastic languages available in this fast paced world we live in.

So, I wanted a project. Im in the middle of a contract at the moment work wise, so doing a commercial project is not an option, so I invented a project for myself.

My Project

The project is my IOT network at home. Because I am a bit of a nerd, I have electronic radiator valves, a room thermostat, a nice controllable air source heat pump for heating and hot water, an energy monitor and some switches for things like lights etc…

I started this same project in Go before rust grabbed my attention (Sorry ‘Go’ – I’ll be back Im sure). To start with I will develop an API client for the Energenie MiHome system (for the radiator valves etc..). This client will be able to do normal REST calls to get the current state of things and also provide a publish / subscribe interface to register for changes in devices.

Following on from that, I will develop a ‘MELCloud‘ (Mitsubishi Electric – for the heat pump) API client with similar interfaces.

Both of these will be crates containing a library and one or more command line tools only – no fancy GUI or anything.

The next challenge after that is to provide a web server that can host a nice GUI with websockets – possibly using React or VueJS using GraphQL with subscribe capability for a real live view of my devices etc… This GUI will have the ability to provide a simple GUI for a particular room – so I can dig out all of those old phones or tablets and put them to good use so family members can control stuff without having to shout at Alexa (because she never does as she is told and people end up swearing at her)

So, my project is defined (ish), my motivation to learn something new is sky high and Im ready to go.

Follow My Progress

The next episode will literally be my starting point after just reading the rust book and having messed around a bit. This is mainly for my benefit to log my journey – but if others want to have a read and see how I did it – go for it.

It is intended to be ‘Warts And All’ – so you will hopefully see me hacking to start with and probably writing some really bad code whilst I am experimenting. Then, as I love TDD – I will be starting to learn more about how to test the code that I have written – allowing me in the next phase to do proper TDD and write the tests first.

Next episode – Part 1


0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *