Questions tagged [program-transformation]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
3 votes
1 answer
205 views

How to assign unique names to variables within a function?

I want to promote all variables within the function to the top level of the function, make it more cache-friendly and reduce size bloat caused by alignment fill. In other words, it will roughly ...
Aster's user avatar
  • 2,688
10 votes
4 answers
2k views

How to ensure correct transformations with `break`, `continue` and other context-dependent statements?

I have a compiler backend which targets high-level languages, by building an abstract syntax tree for the output and then using this to generate code ─ that is, this tree is really an intermediate ...
kaya3's user avatar
  • 17.3k
5 votes
1 answer
221 views

What is defunctionalisation useful for?

Defunctionalisation refers to program transformations which replace first-class functions and closures with conventional data structures (e.g. structs and enums), so that higher-order functions become ...
kaya3's user avatar
  • 17.3k
10 votes
4 answers
363 views

How to transpile labelled break/continue statements to a high-level language which lacks them?

Suppose I am writing a source-to-source compiler (also called a transpiler) from one high-level imperative language to another, where the source language allows labelled statements to be targeted by <...
kaya3's user avatar
  • 17.3k