alcinnz
alcinnz boosted

List of #Supercompilation Resources and Papers:

https://github.com/etiams/supercompilation-resources

"Supercompilation is a principiled program transformation technique that symbolically evaluates a given input program into its more efficient version, eliminating as much of computational overhead as possible[...]."

#Compiler#PLT#FunctionalProgramming#Performance

For my next #compiler project, I want to write the optimization passes myself, but I don't want to deal with generating machine code for multiple platforms. So tell me #programminglanguages #plt #pldev #compilers fedi, what is an IR that I can target that has a non-optimizing compiler to machine code and supports multiple platforms? This rules out most popular IR like LLVM, C, QBE, Cranelift etc.

In short, I want something that does only instruction selection, register allocation and codegen for multiple platforms. I don't need optimization, so I expect this thing to be really small and lightweight, unlike LLVM, GCC etc.

TPDE Compiler Back-End Framework

https://arxiv.org/abs/2505.22610

"TPDE-LLVM: a standalone back-end for LLVM-IR, which compiles 10--20x faster than LLVM -O0 with similar code quality, usable as library (e.g., for JIT), as tool (tpde-llc), and integrated in Clang/Flang (with a patch)."

Holy cow! 馃く

Open Source on GitHub:
https://github.com/tpde2/tpde

#Performance#Compiler#LLVM

As a first post on this account, I've decided to make an explanation on a compiler I'm writing. Please refer to my main account, @Giona_2, if you would like more information on it.

This post is meant to explain each module of my compiler (Optimizer, Tokenizer, Assembler). Each module will have a dedicated paragraph who were their originally their own posts, but I think it's a great way to kick off this first post

# Optimizer
The Optimizer is the most simplistic part of my compiler. It's job is to arrange the raw text file into a more readable format for the Tokenizer.

Essentially, it arranges the source code you wrote into an array where each word (keyword, number, symbol, etc) is it's own element. This allows the Tokenizer to iterate through each word more reliably than if it just read the raw text file verbatim.

# Tokenizer
The Tokenizer is arguably the most important module.

The Tokenizer takes the list generated from the Optimizer and iterates through each word. When it finds a keyword in the list, it goes through the following steps:
1. Finds the end of the declaration the keyword is indicating
2. Sends this full declaration to a function that'll parse it into a token

The final result is arranged as an array of tokens that emulates the steps the final executable must go through.

# Assembler
Finally, the Assembler is what's responsible for turning the token array generated by the Tokenizer and turning it into the final program.

All this does is iterate over each token in the array and translate it into its assembly-instruction equivalent.

This module, by far, is my favorite for one reason and one reason only: It's extremely volatile in the sense that it can turn the token array into pretty much anything you want Unimal to compile to.

#programming #coding #compiler