~/devreads

Ruslan Spivak

https://ruslanspivak.com/ · 28 posts · history since 2015 · active

19 Aug 2025

Ruslan Spivak 3 min read

Quick question: How many numbers are there from 5 to 18, including both ends? Your first instinct might be to subtract: 18 - 5 = 13 Feels right. But it’s wrong. It’s a small thing, and kind of basic, but this mistake got me more times than I’d like to admit. Eventually I learned how to count ranges properly. :)…

15 Jul 2025

Ruslan Spivak 5 min read

“Mathematics is the art of reducing any problem to linear algebra.” — William Stein If you’ve ever looked at a vector and thought, “Just a column of numbers, right?”, this chapter will change that. The Dark Art of Linear Algebra (aka DALA) by Seth Braver opens with one of the clearest intros I’ve read. Not every part clicks on the…

20 Jun 2025

Ruslan Spivak 4 min read

“Where there is life, there is change; where there is change, there is calculus.” — Seth Braver I recently went back to studying math to rebuild my foundations for AI and machine learning. I didn’t expect to enjoy a calculus book this much. Shocking, I know. But that’s exactly what happened with Full Frontal Calculus. Can calculus feel intuitive? Even…

9 Aug 2024

Ruslan Spivak 2 min read

Hi everyone, Growth as a software engineer is an ongoing journey. Looking back, a few key principles helped me progress during the early days of my career. These lessons shaped my path, and many of them continue to guide me today, even though I’m no longer an individual contributor: Drive Ambition isn’t a skill — it’s a will. You either…

31 Jul 2024

Ruslan Spivak 2 min read

“Fundamentals are the foundation of excellence. Without a strong base, you cannot reach your full potential.” – John Wooden Hey there! Let’s talk fundamentals today. Why are they important? John Wooden’s quote sums it up nicely, but let’s unpack it a bit more: Strong foundation: A solid grasp of fundamental concepts provides a strong foundation for building advanced skills. Just…

19 Mar 2020

Ruslan Spivak 8 min read

“What I cannot create, I do not understand.” — Richard Feynman As I promised you last time, today we’re going to expand on the material covered in the previous article and talk about executing nested procedure calls. Just like last time, we will limit our focus today to procedures that can access their parameters and local variables only. We will…

1 Mar 2020

Ruslan Spivak 9 min read

Update Mar 14, 2020: I’m working on an update to the article based on all the feedback I’ve received so far. Stay tuned! I was reading Computer Systems: A Programmer’s Perspective the other day and in the chapter on Unix I/O the authors mention that there is no explicit “EOF character” at the end of a file. If you’ve spent…

20 Feb 2020

Ruslan Spivak 16 min read

“Do the best you can until you know better. Then when you know better, do better.” ― Maya Angelou It’s a huge milestone for us today! Because today we will extend our interpreter to execute procedure calls. If that’s not exciting, I don’t know what is. :) Are you ready? Let’s get to it! Here is the sample program we’ll…

28 Aug 2019

Ruslan Spivak 14 min read

“You may have to fight a battle more than once to win it.” — Margaret Thatcher In 1968 during the Mexico City Summer Olympics, a marathon runner named John Stephen Akhwari found himself thousands miles away from his home country of Tanzania, in East Africa. While running the marathon at the high altitude of Mexico City he got hit by…

23 Jul 2019

Ruslan Spivak 8 min read

“Learning is like rowing upstream: not to advance is to drop back.” — Chinese proverb Today we’re going to extend our interpreter to recognize procedure calls. I hope by now you’ve flexed your coding muscles and are ready to tackle this step. This is a necessary step for us before we can learn how to execute procedure calls, which will…

21 Jun 2019

Ruslan Spivak 15 min read

“I am a slow walker, but I never walk back.” — Abraham Lincoln And we’re back to our regularly scheduled programming! :) Before moving on to topics of recognizing and interpreting procedure calls, let’s make some changes to improve our error reporting a bit. Up until now, if there was a problem getting a new token from text, parsing source…

8 May 2017

27 Apr 2017

Ruslan Spivak 28 min read

Anything worth doing is worth overdoing. Before doing a deep dive into the topic of scopes, I’d like to make a “quick” detour and talk in more detail about symbols, symbol tables, and semantic analysis. In the spirit of “Anything worth doing is worth overdoing”, I hope you’ll find the material useful for building a more solid foundation before tackling…

1 Dec 2016

Ruslan Spivak 5 min read

“Be not afraid of going slowly; be afraid only of standing still.” - Chinese proverb. Hello, and welcome back! Today we are going to take a few more baby steps and learn how to parse Pascal procedure declarations. What is a procedure declaration? A procedure declaration is a language construct that defines an identifier (a procedure name) and associates it…

21 Sept 2016

Ruslan Spivak 15 min read

I was sitting in my room the other day and thinking about how much we had covered, and I thought I would recap what we’ve learned so far and what lies ahead of us. Up until now we’ve learned: How to break sentences into tokens. The process is called lexical analysis and the part of the interpreter that does it…

4 Aug 2016

Ruslan Spivak 12 min read

Today we will continue closing the gap between where we are right now and where we want to be: a fully functional interpreter for a subset of Pascal programming language. In this article we will update our interpreter to parse and interpret our very first complete Pascal program. The program can also be compiled by the Free Pascal compiler, fpc.…

1 May 2016

Ruslan Spivak 15 min read

I remember when I was in university (a long time ago) and learning systems programming, I believed that the only “real” languages were Assembly and C. And Pascal was - how to put it nicely - a very high-level language used by application developers who didn’t want to know what was going on under the hood. Little did I know…

18 Jan 2016

Ruslan Spivak 5 min read

Today we’ll talk about unary operators, namely unary plus (+) and unary minus (-) operators. A lot of today’s material is based on the material from the previous article, so if you need a refresher just head back to Part 7 and go over it again. Remember: repetition is the mother of all learning. Having said that, this is what…

15 Dec 2015

Ruslan Spivak 22 min read

As I promised you last time, today I will talk about one of the central data structures that we’ll use throughout the rest of the series, so buckle up and let’s go. Up until now, we had our interpreter and parser code mixed together and the interpreter would evaluate an expression as soon as the parser recognized a certain language…

2 Nov 2015

Ruslan Spivak 7 min read

Today is the day :) “Why?” you might ask. The reason is that today we’re wrapping up our discussion of arithmetic expressions (well, almost) by adding parenthesized expressions to our grammar and implementing an interpreter that will be able to evaluate parenthesized expressions with arbitrarily deep nesting, like the expression 7 + 3 * (10 / (12 / (3 +…

14 Oct 2015

Ruslan Spivak 12 min read

How do you tackle something as complex as understanding how to create an interpreter or compiler? In the beginning it all looks pretty much like a tangled mess of yarn that you need to untangle to get that perfect ball. The way to get there is to just untangle it one thread, one knot at a time. Sometimes, though, you…

11 Sept 2015

Ruslan Spivak 11 min read

Have you been passively learning the material in these articles or have you been actively practicing it? I hope you’ve been actively practicing it. I really do :) Remember what Confucius said? “I hear and I forget.” “I see and I remember.” “I do and I understand.” In the previous article you learned how to parse (recognize) and interpret arithmetic…

12 Aug 2015

Ruslan Spivak 10 min read

I woke up this morning and I thought to myself: “Why do we find it so difficult to learn a new skill?” I don’t think it’s just because of the hard work. I think that one of the reasons might be that we spend a lot of time and hard work acquiring knowledge by reading and watching and not enough…

3 Jul 2015

Ruslan Spivak 7 min read

In their amazing book “The 5 Elements of Effective Thinking” the authors Burger and Starbird share a story about how they observed Tony Plog, an internationally acclaimed trumpet virtuoso, conduct a master class for accomplished trumpet players. The students first played complex music phrases, which they played perfectly well. But then they were asked to play very basic, simple notes.…

15 Jun 2015

Ruslan Spivak 13 min read

“If you don’t know how compilers work, then you don’t know how computers work. If you’re not 100% sure whether you know how compilers work, then you don’t know how they work.” — Steve Yegge There you have it. Think about it. It doesn’t really matter whether you’re a newbie or a seasoned software developer: if you don’t know how…

20 May 2015

Ruslan Spivak 32 min read

“We learn most when we have to invent” —Piaget In Part 2 you created a minimalistic WSGI server that could handle basic HTTP GET requests. And I asked you a question, “How can you make your server handle more than one request at a time?” In this article you will find the answer. So, buckle up and shift into high…

6 Apr 2015

Ruslan Spivak 14 min read

Remember, in Part 1 I asked you a question: “How do you run a Django application, Flask application, and Pyramid application under your freshly minted Web server without making a single change to the server to accommodate all those different Web frameworks?” Read on to find out the answer. In the past, your choice of a Python Web framework would…

9 Mar 2015

Ruslan Spivak 6 min read

Out for a walk one day, a woman came across a construction site and saw three men working. She asked the first man, “What are you doing?” Annoyed by the question, the first man barked, “Can’t you see that I’m laying bricks?” Not satisfied with the answer, she asked the second man what he was doing. The second man answered,…