Latest Posts (14 found)

Is this JS function pure?

In 2019, as functional programming was making the last inroads dethroning OOP, I kept hearing the mantra of “just use pure functions” in JS. Something didn’t sit right with me when talking very deterministically about pure functions in a large unpure language like JS. Especially, after seeing JS tooling perform optimizations based on a pure annotation (like webpack) . While everyone agrees is pure, I felt there are a lot of subtle situations where disagreements might arise. What is worse than terms with imprecise meaning is terms with imprecise meaning where people using them are not aware there is imprecision.

0 views

Why formalize mathematics - more than catching errors

I read a good post by one of the authors of the Isabelle theorem prover, that got me thinking. The author, Lawrence Paulson, observed that most math proofs are trivial, but writing them (preferably with a proof assistant) is a worthwhile activity, for reasons similar to safety checklists - “Not every obvious statement is true.” As I have been a bit obsessed with doing formalized mathematics, this got me thinking about why I am excited to spend many hours recently writing formalized proofs in Lean for exercises from Tao’s Real Analysis (along with this recent attempt to write a companion to Riehl’s Category Theory In Context ). On a very personal level, I just like math, computers and puzzles, and writing Lean proofs feels like doing all three at once. But I do believe formalization is important beyond nerd-snipping folks like me.

0 views

Learning Lean: Part 4

It’s been 3 months since my previous post about learning Lean part 3 , so it’s time to write another one. I have mostly continued to work through Tao’s Analysis book through his excellent companion - which means all proofs from the paper textbook are fully formalized in Lean, while examples and exercises are stated in Lean but left with a for me to fill in. Altogether the companions has close to 2000 sorries to fill-in.

0 views

Learning Lean: Part 3

I am continuing to learn Lean (see part 1 and part 2 ). I lost some steam around March-April, but in the last two months I picked it up again. In a way it was a nice spaced repetition for relearning some of the basics. This summary was supposed to be my notes from finishing the rest of Mathematics in Lean and finishing chapters 2 and 3 of exercises from Terence Tao’s Analysis textbook , but also I couldn’t help also comment on the challenges and opportunties I see in doing formal mathematics with Lean.

0 views

Thoughts on Signals in the JavaScript Ecosystem

Around 5-8 years ago when working on Angular and TypeScript rules in Bazel, I got very interested in exploring the core ideas of incremental computation, which seemed like the right way to abstractly (but still precisely) describe the similarities between build systems and UI reactivity. As an aside, incremental dataflow is a third view into the same concept, but I am least familiar with it. I wrote the following series of posts to try to pull all the different threads together. It was useful for me to put something to paper, but at the end I failed in painting a picture as clear as I wanted.

0 views

Learning Lean: Part 2

I am continuing to learn Lean (see part 1 ) by going through Mathematics in Lean . These are my notes as I just finished chapters one through five. The online book is well-paced and well-written to connect with what an average student of mathematics already knows. The focus is on learning how to do basic mathematical proofs in Lean, and the underlying language is taught as needed for those goals, in comparison to Theorem Proving in Lean which is more of a language guide. For example, the fact that naturals are constructed as an inductive type with zero and succ constructors is shown much after one is shown how to work with them. This is aligned with how a lot of mathematics is done before one discusses foundations in a typical mathematics curriculum, which might differ from a CS one.

0 views

Learning Lean: Part 1

I’ve been captivated by the recent movement to popularize mathematics formalization through the Lean theorem prover, and this year I’m diving deeper into learning it. For those unfamiliar with this revolution, I highly recommend watching Kevin Buzzard’s talks on YouTube for an overview of why formal mathematics is generating such excitement in the mathematical community. The immediate benefits of formalization are well-documented: it helps catch errors in proofs and reduces the need for trust between collaborators since every step is mechanically verified. However, I believe there’s another compelling advantage that’s less frequently discussed: formalization enables a better separation of concerns in mathematical writing.

0 views

Ticket to Ride: First Journey simulation authored with AI

After playing Ticket to Ride: First Journey with my family recently, I got the urge to analyze some statistical properties of the game. This seemed like an excellent opportunity to experiment with Cursor AI and explore more automated approaches to coding. Here’s what I discovered. After a couple of hours the AI and I produced the following analyses: The 32 tickets in the game can be categorized by their optimal paths:

0 views

Puzzles2024

As the year draws to a close, I want to share my favorite puzzle games from 2024. This isn’t meant to be an exhaustive review or ranking of all puzzle games released this year, but rather a personal reflection on the games that captured my attention. If you’re new to the puzzle genre, I recommend starting with the essential thinky games list - all of those titles are excellent.

0 views

Aoc2024

Advent of Code AoC is an annual programming competition that releases daily coding puzzles throughout December. For the past four years, I’ve tackled these challenges from the West Coast, where the 9 PM PST release time perfectly suits my schedule. While I compete for points on the global leaderboard (with modest success), the real joy comes from the community around it. Through Stripe’s solution-sharing Slack group, and the active r/adventofcode community, discussing creative approaches to challenging problems adds an new dimension to my favorite pastime - solving puzzles.

0 views

Incremental Computation (part 3)

Maybe you wondering why did I use TypeScript for this post. As it happens I have been working in the frond-end community in the last 8 years. My interest in incremental computation started by observing the similarities between some of the work I have done inside Angular’s “change detection” algorithms, and work I have done around integrating TypeScript’s compiler in Google’s build system . Why is incremental computation naturally appearing in UIs? As the user is interacting with an UI they are providing new inputs. Usually, these inputs are small compared with the initial input to the UI. On the other side the producing the DOM is the quintessential “expensive” computation. If it redone on each user input the UI will be unusable. So all UI frameworks attempt to solve the incremental computation problem, struggling with the fact that JS has no support for incremental computation. To make matters worse as we have seen incrementality is easier in a functional language, but JS is not well suited to that paradigm (which doesn’t stop people from trying).

0 views

Incremental Computation (part 2)

We have been talking about general computation, but so far our language was very limited. We only used function calls, numbers, and simple variable binding. We will slowly add more language primitives and see how to still have full incrementality of the computation. Let’s add a single conditional statement first. What does it mean to make incremental? Say we compute the result first for some values of , , .

0 views

Incremental Computation (part 1)

Incremental computation is a way of performing computations, with the expectation of future changes in the inputs to the computiation. When those changes occur the output can be updated efficiently, at minimum faster than redoing the whole computation from scratch. This problem occurs in many programming domains - UI programming, data flow, build systems, compilers, code editors. Likely you have seen it before, but didn’t call it incremental computation. Despite its prevalence, it is rarely viewed as a common computational paradigm. It is more often referred to as an ad-hoc application of caching or memoization. In comparison, other computational paradigms like concurrent, lazy, distributed computation have better known nomenclature and techniques.

0 views

About

Hello! I’m Rado Kirov, a front-end engineer at Stripe where I maintain stripe.js . Before this, I worked at Google on front-end infrastructure, helping build core technologies like Angular, TypeScript tooling, and the Closure Compiler. I started my career in academia as a mathematician, completing a postdoc before transitioning to software engineering.

0 views