Skip to content

Instantly share code, notes, and snippets.

Callback For Matching Type

Field Value
DIP: (number/id -- assigned by DIP Manager)
Author: Richard (Rikki) Andrew Cattermole firstname@lastname.co.nz
Implementation: (links to implementation PR if any)
Status: Draft

Abstract

Big picture on shared libraries when they go wrong, how?

This post is meant to be a highly enlightening and entertaining explanation (or should I say it shouldn't cure anyones insomnia) of just how many things can go wrong with shared libraries if they are not worked with right regardless of platform.

Now I know this is an utter wall of text, but if you want to work with shared libraries you probably should read all of this. It'll get you up to speed on the theory of using them by preventing a repeat of my experiences, no war stories for you!

If you have inside knowledge of how shared libraries work, please expand upon this in the comments, perhaps we can get an article out of it for the site.

Some of the advice in this article may go against your previous experiences working with shared libraries. The recommendations here exist because the alternatives have seen to be problematic for a large portion of support requests over a two year period. If you understand what you are doing, you of course can disr

Private to the Scope

Field Value
DIP: (number/id -- assigned by DIP Manager)
Author: Richard (Rikki) Andrew Cattermole firstname@lastname.co.nz
Implementation: (links to implementation PR if any)
Status: Draft

Abstract

Owner Escape Analysis

Abstract

Prior Work

Reference Counting

Source Archive Format

The file format of the Source Archive Format file is very similar to that of object file libraries and various other schemes. It does not adhere to those other schemes due to their variances from platform to platform, all the code needed to support things that are unneeded for Source Archive Format files, and special consideration for D's needs. The format is meant to be friendly for memory-mapped file access, and does not have alignment issues.

The file extension is sar.

Structure

The file is broken up into sequential blocks, the start of each block will be padded to alignment of 16 bytes to enable aligned SIMD access to that block's contents.

Type State Analysis

Analysing the type state that an expression is in, enables providing guarantees to the callee about the object to prevent errornous logic using static analysis.

To enable this we introduce a change to identifiers in the context of variable declarations to allow the use of medial character as part of it. This is a UAX31 compliant change in profile, although its usage is novel.

As part of this is a framework being developed to enable new memory analysis techniques to be described and applied to guarantee temporal safety within @safe code.

Changes

Identifier Changes

@rikkimax
rikkimax / attrib.d
Created February 23, 2024 14:47
Minified TODO dmd AST modules for what parser requires to compile
/**
* Defines declarations of various attributes.
*
* The term 'attribute' refers to things that can apply to a larger scope than a single declaration.
* Among them are:
* - Alignment (`align(8)`)
* - User defined attributes (`@UDA`)
* - Function Attributes (`@safe`)
* - Storage classes (`static`, `__gshared`)
* - Mixin declarations (`mixin("int x;")`)
@rikkimax
rikkimax / attrib.d
Created February 23, 2024 14:46
Minified TODO dmd AST modules for what parser requires to compile
/**
* Defines declarations of various attributes.
*
* The term 'attribute' refers to things that can apply to a larger scope than a single declaration.
* Among them are:
* - Alignment (`align(8)`)
* - User defined attributes (`@UDA`)
* - Function Attributes (`@safe`)
* - Storage classes (`static`, `__gshared`)
* - Mixin declarations (`mixin("int x;")`)

Variable Isolation

Memory graph isolation, is a form of a immutable references within a programs graph of memory to create subgraphs which do not reference others.

In this proposal a focus is upon the analysis on the graph in creating and maintaining isolate sub graphs. It takes advantage of DIP1000 for escape analysis of reference into and out of sub graph manipulation functions.

Literature Review

https://dl.acm.org/doi/10.1145/3167132.3167245

Depends upon: member of operator

SumTypes

Sum types are a union of types, as well as a union of names. Some names will be applied to a type, others may not be.

It acts as a tagged union, using a tag to determine which type or name is currently active.

The matching capabilities are not specified here.