Post AWRjChjQLrsEfXmS2a by abnv@fantastic.earth
(DIR) More posts by abnv@fantastic.earth
(DIR) Post #AWRjCeMGtUZUCrvQ2K by abnv@fantastic.earth
2023-06-07T06:15:12Z
1 likes, 0 repeats
I ported @mattmight’s CPS conversion code (https://matt.might.net/articles/cps-conversion/) to #Haskell and after some fighting with the type system, it worked! To make the interpreters work with the Cont monad, I had to remove recursive lets and hence, functions being able to call themselves recursively, but the rest works fine.The attached images show the conversion of the Fibonacci function into the CPS version.#Programming #ProgramingLanguages #Compilers #PLT
(DIR) Post #AWRjChjQLrsEfXmS2a by abnv@fantastic.earth
2023-06-07T10:39:13Z
0 likes, 0 repeats
`call/cc` conversion works as well! I must say, it is somewhat magical to me.#Programming #ProgramingLanguages #Compilers #PLT