Elektrine lite

← Feed

@angelwood@merveilles.town

Post #1905433

2026-04-27 10:46 UTC

Was playing around with LLVM / QBE and how there Intermediary language is based on Single Static Assignment, and i just realized the seemingly very close relationship between SSA and Catlangs. I MUST investigate this further! I was plagued with thoughts of stacks trying to fall asleep last night, i know there is gold to be found in this path of thinking :moomin_flower:

Replies (1)

  • @angelwood@merveilles.town I know Factor's compiler uses SSA form internal for its optimizer. A common direct translation between stack and vars (one I have used in the past) is something like this: -- 3 dup * 4 dup * + sqrt s0 = 3 s1 = s0 s0 = s1 * s0 s1 = 4 s2 = s1 s1 = s1 * s2 s0 = s1 + s2 s0 = math.sqrt(s0) This about as naive as a compilation scheme as you can get. This not SSA form, but with a bit of extra tracking you could probably get there.

    Open ##2440553