I was down at Fry’s Electronics yesterday — huge electronics warehouse. Geek paradise. Everything from DVD boxed sets to multimeters. Why I was there is unimportant; let’s just sa…| Fabulous adventures in coding
6 posts published by ericlippert during December 2022| Fabulous adventures in coding
I wanted to implement concise “pattern matching” in Python, a language which unlike C#, F#, Scala, and so on, does not have any pattern matching built in. Logically a pattern is just a predicate: a function which takes a value … Continue reading →| Fabulous adventures in coding
Before getting into the details of how my combinator-inspired source code transformation system works, I should say first, what is a general overview of the system? and second, why did I build it at all? In my experience, a typical … Continue reading →| Fabulous adventures in coding
How do we write a compiler in a typical general-purpose line-of-business OO programming language such as Python, C#, Java, and so on? Compilers are programs, so we could make the question more general: how do we write programs? The basic … Continue reading →| Fabulous adventures in coding
The European starling is a lovely looking bird, though territorial, noisy and aggressive up close. Unfortunately, they are very invasive in North America. Most of the hundreds of millions of European starlings now living in the Americas can be found … Continue reading →| Fabulous adventures in coding
In the autumn of last year my friend Joan and I went on a little trip up to the Skagit valley north of Seattle to photograph birds of prey; I managed to get a blurry but recognizable shot of this … Continue reading →| Fabulous adventures in coding
Reader “Joel” had an insightful comment on the first part of this series which I thought deserved a short episode of its own. Recall that we proved the theorem “if a compositional forest contains a mockingbird then every bird in … Continue reading →| Fabulous adventures in coding
For the next part in my Bean Machine retrospective to make sense I’ll need to make a short digression. In looking back on the almost 20 years I’ve been blogging, it is surprising to me that I’ve only briefly alluded … Continue reading →| Fabulous adventures in coding
Happy New Year all! Last time I briefly described the basic strategy of the Beanstalk compiler: transform the source code of each queried or observed function (and transitively their callees) into an equivalent program which partially evaluates the model, accumulating a graph as it goes. … Continue reading →| Fabulous adventures in coding
Let’s take another look at the “hello world” example and think more carefully about what is actually going on: There’s a lot going on here. Let’s start by clearing up what the returned values of the random variables are. It … Continue reading →| Fabulous adventures in coding
I’ll get back to Bean Machine and Beanstalk in the next episode; today, a brief diversion to discuss a general principle of language design and congratulate some of my former colleagues. Back…| Fabulous adventures in coding
Eric Lippert's blog| Fabulous adventures in coding
UPDATE: We are taking the breaking change. In C# 5, the loop variable of a foreach will be logically inside the loop, and therefore closures will close over a fresh copy of the variable each time. …| Fabulous adventures in coding