Dynamically patch a Python function's source code at runtime
written by Eric J. Ma on 2025-08-23 | tags: python runtime llm security namespace compilation execution functions toolbot monkeypatching
Topics /
The most popular blog posts about software engineering on Hacker News. 1,260 posts.
written by Eric J. Ma on 2025-08-23 | tags: python runtime llm security namespace compilation execution functions toolbot monkeypatching
Making programs slower can be useful to find...
Although I try to make good use of the debugger, I am quite used to print-based debugging, especially for unit tests. I wanted to explore some tricks to improve print-based debugging, and also incorporate the debugger more.
Discovering a JDK Race Condition, and Debugging it in 30 Minutes with Fray I’ve been adding more integration tests for Fray recently. To ensure Fray can handle different scenarios, I wrote many creative test cases. Many of them passed as expected, while some failures led to epic fixes in Fray. Then something…
A few weeks back, I implemented GPT-2 using WebGL and shaders (Github Repo) which made the front page of Hacker News. Here is a short write-up over what I …
An explainer for people who don't know computer science and are mildly curious
You can make your shell history more useful by removing the typos and false starts.
Earlier this week, an npm supply chain attack. It’s turn for crates.io, the main public repository for Rust crates (packages). The phishing e-mail looks like this: And it leads to a GitHub login pa...
If you're underwhelmed with AI coding agents or simply want to get more out of them, give parallelization a try. After seeing the results firsthand over the past month, I'm ready to call myself an evangelist. The throughput improvements are incredible, and I don't feel like I'm losing control of the codebase.
Django 6.0 introduces a built-in background tasks framework in `django.tasks`. But don't expect to phase out Celery, Huey or other preferred solutions just yet.
We discuss how to make sure that your access to TLS (thread-local storage) is fast, and how the presence of constructors and shared libraries affects the access time.
Programming language async runtimes are very focused on handling asynchronous, possibly long running tasks, that might yield for a variety of reasons, that...
Title says it all, I seriously dislike jq 's convoluted, impossible-to-remember ad hoc DSL that instantly joined heaps of misery like CMake and gnuplot in my heart. It should really have been a library with a CLI wrapper around eval in a well-known scripting language like Python.
When I took a look at the history of Quake binaries, they all made sense to me. quake.exe was the original release, able to run on DOS and Windows 95. Then came vquake.exe to support the hardware accelerated chip Vérité 1000. Later, glquake.exe generalized hardware acceleration to any vendor providing OpenGL drivers…
We've all used a public transit router to find a quick route from A to B, such as Google Maps or CityMapper, but how do they actually work?
C23 has a new rule for struct, union, and enum compatibility finally appearing in compilers starting with GCC 15, released this past April, and Clang later this year. The same struct defined in different translation units (TU) has always been compatible — essential to how they work. Until this rule change, each such…
An in-depth exploration of what happens when Rust and C memory allocators collide, featuring crash analysis.
FAA data shows 30 near-misses at Reagan Airport – NPR, Jan 30, 2025 The amount of attention an incident gets is proportional to the severity of the incident: the greater the impact to the organizat…
This is the introduction to a series on Abstract Algebra. In particular, our focus will be on Galois Fields (also known as Finite Fields) and their applications in Computer Science. This is a project I've been excited about for many years now, but have been too busy to dedicate the adequate effort to meet my…
[5 min read] The question Sheon Han poses — “Is Ruby a serious programming language?” — says a lot about what someone thinks programming is supposed to fee...
Recently I was scrolling through brson’s Rust quote database and stumbled upon a link to the official Rust tutorial from the very beginning of 2013. It says Rust 0.6 in the corner, but it lists many things that were removed in 0.6, so it’s likely closer to 0.5. I heard tales of old Rust before, but not of how the…
“It’s not that hard to build a fully functioning, code-editing agent.” Thorsten Ball
Software design is a deliberate process, and requires deliberate effort.
The iximiuz Labs origin story: five years of technical blogging followed by six months of active development resulted in an online learning-by-doing platform for DevOps, SRE, and Platform Engineers.
In this post I will make the case for the concept of a “runtime resizable struct” in Zig. I will then design an API by exploiting Zig’s powerful comptime functionality.
How to self-host a personal archive of web content even if stuff get's taken down
Since releasing 486Tang , I’ve been working on recreating the 8086 with a design that stays as faithful as possible to the original chip. That exploration naturally led me deep into the original 8086 microcode — extracted and disassembled by Andrew Jenner in 2020.
Lockfiles are an absolutely unnecessary concept that complicates things without a good reason. Dependency managers can and are working without it just the same.