Skip to content

Instantly share code, notes, and snippets.

View Rajveer100's full-sized avatar
🧠

Rajveer Singh Bharadwaj Rajveer100

🧠
View GitHub Profile
@Rajveer100
Rajveer100 / lexical_scopes_swift_syntax.md
Last active March 30, 2024 13:24
Potential Proposal - Lexical Scopes for swift-syntax

Lexical Scopes - A Scope Lookup Library for swift-syntax

Overview

Swift source code is organized into a set of scopes, each of which can introduce names that can be found in that scope and other scopes nested within it. This project involves implementing a notion of lexical scopes to answer questions by introducing a new library for the swift-syntax package. These APIs can form the basis of IDE features like “Edit All in Scope” and are an important step toward replacing the C++ implementation of scopes within the Swift compiler.

Current State of ASTScope and its Dependencies

At the current state, the Swift compiler has a class ASTScopeImpl which essentially represents a lexical scope:

@Rajveer100
Rajveer100 / reg_alloc_ssra.md
Last active March 28, 2024 07:35
Potential Proposal - A new and fast (er) register allocator for Cranelift backend

A new and fast (er) register allocator for Cranelift backend

Overview

Cranelift has an integration with the Rust Compiler through the rustc_codegen_cranelift project, where it is used as a backend for rustc, instead of the default LLVM backend. The primary goal of this project is to improve the compilation time by compiling much faster than LLVM. The compiled code would be less efficient which is the expected trade-off since the current register allocator, i.e, regalloc2, although producing good quality code isn't needed for typical debug builds.

Current Design of regalloc2

The in-depth design of the current allocation pipeline is well described, which includes the input form (which is SSA IR), instructions, operands and a series of algorithms to compute an allocation us

@Rajveer100
Rajveer100 / .md
Last active June 19, 2023 08:47
Analysing MongoDB's Full Time Diagnostic Capture (FTDC)

About FTDC

FTDC, originally short for full time diagnostic data capture, is MongoDB's internal diagnostic data collection facility. It encodes data in a space-efficient format, which allows MongoDB to record diagnostic information every second, and store weeks of data with only a few hundred megabytes (MBs) of storage. While it's a great inititative on Mongo's end to help us monitor such metrics, at the moment, there isn't any concrete tool provided by Mongo or any open-source repos that we can solely rely on to effectively decode the data.

But as usual, after some research and finding across the internet, there are certain blogs/tools/docs where many software developers and open source contributors have done some great findings to get the closest possible visualisation

@Rajveer100
Rajveer100 / Overlay_Expansion_Cxx_Interoperability.md
Last active March 22, 2023 12:42
Proposal - Expanding the Swift Overlay [GSoC 2023] [C++ and Swift Interoperability]

Overview

At the moment, Swift has some experimental ability to interoperate with C++ by importing a large subset of C++. While the transition towards building a fully functional and highly operable environment to allow C++ APIs to be used from Swift (and vice-versa) has a long way to go, this project's primary goal would be to expand the existing Swift Overlay by further adding more containers from C++, which are widely used in the developer's codebase, while also adding additional functionalities to the individual viable files on the Swift side rather than on C++ side (as reverse-interoperability is out of scope for this project).

C++ Standard Library Containers