Reversing Wheel File

Let’s talk about wheel today, definitely hoping it was a ferris wheel but its going to be python’s wheel for now. A wheel file is a relocatable package format for distribution of python packages for easy, quick and deterministic installations. All the packages published on pypi have under their Download files section a tar file and whl file. For example you can head over to Django and download its wheel file which can then be installed simply by doing...

June 14, 2024 · 4 min · 744 words · Lakshya Singh

Union/Sum Type

Let’s take an example of operating system information as a data structure to better understand sum types. Struct Our bare minimum struct to represent an operating system contains a few common fields that would exist in each of the operating system. typedef struct { char organization[]; int releaseYear; float version; int is_opensource; } os; It’s missing one thing though the type of operating system like macOS, linux, windows, etc. Enum We will add in a new field into our structure to represent the type of operating system by using an enum....

January 20, 2024 · 7 min · 1301 words · Lakshya Singh

Kotlin Coroutines

Coroutine A coroutine is an instance of a suspend-able computation. It is conceptually similar to a thread, in the sense that it takes a block of code to run that works concurrently with the rest of the code. However, a coroutine is not bound to any particular user level thread. It may suspend its execution in one thread and resume in another one. This scheduling of coroutines is handled by the Kotlin dispatchers similar to go runtime...

January 14, 2024 · 8 min · 1522 words · Lakshya Singh

Goroutines

A goroutine is a lightweight thread of execution managed by the Go runtime. To start a new goroutine we use the go keyword go f(x, y, z) The evaluation of f, x, y, and z happens in the current goroutine and the execution of f happens in the new goroutine. Goroutines run in the same address space, so access to shared memory must be synchronized. The sync package provides useful primitives, although you won’t need them much in Go as there are other primitives like channels....

December 24, 2023 · 4 min · 843 words · Lakshya Singh