WalterBright (@walterbright) 's Twitter Profile
WalterBright

@walterbright

Engineer
Digital Mars, D Language Foundation
C, C++, D programming language compilers, and
Javascript compiler

ID: 18061210

linkhttp://www.walterbright.com calendar_today11-12-2008 21:38:23

1,1K Tweet

6,6K Followers

64 Following

WalterBright (@walterbright) 's Twitter Profile Photo

I finished modifying the Elf object file generator for the #AArch64. It's now time to dare building the druntime library for the Raspberry Pi.

WalterBright (@walterbright) 's Twitter Profile Photo

I went for a walk today with my airpods in my ears. When I returned home, one of them was gone. I spent an hour or so fruitlessly retracing my steps. I tried "Find My" but it would not recognize my other airpod (grrr) even though it was paired with it. So I did another search, no

WalterBright (@walterbright) 's Twitter Profile Photo

Engines shoud not do Output An engine is code that implements an algorithm. A little example is an engine that does a sum: ```d import core.stdc.stdio; int engine(int[] values) { int sum; foreach (v; values) sum += v; printf("the sum is %d\n", sum);

WalterBright (@walterbright) 's Twitter Profile Photo

Why I write lexers and parsers by hand instead of using lex/yacc: lex and yacc gets your prototype up and running quickly, but there's a cost: 1. having to learn lex and yacc 2. running into limitations with lex and yacc 3. having a foreign program (i.e. lex and yacc)

WalterBright (@walterbright) 's Twitter Profile Photo

Engines Should Not Read Files import std.stdio, std.file, std.conv; int lines(string filename) { int count; string s = to!string(std.file.read(filename)); foreach (char c; s) count += (c == '\n'); return count; } This engine accepts a

WalterBright (@walterbright) 's Twitter Profile Photo

Negation - Not No How, Not No Way! Human minds do poorly with negation. People tend not to hear it, so language uses multiple negations to emphasize it: Bela Oxmyx: "Nobody helps nobody but himself." It's all too easy to overlook a negation in computer code: if

WalterBright (@walterbright) 's Twitter Profile Photo

I thought I could get away with not dealing with register pairs on the #AArch64 code generator. Well, that burned to the ground. Reviewing the function call specification again, I had overlooked that structs 8..16 bytes long get passed as a register pair. Structs 16+ bytes get

WalterBright (@walterbright) 's Twitter Profile Photo

Just Shoot Me Now Trying to make a language look kinda sorta like another language leads to neverending confusion. Accept the language for what it is. #define BEGIN { #define END } Don't laugh. I've seen programmers use this.

WalterBright (@walterbright) 's Twitter Profile Photo

Universal Function Call Syntax Consider the expression: g(f(e(d(c(b(a))),3)))) It's a little hard to figure out what is happening. #dlang has universal function call syntax, where: f(a,b) is equivalent to: a.f(b) Thus, we can rewrite the expression as:

WalterBright (@walterbright) 's Twitter Profile Photo

Writing #X86_64 code is easy for me, as I've been writing it for decades. It just flows out of me. But the #AArch64 is different enough I have to constantly check the instruction spec, making it painfully slow. Fortunately, this problem will go away as I teach the compiler to do

WalterBright (@walterbright) 's Twitter Profile Photo

Tonight at 6pm I'll be at the NWCPP Computer Programming Language Panel discussion, representing #dlang. Microsoft Redmond Reactor | 3709 157th Ave NE, Redmond, WA 98052 Conf Room 20/1143 (12) Maple Reactor See nwcpp dot org for details.

WalterBright (@walterbright) 's Twitter Profile Photo

Looking at the spec pages for the #AArch64 instruction set makes my eyes bleed. So, instead of counting bits in hex numbers until I went blind, I wrote a disassembler for the #dlang dmd code generator. Today I was faced with: 0020: 79 00 5B A2 strh w2,[x29,#0x58] and

WalterBright (@walterbright) 's Twitter Profile Photo

The More Control Paths, the Less Understandable: version (X) doX(); doY(); if (Z) doZ(); becomes: doX(); doY(); doZ(); by moving the conditional logic into the functions.