@andnull@social.nouveau.community
Post #2440553
2026-04-27 12:18 UTC
@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.
Replies (1)
-
@andnull@social.nouveau.community 2026-04-27 12:20
@angelwood@merveilles.town Also, Factor's creator, Slava Pestov, hangs around mastodon and the catlang discord. I'm sure he has far more insight into catlangs and SSA form.