RSSAmplifier

Blog

Steve Schveighoffer's Blog

schveiguy.comRSS feed ↗10 posts

Latest posts

Using Interpolation Expression Sequences for Code Mixins

One nice usecase for Interpolation Expression Sequences is for using mixins. In fact it was one of the primary examples in the DIP. But one thing that always stunk about using IES for mixins is that mixin requires string data, and IES are not string data only. For instance, let’s say we want to define […]

Dlang PSA: Don’t use -release

Don’t use the -release command line switch for the D compiler. Why? Because it removes bounds checks from arrays in @system code. Why is this a problem? It is a problem because the #1 problem with all exploits in the world is buffer overflows — writing or reading data that you are not supposed to […]

New iopipe Abstraction – SegmentedPipe

For those who know my library iopipe, it has been pretty stagnant as of late. However, the other day, I needed to process a file line-by-line, along with N lines of context. Now, I do have an example in the iopipe library that shows how to do N lines of context, but it does this […]

Spelunking Attribute Inference in D

Inference of attributes is a huge part of D programming. D has admittedly quite a lot of at­trib­utes, and four categories of attributes are related to functions: This post isn’t really about those attributes, and if you want to learn more about them, I recommend reading the D language specification, and searching for information about […]

The Cost of Compile Time in D

When I was creating my presentation for dconf online 2022, I was looking at alternatives to building constraints. If you watched my talk, you can see the fruit of that experiment in my strawman library (which is very much a proof-of-concept, and not ready for real use). But it got me thinking — how much […]

How to Keep Using D1 Operator Overloads

D1 style operator overloads have been deprecated in D2 since version 2.088, released in 2019. Version 2.100, released last month, saw those operator overloads removed completely from the language. However, using D’s fabulous metaprogramming capability, it is possible to write a mixin template shim that will allow your D1 style operator overloads to keep working. […]

Comparing Exceptions and Errors in D

What are Exceptions and Errors in D? Why is there a difference? Why does D consider Errors throwable inside a nothrow function? Sometimes decisions seem arbitrary, but when you finally understand the reasoning, you can better appreciate why things are the way they are. Throwing a Throwable I’m not going to go into all the […]

Golf Blitz is the Most Incredible Game that I Will Never Play Again

OK, so it is possible that I may at some point play it again. But this will require some drastic changes that I don’t see happening. Let me start off by saying that I was a beta tester for this game, downloaded it the first day it was available, and have been hooked for the […]

How to Report a Bug to Microsoft

So you found a bug in one of Microsoft’s great works of software art. What do you do now? I realized that there isn’t a nice step-by-step guide online, so I will give you the low-down on how this process works. It’s not straightforward — Microsoft is a large company, and has probably thousands of […]

Have your Voldemort types, and keep your disk space too!

A recent issue I discovered (and no doubt has been encountered before) is that using Voldemort types in D can result in insane symbol bloat. However, at DConf 2016, a presentation by Vladimir Panteleev gave me an idea to help solve the problem. This allows one to create a Voldemort type, but cuts out most […]