Journey with Rust
My third attempt of learning a systems programming language.
June 30, 2024
Reading Time: 5 minutes
Over the years, I have tried and give up on learning systems programming languages. I have tried both C and C++. Both are great languages from what I read and the proofs are out there. It's just that maybe I can't comprehend enough especially on the concept of manual memory management.
My Coding Journey
I have been coding on and off since 2010 and I can say that I haven't continued a career in coding from that year. There are years where I don't code at all. This just changes around the year 2016.
The first big project I created was way back in 2008 to 2009. That was for my thesis in college. A desktop software for structural analysis (I am a Civil Engineer by profession) written in Visual Basic 6.0.
After that, the next project I did was in 2013 where I created a desktop application in Visual Basic .Net. I coded the biggest app for me for 6 months straight including the studying of various principles of open channel flows over a diversion dam.
After that, my coding life paused again and just resumed on 2015 when I started a serious coding in PHP programming language. This is the time before Google decided to discontinue the Picasa web service. And so I created a web application similar to that and completed it in 2016. Also the time when I came across Python.
In between these times, I have tried and failed learning the C programming language. Maybe because of lack of inspiration on where to use it. I've never really planned on making systems applications. But when I saw Python, man you may not want to go back with C or C++.
By 2019, a colleague approached me as he knows I like programming. Coming to me with an idea for an application for their office. It was a software for building permit assessment. And since I am learning to code in python at the time, I gave it a shot and released the MVP (Most Viable Product) as stand alone application to them.
Around 2020 is where I wrote my next big project in Python. It was a Software as a Service (SaaS) deployed online and where I get a fair stream of income for a while.
But in 2022, it came back to me that I really wanted to understand computer and that I read somewhere that I needed to learn C in order to do that (as a tool to interact with the machine). And so I set up to get back in learning C and also setup a blog for documenting my journey. It was actually this domain syncster.dev
that I used in that blog. I called it CJourney. But then lost interest again for various reasons including my slow comprehension with quirks of computing systems.
And then I heard about Rust. A systems programming language that prioritize safety. It is said that it has a steep learning curve. But a few days ago, I decided on giving it a shot.
Inspiration
Aside from Python, I also learned the Go programming language. A statically typed language that is easy to learn. I really wanted to create desktop softwares both for hobby and commercial purposes. I stumbled upon Go and liked it immediately. However, I have encountered some issues. It's lack of GUI frameworks.
But still I gave it a try. I coded heavily on it, and tried building a desktop application using the Fyne GUI framework.
I can easily create GUI applications in Python but there is a small drawback. It's slower and I cannot package a desktop application properly especially if I wanted to deploy it to be downloaded by other users. I wanted something that is native to the operating system where the users can just install the app and be done with it.
And so I gave Go a try. I build a prototype of the app. The app looks like this.
![OpenFlow](/assets/01-openflow-C6zTY0Cy.png)
Well it's not natively looking but I was fine with it for a while. And then I get a little trouble customizing things. Also the biggest issue for me, is when I peeked at the task manager. It takes a whole lot of memory!
Other than that, I have trouble with the graphics on Windows when I move around. And so I stopped developing with it.
Yes I know, I liked Go even if it has a runtime for the garbage collection. But still, something tells me I can do more.
And I don't want to go back with Visual Basic for some reason and so I decided to give Rust a try.
Experience with Rust
I just started learning Rust 2 weeks ago. Trying to insert reading and learning in between busy workloads. It's slow but I am so far liking the language.
I decided to put my working codes on github but decided today to make it private in the meantime.
So far, I am encountering concepts that are new to me and only available in Rust. This is by the way its strength in being memory safe language.
To give it more chance, I will be building up small CLI tools for me to use in my day to day tasks. Just to get a hint on what I can do with it. Also by comparing it's speed, I think it's really comparable with C by benchmarking it with some codes I wrote in C a few years ago.
I wanted to give this a sense of commitment so I put it in this blog post.
this is just my entry with the language and I hope that I get to build real applications with it!
By the way, I am using the online book from the Rust website as my learning material and some video and internet searching if I got stuck on some topics. I decided to go on my own without enrolling to an online course for this one and hope that it give some result in the future. Wish me luck! 😄