Skip to content

Instantly share code, notes, and snippets.

@wilzbach
wilzbach / main.d
Last active July 24, 2018 16:24
C++ Munich Meetup - D without a runtime
int foo(int a, int b)
{
return (a % 3235272) % b;
}
int bar(int a)
{
return foo(a, 88);
}
@wilzbach
wilzbach / symbols.md
Last active July 17, 2018 16:46
RCString - affected symbols in Phobos

RCString: List of symbols with potential shortcuts

std.algorithm.comparison

  • among
  • castSwitch
  • clamp
  • cmp
  • equal
@wilzbach
wilzbach / keybase.md
Last active April 2, 2018 21:30
Keybase verification:

Keybase proof

I hereby claim:

  • I am wilzbach on github.
  • I am wilzbach (https://keybase.io/wilzbach) on keybase.
  • I have a public key ASCb_lSaTUIpgCkSWKavzANuc6EEcWTW9FGoWkETTizbKQo

To claim this, I am signing this object:

@wilzbach
wilzbach / joiner.d
Last active February 19, 2018 04:24
Performance benchmark of std.algorithm.iteration.joiner
import std.range, std.traits;
import std.stdio;
private void doNotOptimizeAway(T)(auto ref T t)
{
import core.thread : getpid;
import std.stdio;
if(getpid() == 1) {
writeln(*cast(char*)&t);
}
@wilzbach
wilzbach / the-expressive-c17-coding-challenge-in-d.md
Created February 14, 2018 15:13
The Expressive C++17 Coding Challenge in D
title layout date categories
The Expressive C++17 Coding Challenge in D
post
2018-02-13 08:48:57 -0800
d
tech

You might have seen that I have been coding a lot in D lately and as a few weeks ago there was the Expressive C++17 Coding Challenge with its solution in C++ and Rust now being public, I thought this is an excellent opportunity to show why I like D so much.

@wilzbach
wilzbach / tuple.d
Last active February 12, 2018 20:59
A stripped down version of std.typecons.Tuple
alias Identity(alias A) = A;
template AliasSeq(TList...)
{
alias AliasSeq = TList;
}
template staticMap(alias F, T...)
{
static if (T.length == 0)
@wilzbach
wilzbach / lstlangd.tex
Created December 12, 2017 00:07
LaTeX D listing configuration
%% Listings definition for D programming language
%% Author : Jesse Phillips <Jesse.K.Phillips+D@gmail.com>
\lstdefinelanguage{D}{
% Keywords
morekeywords=[1]{
abstract, alias, align, assert, auto, body, break, cast, catch, class, const,
continue, debug, delegate, delete, deprecated, do, else, enum, export,
false, final, finally, for, foreach, foreach_reverse, function, goto, if,
immutable, import, in, inout, interface, invariant, is, lazy, macro, mixin,
@wilzbach
wilzbach / output.md
Last active February 11, 2019 13:28
Measure import time for each module in Phobos
module bare import time
std.regex 1.04s
std.net.curl 0.29s
std.zip 0.19s
std.path 0.15s
std.socket 0.15s
std.file 0.14s
std.mmfile 0.14s
std.datetime 0.14s
@wilzbach
wilzbach / Makefile
Created December 2, 2017 11:27
Makefile with D compiler bootstrapping
DMD=bin/dmd2/linux/bin64/dmd
DMD_VERSION=2.074.0
LDC=bin/ldc2-$(LDC_VERSION)-linux-$(PLATFORM)/bin/ldc2
LDC_VERSION=1.2.0
DFLAGS=-g
PLATFORM=x86_64
################################################################################
# Auto-bootstrap DMD & LDC for outdated Debian/Ubuntu
################################################################################
@wilzbach
wilzbach / mangling.ipynb
Last active July 15, 2017 21:43
Comparison of symbol length between pr/5866 and master
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.