When I was a kid in middle school (Class VI in the Indian education system), I can vividly remember learning about the “Five Generations of Computer”. The first few generations were about vacuum tubes and transistors, then came the integrated circuit. The current generation was the fourth - the age of microprocessors. But there was a fifth generation - the age of Artificial Intelligence. At that…
Introduction It all started after I came across this brilliant article: https://yklcs.com/blog/universal-libs-with-wasm . At my day job, we use the whisper library to transcribe audio calls and generate subtitles. Since our stack is entirely Go based, we use the CGo API to interact with it. However, after reading the article, I had a desperate urge to see whether the same can be done here as well!…
Introduction Last month my workplace enforced the requirement to have our laptop disks to be fully encypted. The only niggle was that I had already been using my laptop for several years and wasn’t terribly looking forward to setting up everything from scratch. I was left with two options: Set a weekend aside, take a full backup and reinstall everything, along with encryption this time. Take a…
In this post, I’d like to take you through a curious case of a MySQL performance regression that happened due to changing an index from a single column to a two column index. Introduction It always starts out the same way - someone complaining that a query is running very slowly on their system. This was no different . As the first step to debug any slow query, I asked the user to show the EXPLAIN…
Few months back, a HN post about learned indexes caught my attention. 83x less space with the same performance as a B-tree? What sort of magic trick is this?! And why isn’t everybody else using it if it’s so good? I decided to spend some time reading the paper to really understand what’s going on. Now reading a scientific paper is a daunting endeavour as most of it is written in small text,…
If you are a Sublime Text user, and looking to set up gopls integration with it, you have arrived at the right place. The primary documentation for gopls assumes you are using VSCode; and the rest are using GoLand, which leaves us Sublime Text users in a tight spot. This post attempts to fill that gap. The official documentation here just mentions how to install gopls, which is barely enough. But…
Go has had WebAssembly (wasm) support for a while now, but the tooling is still in it’s nascent stages. It is straightforward to build a wasm module from Go code, but running tests in a browser is still cumbersome, as it requires some HTML and JS glue to work, and generating a CPU profile isn’t even possible since wasm does not have thread support (yet). I wrote a tool wasmbrowsertest which…
UPDATE July 1, 2019 : The proposal has changed since the blog post was written. Stack traces have been omitted. Now, only the Unwrap , Is and As functions are kept. Also the %w format verb can be used to wrap errors. More information here . Original article follows: There is a new error values proposal for the Go programming language which enhances the errors and fmt packages, adding ability to…
The Go toolchain has the vet command which can be used to to perform static checks on a codebase. But a significant problem of vet was that it was not extensible. vet was structured as a monolithic executable with a fixed suite of checkers. To overcome this, the ecosystem started developing its own tools like staticcheck and go-critic . The problem with this is that every tool has its own way to…
The Go master branch recently finished a working prototype implementation of WebAssembly. And being a WASM enthusiast, I naturally wanted to take it out for a spin. In this post, I will be writing down my thoughts on a weekend experiment I did with manipulating images in Go. The demo just takes an input image from the browser, and applies various image transformations like brightness, contrast,…