A Guide to Python's Magic Methods (2012)
A guide to all the Magic Methods in Python
Posts that commenters keep linking to, ranked by how many different people have cited them in Hacker News comments. 662 posts.
A guide to all the Magic Methods in Python
Following up on my recent Scala posts , some commented that because I haven't used Scala seriously, my opinion is of little value. I respo...
An overview of a paper that presents a reference implementation of a defer mechanism (co-authored with Robert C. Seacord) has been accepted for publication at SAC’21. The full version is avai…
Over the last 25 years, I’ve written a lot of event-driven code in C++. A typical example of event-driven code is registering a callback that gets invoked every time a socket has data to be read. Once you have read an entire message, possibly after many invocations, you parse the message and invoke another callback…
Why I might use Rust instead of Python, with walkthroughs for building a simple
Ruby apps can use a lot of memory. But why? Various people in the community attribute it to memory fragmentation, and provide two “hacky” solutions. Dissatisfied by the current explanations and provided solutions, I set out on a journey to discover the deeper truth and to find better solutions.
While on vacation, I’ve been working on an alternate type inference scheme for rustc. (Actually, I got it 99% working on the plane, and have been slowly poking at it ever since.) This scheme simplifies the code of the type inferencer dramatically and (I think) helps to meet our intutions (as I will explain). It is…
Go has good support for calling into assembly, and a lot of the fast cryptographic code in the stdlib is carefully optimized assembly, bringing speedups of over 20 times.
Aditya Bhargava's personal blog.
Some programming languages like Java or Scala offer more than one way to express a concept of “lack of value”. Traditionally, a special null value is used to...
This post describes a compile-time technique for catching use-after-move bugs in modern C++. It’s currently used to prevent some mistakes in the Serenity Operating System.
After that first Firebrand of an article on Application Binary Interface (ABI) Stability, I’m not sure anyone expected this to be the title of the next one, huh? It seems especially bad,
A pragmatic new design for high-level abstractions Monads (and, more generally, constructs known as “higher kinded types”) are a tool for high-level abstraction in programming languages1. Historically, there has been a lot of debate inside (and outside) the Rust community about whether monads would be a useful…
In the first post, I took a brief look at the programming languages ATS, C#, Go, Haskell, OCaml, Python and Rust to try to decide which would be the …
Look at a tiny syntax detail that shows up in current versions of rust that has profound implications on how the language deals with almost everything being an expression.
I recently gave a talk on the internals of multicore OCaml GC at Jane Street offices in NYC. The slides from the talk are available online . But I felt that the slides alone aren’t particularly edifying. This post is basically the slides from the talk annotated with notes.
I was recently reminded of why I think it’s a bad idea to teach beginners C++. It’s a bad idea because it is an objective mess—albeit a beautiful, twisted, tragic, wondrous mess. Despite the current state of the community, this post is not a polemic against modern C++. This post is partly a follow-up on Simon Brand’s…
There is a misconception that Lisp is a dynamically typed language and doesn’t offer compile-time type checking. Lisp being the…
A version of the paper below was published in Celebrating the 50th anniversary of Lisp , edited by Charlotte Herzeel, the conference record of Lisp50 @ OOPSLA’08 (Nashville, Tennessee, USA, 2008). That collection is available through the ACM Digital Library .
Robert O'Callahan. Christian. Kiwi. Software guy. All content human-authored unless otherwise noted.
Effective D Programming Language.
I find myself thinking about a particular design principle of Rust today. I’m not sure I’ve ever seen it named specifically before, but it gets referred to from…
Learning about Programming Language Theory can be a tough journey, particularly for programming practitioners who haven’t studied it formally. This resource is here to help. Please feel free to get in touch if you have ideas for improvement.