Saturday, 6 September 2025

Compiler Intrinsics - Basics, Pros and Cons

In Microsoft C++, many functions come from libraries, whilst some are built in to the compiler. The latter functions are known as compiler intrinsics.

PROS

An intrinsic function is usually inserted inline, avoiding overhead of a function call. Hence, compiler intrinsics are efficient!

They can be even jiffier than inline functions, as the optimizer in the compiler has knowledge of them and can optimise usage!

POTENTIAL CONS

A potential downside of using intrinsic functions is reduced portability of the code - other compilers may not support these functions. Also, some intrinsics may be available for some target architectures and not others.

COMMON INTRINSICS

Microsoft make some intrinsics available on all target architectures. Here's an example!

_AddressOfReturnAddress

signature: void * _AddressOfReturnAddress();

<intrin.h>

This function provides the address of the memory location that holds the return address of the current function.

MASM Decoded

MASM is the Microsoft Macro Assembler. 

It was introduced by Microsoft in the early 1980s to support x86 programming on DOS and Windows Platforms, and competed with IBM and Borland assembly tools.  The "macro" in the naming refers to assembly macros - reusable code snippets to simplify complex or repetitive assembly tasks.   It is an assembler in the sense it converts assembly language into executable machine code.

Inline assembler used to be a "thing" in earlier versions of Visual Studio. This allowed you to embed assembly language in a higher level programming language source code. This is no longer supported for x64 or ARM64 targets.

Options to port inline assembler include: conversion to C++, create separate assembly language source files, or use compiler intrinsics (supported by the Microsoft C++ compiler).

Visual Studio 2022 August 2025 Updates

August 2025 brought new amendments to Visual Studio 2022. 

For the August 19th release (17.14.13), these included the latest MAUI install (9.0.82), a fix for a stack overflow crash when linking MASM-generated debug information, and a fix for the Live Visual Tree horizontal scrollbar (Live Visual Tree gives you a real-time view of running XAML code).

Versions follow the MAJOR.MINOR.BUILD convention, so August 19th release is the 13th build of the 14th minor release, of the 17th major release.

Friday, 5 September 2025

Python platform module API shows errors - Oh Yeah

The Python platform module shows Windows 10 on Windows 11 machines - this is similar to other APIs which have been made to identify Windows 11 as a more advanced build of Windows 10 to avoid breaking backward compatibility. If build number is greater than 22000, you got Windows 11. 

Sunday, 24 August 2025

Silverlight is Dead, Long Live Silverlight

Silverlight lives on in XAML. Visual Studio supports XAML but has lost the visual XAML editor. It's ok.

Figma Basics and First Impressions

Figma feels a lot "lighter" than Microsoft's historical desktop design tool Expression Blend. Being a SaaS it is also easy to get started without installing software - which is time consuming and taxing on laptops.

It operates on design files, has a central canvas, toolbox and two sidebars. The left sidebar is Navigation and the right sidebar is the Properties bar. Very neat and simple.

Figma for Non Design People

The Concept of Figma

Figma is a SaaS tool - popular with UI/UX designers - for creating prototypes and designs enabling real-time collaboration.  Its purpose is to "bridge the gap" between designers and developers.

Adobe XD (Adobe Experience Design), now being discontinued, and Sketch are alternatives - however Figma was designed from the ground up to be cloud-native. This adds convenience as well as practical usefulness e.g. collaborating around live synchronised files.

Microsoft Integration with Figma

Microsoft has built custom Figma plugins to integrate its Fluent Design System into Figma. This creates design consistency e.g. in icons, text strings etc. The Fluent Design System is the design language used across Windows, Office and other products.

Microsoft PowerApps

Microsoft enables app creation from Figma designs using Power Apps, part of the Power Platform series of low code tools.