dd86k's blog

Machine code enthusiast

What’s In Progress #005

Author: dd
Published: June 20, 2023
Categories:

The only date you’re getting out of me now is the publication date.

WordPress’ 20th Anniversary

Happy birthday, WordPress!

Funny enough, there was an event near that celebrated the anniversary over in Montréal’s Parc La Fontaine last May 26th (official birthday being the 27th of May).

I didn’t attend, since I was busy retrieving my parents from the airport that day.

Anyway, I’ve been using WP for many years now, and I’ve always enjoyed the WYSIWYG (in a sense) experience, being a fan of office suites myself. Having the UI experience for me beats static site generators by a mile for its usability. (Unless I’m writing source code documentation…)

Though, it wasn’t always all that great. The Block Editor was in rough shape when 5.0 hit, but it’s a lot better now (using 6.2.2 at this moment). I have no idea when they fixed it, but I can finally navigate within table cells using my arrow keys. Yay.

I’ve been using the Block Editor for a few years now and moved from the Classic Editor since I personally, somewhat, like the idea of blocks within the editor. Block management, such as insertion, dragging, removal, makes the editing experience feel a little less static.

In hopes that WordPress goes in better directions for the next 10 years.

The mystery of the core.int128 module

I was working on xxhdd while I noticed the xxhash3 package importing core.int128, and I was like, wait a minute, that’s cool, but, like, when was that introduced?

I recall reading that the cent type was deprecated (in a blog post?) and moved to its own module. While checking the changelogs — Nothing.

Then, I checked the older druntime repo and the module was introduced January 15th, 2022. Huh, okay, I check which compilers can import and use the module: DMD 2.100, GDC 12.1, and LDC 1.29. (Godbolt, please update DMD!)

No such module on DMD 2.098 and 2.099 and the cent type is explicitly said to not being implemented.

On DMD 2.100, cent is declared obsolete and core.int128.Cent is suggested.

The odd thing is that there are no version variables that can be checked (e.g., D_INT128), and with no changelogs to go with it, there’s a possible cause that there is no need for such type (due to SIMD).

Easy fix for those who want to have a constant compile-time variable:

enum HaveInt128 = __VERSION__ >= 2100; // DMD-FE >=2.100.0

static if (HaveInt128) { /* ... */ }

Unfortunately, you cannot define a version within a static if scope and use it afterwards outside that scope, causing a defined-after-use error, since version statements are processed before static clauses.

I much prefer static if over version for conditional compilation anyway.

DUB Wishlist

Because I can’t just add version definitions from the command-line to add specific features without having to write dub build configurations… I wish for something like --d-version=IDENTIFIER.

Otherwise, some people on the D Forums have this sort of trouble with the version/static if thing.

Walter, understandably, didn’t want ifdef hell, but now we have version hell. Granted, he didn’t make dub.

Wait. Newsflash.

My friend (Jan) did a Pull Request for this, and it was merged in!

I own them many hugs now.

Visual Studio and Zero-Width Characters

Seriously. I lost two hours debugging because I had a Zero Width Space (U+200B) character being inserted in my URL requests. No idea how it got there.

While Visual Studio Code shows them by default, Visual Studio does not.

If you have Visual Studio 2022: To enable it, go under TOOLSOptions…Text EditorGeneral and tick “Show zero-width characters” and click OK. Please… Microsoft… Have this option enabled by default.

VS2019 or older? Oops, not a thing!

Better luck next time?

Projects

Finally, the main topic of these blog posts. Been busy here and there without much progress, often taking breaks, so at least, a few things did happen.

lateterm

If you have noticed by now… We’re now at version 0.2.1!

You know, the theme that this blog uses. Unless you forgot to clear your cache, or that I forget about this within the coming years (that’d surprise me).

I touched a few visual things here and there that I wanted to do for some time now. Nothing dramatic, but hopefully makes the reading a little less tedious when there are a lot of text and chapters. This also fixes the search backend.

The minor revision retouches the post header, comment titles, and fixes forcing all images being having the rounded style.

ddcpuid

No progress done, but a reminder that OMF object support in dmd is deprecated.

I’ve unfortunately made have made no progress to SYSLORE, but not having OMF support means operating systems running on legacy systems are deprecated. Such as DOS-based Windows from 95 to ME and older WindowsNT products from NT 3.51 to XP.

I’m not sure how long I’ll keep support for Pentium Pro and earlier processors, knowing that dmd’s (and likely gdc/ldc as well) baseline is the i686 processor. For example, Linux is still considering dropping support for the i486, and most efforts, even for the BSDs, are going to the amd64 ports.

Relating to X86-S, I may add the CPUID bits once that come into an implementation.

xxhdd

More cleaning and started the XXHash structure template.

alicedbg

Added Mach-O executable support into the object server. At least, only the header part. The information I have for Mach-O dates back to 2007, where only up to armv7 was mentioned as a sub CPU type, so I lack information to implement segments.

A screenshot of alicedbg duing a Mach-O executable showing magic (MACHO_MAGIC_64), cpu type (x86-64), and filetype (Executable).
Yay, at least?

Continuing implementing Capstone support. I’m worried about the debugging prospect of it since the debugger will have to fetch a fix amount and feed it to Capstone, since it doesn’t call functions to read memory from the debugger module (for the debuggee/tracee). I do wish there was some kind of API function that I can hook a “fetch” function to.

Wrap Up

By the end of August, I’m hoping to have more exciting things to show!

At least, in the hopes of getting vacation…

Take care now.