blog| tenthousandmeters.com
SQLite claims to be one of the most popular pieces of software in the world, being integrated into every major operating system and browser. It...| tenthousandmeters.com
tag «Python behind the scenes» | tenthousandmeters.com
about| tenthousandmeters.com
Just before Christmas, I've stumbled upon Machine Learning Engineering Open Book by Stas Bekman. It's a book I've long been looking for – a collection of insights on operating a large GPU cluster and using it to train and run LLMs: AI accelerators, fast intra-node and inter-node networking, optimized cluster storage, large-scale LLM training and inference, with lots of first-hand experience on these topics. I want to share my key takes from the book as well as other excellent resources I've...| Ten thousand meters
Here it is: github.com/r4victor/tenthousandmeters. It started as a private repo but now I'm making it public so that everyone can make PRs and...| tenthousandmeters.com
Here it is: bestresourcestolearnx.com. Learning new stuff is an integral part of a software engineer's job and a daily routine for any curious person working in IT. We constantly discover and learn new programming languages, frameworks, libraries, tools, concepts, theories, and ideas. We do it to get better at our jobs. And we do it because learning is fun.| Ten thousand meters
If you ask me to name the most misunderstood aspect of Python, I will answer without a second thought: the Python import system. Just remember how many times you used relative imports and got something like ImportError: attempted relative import with no known parent package; or tried to figure out how to structure a project so that all the imports work correctly; or hacked sys.path when you couldn't find a better solution. Every Python programmer experienced something like this, and popular S...| Ten thousand meters
Python dictionaries are an extremely important part of Python. Of course they are important because programmers use them a lot, but that's not the only reason. Another reason is that the interpreter uses them internally to run Python code. CPython does a dictionary lookup every time you access an object attribute or a class variable, and accessing a global or built-in variable also involves a dictionary lookup if the result is not cached. What makes a dictionary appealing is that lookups and ...| Ten thousand meters
In the previous parts of this series we studied the core of the CPython interpreter and saw how the most fundamental aspects of Python are implemented. We made an overview of the CPython VM, took a look at the CPython compiler, stepped through the CPython source code, studied how the VM executes the bytecode and learned how variables work. In the two most recent posts we focused on the Python object system. We learned what Python objects and Python types are, how they are defined and what det...| Ten thousand meters
What happens when we get or set an attribute of a Python object? This question is not as simple as it may seem at first. It is true that any experienced Python programmer has a good intuitive understanding of how attributes work, and the documentation helps a lot to strengthen the understanding. Yet, when a really non-trivial question regarding attributes comes up, the intuition fails and the documentation can no longer help. To gain a deep understanding and be able to answer such questions, ...| Ten thousand meters
As we know from the previous parts of this series, the execution of a Python program consists of two major steps: 1. The CPython compiler translates Python code to bytecode. 2. The CPython VM executes the bytecode. We've been focusing on the second step for quite a while. In part 4 we've looked at the evaluation loop, a place where Python bytecode gets executed. And in part 5 we've studied how the VM executes the instructions that are used to implement variables. What we haven't covered yet i...| Ten thousand meters
Consider a simple assignment statement in Python: a=b The meaning of this statement may seem trivial. What we do here is take the value of the name b and assign it to the name a, but do we really? This is an ambiguous explanation that gives rise to a lot of questions: What does it mean for a name to be associated with a value? What is a value? What does CPython do to assign a value to a name? To get the value? Are all variables implemented in the same way? Today we'll answer these questions a...| Ten thousand meters
We started this series with an overview of the CPython VM. We learned that to run a Python program, CPython first compiles it to bytecode, and we studied how the compiler works in part two. Last time we stepped through the CPython source code starting with the main() function until we reached the evaluation loop, a place where Python bytecode gets executed. The main reason why we spent time studying these things was to prepare for the discussion that we start today. The goal of this discussio...| Ten thousand meters
In the first and the second parts of this series we explored the ideas behind the execution and the compilation of a Python program. We'll continue to focus on ideas in the next parts but this time we'll make an exception and look at the actual code that brings those ideas to life.| Ten thousand meters
In the first post of the series we've looked at the CPython VM. We've learned that it works by executing a series of instructions called bytecode. We've also seen that Python bytecode is not sufficient to fully describe what a piece of code does. That's why there exists a notion of a code object. To execute a code block such as a module or a function means to execute a corresponding code object. A code object contains the block's bytecode, the constants and the names of variables used within ...| Ten thousand meters
Have you ever wondered what python does when you run one of your programs? $ python script.py This article opens a series which seeks to answer...| tenthousandmeters.com
In 1991 Guido van Rossum released the first version of the Python programming language. About that time the world began to witness a major change...| tenthousandmeters.com
Mark functions as async. Call them with await. All of a sudden, your program becomes asynchronous – it can do useful things while it waits for...| tenthousandmeters.com
As you probably know, the GIL stands for the Global Interpreter Lock, and its job is to make the CPython interpreter thread-safe. The GIL allows...| tenthousandmeters.com