[HN Gopher] Fractran Interpreter
___________________________________________________________________
Fractran Interpreter
Author : ColinWright
Score : 21 points
Date : 2025-05-28 11:07 UTC (2 days ago)
(HTM) web link (tjwei.github.io)
(TXT) w3m dump (tjwei.github.io)
| siraben wrote:
| Fractran is a cool esolang that looks impossible to write any
| programs in at first until you systematically trace through some
| examples. A while ago I wrote an assembler in Haskell with an
| optimizer so you can write programs in assembly-style.
| l> pretty (sumTo 10) c += 0 n += 10 while n >=
| 0 { c += n n -= 1 } l> runAssembler
| (sumTo 10) -- Program length: 31 Right
| [847425747 % 2,13 % 3,19 % 13,11 % 3,11 % 29,31 % 11,41 % 31,23
| % 11,23 % 47,2279 % 23,59 % 301,59 % 41,67 % 413,329 % 67,61 %
| 59,73 % 61,83 % 73,71 % 61,71 % 97,445 % 71,707 % 89,103 %
| 5353,103 % 83,109 % 5459,5141 % 109,107 % 103,113 % 749,113
| % 19,131 % 113,29 % 131,127 % 113] l> runAsm (sumTo
| 10) [(Prime 97,55),(Prime 107,1)]
___________________________________________________________________
(page generated 2025-05-30 23:00 UTC)