What are the common garbage collection algorithms, and what are their advantages and disadvantages? What does Python's garbage collection mechanism consist of, and how does it solve the memory leak problem? What is Golang's garbage collection mechanism like, and how does it solve the memory leak problem?
TL;DR
Meta's Twitter rival Threads turns out to be built with Python, its performance-focused CPython fork Cinder comes to light, and Mark Shannon's PhD thesis on high-performance VMs is a must-read.
Articles & Tutorials
× 13Competitive programming involves solving a series of problems within a time limit. This article introduces a method for debugging during competitive programming. In addition to improving performance, the method also provides insights for real-world software development.
Python 3.12 is set to be released in October of this year, and one of the biggest changes is support for the Linux perf profiler. This article covers what the Linux perf profiler is, what benefits perf can bring to Python, how to use perf in Python 3.12, how to analyze performance data, visualizing performance data, and more.
Łukasz Langa, the PSF's first full-time developer (sponsored by Meta), has announced that they are hiring a "deputy" engineer (sponsored by Bloomberg)! This comes just two weeks after the PSF announced its first full-time security developer (sponsored by OpenSSF). We are so grateful to our generous sponsors!
PEP-563 is about lazy evaluation of annotations, PEP-649 is about lazy evaluation of annotations using descriptors. This 2021 article by Łukasz Langa, the author of PEP-563, introduces and compares these two PEPs. They are both in Accepted state, however PEP-563 which was planned for 3.10 was indefinitely postponed, so it seems it needs more attention? (submitted by @Plutonium)
Design patterns are often used when building complex software. This article introduces the observer design pattern, its use cases, and provides Python code examples. It also draws some comparisons with event-driven architecture (EDA).
This article introduces three ways to import modules in Python and the usage of __all__. It focuses on introducing an alternative approach to __all__, which is to directly import the desired names in the __init__.py file.
How to implement a programming language in Python? This is a series of tutorials, the first one implements a very basic programming language that can execute print statements, and the second one extends it to support variables and mathematical expressions. It covers topics like lexical analysis, parsing, code generation and execution.
Counter is one of the most useful data structures in Python. This article introduces some very useful operations: getting the N most common elements, adding elements to the Counter, removing elements, removing negative counts, performing arithmetic operations on Counters, and passing Counter to generator expressions.
Numba is a popular tool for improving the performance of Python code. This article introduces its important feature Vectorize, including its internal principles and how it takes advantage of the power of Single Instruction Multiple Data (SIMD) operations. It demonstrates its usage with code examples in 5 scenarios.
Paul Graham, the author of Hackers & Painters, recently published an article titled "How to Do Great Work?". The key point in one sentence: doing great work requires curiosity, hard work, and finding the right kind of work for you. The article is long, with several key questions: What is the key to doing great work? How do you find the right kind of work for you? How do you stay curious? What are the standards for great work? Why bother doing great work?
Translated from Paul Graham's 2021 article "How to Work Hard?", this article can be read in conjunction with the previous one.
This is a monthly aggregation of Django-related tips, resources, articles, and more.
🎁 Python Trending Weekly 🎁 organizes its content into seasons, with every 30 issues forming a season. The highlights from the first season have been compiled for your convenience. You can access them online here (Chinese).
Projects & Resources
× 12This week's big news: Meta launched Threads, its Twitter competitor, which has already surpassed 30 million sign-ups in just two days. Its backend is powered by Cinder, a high-performance fork of Python 3.10 that includes a number of performance optimizations, including a bytecode inlining cache, pre-evaluation of coroutines, just-in-time (JIT) compilation of each method once, and an experimental bytecode compiler. (star 2.6K)
A fast, lightweight, and simple vector database written in less than 200 lines of code.
It's not hard to use GPT to translate a small amount of code from one programming language to another. However, migrating an entire codebase's language/framework sounds like a daunting task! This project aims to do that with GPT-4, and it currently works well with "simple" languages like Python and Javascript. (5.4k stars)
This is a dependency injection framework refactored from FastAPI after removing all HTTP logic.
This is an LLM-based system that connects to the Chinese financial market and currently has access to Chinese stocks, funds, economic and financial data, and real-time news.
Read the Docs is an open-source platform for building and publishing documentation (you must have seen docs generated by its Sphinx or MkDocs), and this repo collects documentation of open source projects so you can learn how they built their cool docs.
This is a general-purpose human dance generation toolkit that can generate human dance images and videos from reference images and poses.
Mark Shannon is known to many for the "Shannon Plan". Here we share his PhD thesis (downloadable PDF) from the University of Glasgow in 2011, describing an approach to building virtual machines for dynamic languages and explaining how to design a virtual machine toolkit around an abstract machine.
Blind Watermark is a digital watermarking technique that can embed watermarks into data without the need for the original image or text. This project is a frequency-domain-based digital blind watermark that can effectively extract watermarks under various attacks. (3.6k stars)
This is an open-source series of multimodal large models that support Chinese-English bilingual multimodal dialogue capabilities (VisCPM-Chat model) and text-to-image generation capabilities (VisCPM-Paint model). It is trained based on the hundred-billion-parameter language large model CPM-Bee (10B) (introduced in Weekly Issue 7), and integrates a visual encoder (Q-Former) and a visual decoder (Diffusion-UNet) to support the input and output of visual signals.
polars is a Python library written in Rust for data analysis. This repository contains a 9-chapter tutorial on how to use it.
How do companies like Netflix, Airbnb, and Doordash apply machine learning to improve their products and processes? This website compiles 200 case studies from 64 companies, providing insights into real-world use cases of machine learning and how to design machine learning systems.
Discussion & Questions
× 2A question on Hacker News asking for recommendations for good books about the history of technology.
Also a question on HN, what CS books do you recommend on topics like programming languages, symbolic logic, algorithms, operating systems, etc.?