Anoop Elias

Application Developer at /thoughtworks,
Lives in Bangalore, India
anoopelias@gmail.com

Fragment specifiers in Rust Macros

Rust macros seemed like an enigma when I first saw it, but once I started understanding it a bit, it’s not all that bad! “Fragment specifiers” are what you see as the “type” of an argument that you might see in the invocation of the macro. The most common being expr. Like below, macro_rules! add_two_numbers { ($num1:expr, $num2:expr) => { $num1 + $num2 }; } fn main() { let _result = add_two_numbers!...

February 4, 2024 · 8 min · Anoop Elias

Introduction to WebAssembly

I had some experience with Clojure sometime back, those folks will teach Clojure extensively over REPL. I felt that the Lisp-like format is well suited for REPL-driven development. And when I saw the WebAssembly (Wasm) text format - which is very much a Lisp-based format - I thought, why not? So here I am, showing off my REPL for Wasm - wasmrepl - to talk about a few Wasm instructions and show how it works....

October 25, 2023 · 9 min · Anoop Elias

LLVM Compile Stages

While working on the previous blog post, I went on a tangent and tried to solve it by looking a bit more deeply into LLVM architecture. While that tangent was not fruitful for that post, I thought I would write those findings in another! LLVM is a collection of software tools that can parse, optimize, and link several programming languages into several targets. The main programming languages that use LLVM are,...

August 27, 2023 · 4 min · Anoop Elias

WASM Micro Runtime with Rust

Traditionally, microcontrollers are known to be able to run only C code. Firmware developers will usually have an Eclipse-based IDE as well as a custom compiler toolchain to compile the code against the target. This has been changing a lot. For example, MicroPython has become popular recently. RaspberryPi Pico, ExpressIf’s ESP32 are some microcontrollers that have fairly good support for MicroPython. See antirez’s talk32 project, which attempts to improve the MicroPython tooling and developer workflow for ESP32....

July 30, 2023 · 10 min · Anoop Elias

Event Loop in Go

“Single Threaded Even Loop” or simply “Event Loop” is a fairly well-known concept in the programming world. This concept was popularized early on by GUI frameworks and JavaScript engines running in browsers and later by Node.js as well. The important advantage of this construct is we can stop worrying about “thread safety” altogether. Thread safety comes for free because all you have is only one thread anyway. Another great example of usage of a Single Threaded Event Loop is Redis....

March 5, 2023 · 10 min · Anoop Elias

Network Address Translation

I had a Raspberry Pi 3 lying around, and I had a great idea. Let’s host a Tor relay! This is the story of that failed mission. To host a Tor relay, you need two things, A fairly good internet connection, A computer that can be online almost all the time, or so I thought. But the devil is in the details! We will get there in due course. Pi Setup The Pi already had an SD card....

October 1, 2019 · 7 min · Anoop Elias