Programming Leftovers
-
Rlang ☛ simulating Gumbel’s bivariate exponential distribution
A challenge interesting enough for a sunny New Year morn, found on X validated, namely the simulation of a bivariate exponential distribution proposed by Gumbel in 1960, with density over the positive quadrant in IR² Although there exists a direct approach based on the fact that the marginals are Exponential distributions [...]
-
MaskRay ☛ Exploring object file formats
My journey with the LLVM project began with a deep dive into the world of lld and binary utilities. Countless hours were spent unraveling the intricacies of object file formats and shaping LLVM's relevant components. Though my interests have since broadened, object file formats remain a personal fascination, often drawing me into discussions around potential changes within LLVM.
This article compares several prominent object file formats, drawing upon my experience and insights.
-
OSS History ☛ The Story of Elixir
The first was discovering functional programming — specifically, immutability. The concept of immutability meant that data was not shared across processes. This eliminated a category of problems plaguing other procedural and object-oriented programming languages. The second was his discovery of the Erlang Virtual Machine.
Erlang was first developed as proprietary software within Ericsson in 1986. It was later released as free and open-source in 1988. It was designed to scale telephony systems that required fault tolerance and distribution. Erlang supported concurrency both within a single machine and communication between machines. The latter was something other languages did not support easily.
José's exploration into functional programming wasn't limited to Erlang. He delved into languages like Frink and Clojure, enriching his understanding of functional paradigms. However, it was the capabilities of the Erlang VM that ultimately inspired him.
Recognising its potential, José chose it as the foundation for his own programming language — Elixir.
-
[Old] Discord ☛ How Discord Scaled Elixir to 5,000,000 Concurrent Users
From the beginning, Discord has been an early adopter of Elixir. The Erlang VM was the perfect candidate for the highly concurrent, real-time system we were aiming to build. We developed the original prototype of Discord in Elixir; that became the foundation of our infrastructure today. Elixir’s promise was simple: access the power of the Erlang VM through a much more modern and user-friendly language and toolset.
Fast forward two years, and we are up to nearly five million concurrent users and millions of events per second flowing through the system. While we don’t have any regrets with our choice of infrastructure, we did have to do a lot of research and experimentation to get here. Elixir is a new ecosystem, and the Erlang ecosystem lacks information about using it in production (although Erlang in Anger is awesome). What follows is a set of lessons learned and libraries created throughout our journey of making Elixir work for Discord.
-
Medevel ☛ How to Create a JavaScript Countdown Timer?
Certainly! Below is a simple example of a countdown timer using HTML, CSS, and JavaScript. You can copy and paste this code into an HTML file and open it in a web browser to see the countdown in action.
-
Shell/Bash/Zsh/Ksh
-
Xe's Blog ☛ Today I learned that bash has hashmaps
Hashmaps (associative arrays) are a great way to store a bag of key-value data. At work I was writing something that needed me to spawn a bunch of GPU instances, GPU availability is spread out by region and GPU type. I wanted to store a mapping of GPU kind to region name and for some reason I thought it would be a good idea to do it in bash. I was horrified to find out that bash has hashmaps, and decided to write this note to tell you how to use them.
-