Level Up Coding

Coding tutorials and news. The developer homepage gitconnected.com && skilled.dev && levelup.dev

Follow publication

VLang for Automation Scripting

Replacing Bash, Python, & Go with a language that’s SUPER FAST

Jeremy Cheng
Level Up Coding
Published in
6 min readDec 27, 2020

--

If you have been in the tech industry long enough, regardless of your role, chances are, you have used Bash or Python more than once to automate something that you would otherwise need to manually do repetitively.

I am obviously no exception and have written automation scripts since the early 2000’s. I have done projects from writing scripts to update thousands of servers for myself, to streamlining development/deployment processes for engineers, all the way to building application/firmware installers for end users. From my experience, there are three main factors that determine what scripting language I chose for each project:

  1. How simple is the syntax?
  2. How powerful is the language in handling complex automation issues?
  3. How fast does it execute?

In the past, if the automation project was straight forward with simple logic, I would always use bash scripts because it is relatively fast and the syntax is super straight forward. Automating a shell command is as simple as putting that command in a line of its own. For example, if I wanted the script to execute cat /etc/os-release all I had to do was something like this:

#!/bin/bashcat /etc/os-release

This saves a lot of time on development compared to a more complex language like Python. To do the same thing in Python, I would write:

#!/usr/bin/pythonimport osres = os.system("cat /etc/os-release")
print(res)

As you can see from the code snippets, it’s pretty clear why Bash is just simpler to automate non-trivial tasks. However, there are some automation projects that are a bit more complex and beyond the power of bash scripts. I would in that case forego performance and choose Python to automate especially when it comes to things that require more computation or a GUI (Gooey) to interact with users.

In the recent years, GoLang (Go) has become more and more popular and I started using it to develop some of my software projects. So I also began to use Go for automation since as a compiled…

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

--

--

Responses (8)

Write a response