Recognizing when two arithmetic expressions are essentially the same
From the highly eclectic blog of Mark Dominus
50 Bytes of Code That Took 4 GB to Compile (2013)
While doing evil things with macros and the inline assembler (trying to run a weird test whose purpose is not really relevant) I managed to write a program that caused Visual Studio’s C++ compiler …
Joining Google to better explain search
When I retired from search journalism in June, I had no idea what I would be doing next. I just knew I was ready for a break and something different from what I had been doing for so long. That something different has arrived: I’m joining Google as of Monday.
Pruning spaces from strings quickly on ARM processors
Suppose that I give you a relatively long string and you want to remove all spaces from it. In ASCII, we can define spaces as the space character (' '), and the line ending characters ('\r' and '\n'). I am mostly interested in algorithmic and performance issues, so we can simplify the problem by removing all ……
Gap Buffers Are Not Optimized for Multiple Cursors
Gap buffers are a common data structure for representing a text buffer in a text editor. Emacs famously uses gap buffers — long-standing proof that gap buffers are a perfectly sufficient way to represent a text buffer.
Why Security Backdoors are Bad (2016)
Recently, there has been a bit of controversy over the concept of the government or security agencies adding backdoors to services and…
What is “Open Recursion”?
Someone on StackOverflow stumbled onto the strange term “open recursion” and asked what it meant . Since most of the other answers to this online are pretty opaque, I started writing an answer. But then I accidentally wrote a blog post.
A DoS Attack Against the C# Compiler
Generics in C# are certainly very useful and I find it amazing that we almost didn’t get them:
Can you figure out how this single part boost converter works?
If you think this is easy, then I think you are missing something. This is hard. You need to know your hardware intimately to figure this one out.
Patching Is Hard
There are many news reports of a ransomware worm . Much of the National Health Service in the UK has been hit; so has FedEx . The patch for the flaw exploited by this malware has been out for a while, but many companies haven’t installed it. Naturally, this has prompted a lot of victim-blaming: they should have…
Bootstrapping a Type System (2010)
Magpie has reached a strange but neat little milestone on the road from “weird experiment” to “real language”: the type system is now bootstrapped. I’m not aware of any other languages where a statement like that is even meaningful (maybe Typed Scheme ?), much less true , so I’ll try to break that down.
Writing a NetBSD kernel module
Kernel modules are object files used to extend an operating system’s kernel functionality at run time .
Please Request Your Personal Data Held by Cambridge Analytica
By now, many people have probably heard about the company Cambridge Analytica . By its own admission, it played a major role in the succes...
Implementing strcmp, strlen, and strstr using SSE 4.2 instructions (2008)
Created 18 years ago by Peter Kankowski Last changed 17 years ago Contributors : Dap and Adam Messinger Filed under Low-level code optimization
Scandalous Weird Old Things About The C Preprocessor (2015)
Updated 2018-01-21: Added clarification related to assertion about lack of context free nature of the C preprocessor.
WhatsApp Security Vulnerability
Back in March, Rolf Weber wrote about a potential vulnerability in the WhatsApp protocol that would allow Facebook to defeat perfect forward secrecy by forcibly change users’ keys, allowing it—or more likely, the government—to eavesdrop on encrypted messages. It seems that this vulnerability is real: WhatsApp has the…