React as a UI Runtime
In this post, I’m describing most of the React programming model from first principles. I don’t explain how to use it — just how it works.
It’s aimed at experienced programmers and folks working on other UI libraries who asked about some tradeoffs chosen in React. I hope you’ll find it useful!
Interesting read, even if I don’t use react.
Oneliner-izer: An Exercise in Constrained Coding
We’ll describe the ideas and implementation behind Oneliner-izer, a “”compiler“” which can convert most Python 2 programs into one line of code. As we discuss how to construct each language feature within this unorthodox constraint, we’ll explore the boundaries of what Python permits and encounter some gems of functional programming – lambda calculus, continuations, and the Y combinator.
Open Season on Hylomorphisms
This piece of code is probably unreadable to a regular C++ programmer, but makes perfect sense to a Haskell programmer.
Here’s the description of the problem: You are given a list of equal-length strings. Every string is different, but two of these strings differ only by one character. Find these two strings and return their matching part. For instance, if the two strings were “abcd” and “abxd”, you would return “abd”.
What makes this problem particularly interesting is its potential application to a much more practical task of matching strands of DNA while looking for mutations. I decided to explore the problem a little beyond the brute force approach. And, of course, I had a hunch that I might encounter my favorite wild beast–the hylomorphism.
C++ Standard Ranges
As you may have heard by now, Ranges got merged and will be part of C++20. This is huge news and represents probably the biggest shift the Standard Library has seen since it was first standardized way back in 1998.
Future blog posts will discuss how we got here and the gritty details of how the old stuff and the new stuff play together (we’re C++ programmers, we love gritty details), but this post is strictly about the what.
Running from the past
Functional programming encourages us to program without mutable state. Instead we compose functions that can be viewed as state transformers. It’s a change of perspective that can have a big impact on how we reason about our code. But it’s also a change of perspective that can be useful in mathematics and I’d like to give an example: a really beautiful technique that alows you to sample from the infinite limit of a probability distribution without needing an infinite number of operations.
Announcing F# 4.5
The first thing you may notice about F# 4.5 is that it’s higher than F# 4.1.
Are functional programs easier to verify than imperative programs?
The difficulty of imperative programming arises from the combination of state, aliasing and procedure calls. Any two of these features can be handled without that much difficulty, but the combination of all three effectively makes reasoning (nearly) as difficult as correct concurrent programming.
Writing complex macros in Rust: Reverse Polish Notation
So, here is my take on describing the principles behind writing such macros. It assumes you have read the Macros section from The Book and are familiar with basic macros definitions and token types. I’ll take a Reverse Polish Notation as an example for this tutorial. It’s interesting because it’s simple enough, you might be already familiar with it from school, and yet to implement it statically at compile time, you already need to use a recursive macros approach.
Curry Your Calls, Uncurry Your Returns
Stalking a Hylomorphism in the Wild
Trying to improve my Haskell coding skills, I decided to test myself at solving the 2017 Advent of Code problems. It’s been a lot of fun and a great learning experience. One problem in particular stood out for me because, for the first time, it let me apply, in anger, the ideas I learned from category theory. But I’m not going to talk about category theory this time, just about programming.
Although saying “just programming” may be a bit modest.
Simplicity: A New Language for Blockchains
Simplicity is a typed, combinator-based, functional language without loops and recursion, designed to be used for crypto-currencies and blockchain applications. It aims to improve upon existing crypto-currency languages, such as Bitcoin Script and Ethereum’s EVM, while avoiding some of the problems they face. Simplicity comes with formal denotational semantics deﬁned in Coq, a popular, general purpose software proof assistant. Simplicity also includes operational semantics that are deﬁned with an abstract machine that we call the Bit Machine.
ML for the Working Programmer
I have decided to make the full text of the book available in PDF.
1996, but I don’t think much has changed.
Monads, Monoids, and Categories
There is no good place to end a book on category theory. There’s always more to learn. Category theory is a vast subject.
Time to back and read everything for real...
Writing a Formally-Verified Porn Browser in Coq and Haskell
Hopefully this example shows that there’s nothing really stopping anyone from using Coq in their Haskell programs today.
Get Started with F# as a C# developer
It’s the same, but different.
Project Springfield: a Cloud Service Built Entirely in F#
Project Springfield is Microsoft’s unique fuzz testing service for finding security critical bugs in software.
Fairly long post about all the hows and whys.
F# Pain Points
Some well reasoned gripes.
Disadvantages of purely functional programming
Where the rubber meets the road. Or in some cases, doesn’t.
Monads: Programmer's Definition
Programmers have developed a whole mythology around monads.
What they do vs what they are.
Swift and the Legacy of Functional Programming
Functional techniques in the still not actually functional swift.