June 23rd, 2024

Writing an IR from Scratch and survive to write a post

Eduardo Blázquez developed an Intermediate Representation (IR) for the Kunai Static Analyzer during his PhD, aiming to enhance Dalvik bytecode analysis. The project, shared on GitHub and published in SoftwareX, transitioned to Shuriken. Blázquez drew inspiration from Triton and LLVM, exploring various IR structures like ASTs and CFGs. MjolnIR, Kunai's IR, utilized a Medium Level IL design with control-flow graphs representing methods. Blázquez's approach involved studying compiler design resources.

Read original articleLink Icon
Writing an IR from Scratch and survive to write a post

Eduardo Blázquez's personal webpage discusses his experience creating an Intermediate Representation (IR) for the Kunai Static Analyzer, a dalvik analysis library developed during his PhD. The IR aimed to facilitate analysis of Dalvik bytecode by transforming it into a structured format. The project, Kunai, was shared on GitHub and published in the journal SoftwareX. Despite being discontinued in favor of a new version called Shuriken, Blázquez reflects on the challenges and decisions involved in designing the IR. He drew inspiration from tools like Triton and projects like LLVM, exploring different IR structures such as Abstract Syntax Trees, Directed Acyclic Graphs, Control-Flow Graphs, Static-Single Assignment, Linear IR, and Stack-Machine IR. The IR for Kunai, named MjolnIR, adopted a Medium Level IL design to represent methods as control-flow graphs with blocks containing various statements like condition-flow instructions, expressions, and memory operations. Blázquez's approach involved studying books and projects related to compiler design to inform his IR development process.

Related

We no longer use LangChain for building our AI agents

We no longer use LangChain for building our AI agents

Octomind switched from LangChain due to its inflexibility and excessive abstractions, opting for modular building blocks instead. This change simplified their codebase, increased productivity, and emphasized the importance of well-designed abstractions in AI development.

Why are module implementation and signatures separated in OCaml? (2018)

Why are module implementation and signatures separated in OCaml? (2018)

Separation of module implementation and signatures in OCaml enables scalable builds, creation of cmi files, and streamlined interface modifications. Emphasizing abstraction and implementation separation enhances modular programming and system reasoning.

How to Design an ISA

How to Design an ISA

The article explores designing Instruction Set Architectures (ISAs), focusing on RISC-V's rise. David Chisnall highlights ISA's role as a bridge between compilers and microarchitecture, emphasizing the challenges and importance of a well-designed ISA for optimal performance in various computing environments.

Gren 0.4: New Foundations

Gren 0.4: New Foundations

Gren 0.4 updates its functional language with enhanced core packages, a new compiler, revamped FileSystem API, improved functions, and a community shift to Discord. These updates aim to boost usability and community engagement.

Homegrown Rendering with Rust

Homegrown Rendering with Rust

Embark Studios develops a creative platform for user-generated content, emphasizing gameplay over graphics. They leverage Rust for 3D rendering, introducing the experimental "kajiya" renderer for learning purposes. The team aims to simplify rendering for user-generated content, utilizing Vulkan API and Rust's versatility for GPU programming. They seek to enhance Rust's ecosystem for GPU programming.

Link Icon 6 comments
By @rahimnathwani - 4 months
IR = Intermediate Representation

Context: compilers

https://en.wikipedia.org/wiki/Intermediate_representation

By @CobrastanJorji - 4 months
Ohhhhhh. I clicked on this because Scratch was capitalized, and I though "wow, an IR for MIT's Scratch." I'm a little disappointed now.
By @VoidWhisperer - 4 months
For some reason when reading the title, I thought infrared instead of intermediate representation.

It also still made a tiny bit of sense in that context since you can easily set stuff on fire with IR laser