My hobbyist continuations-based programming language is now self-hoisting. Wohoo! 🎉

Here, gorge your eyes on this cryptic list reversion routine deep in the compiler:

#languagedesign
#ContinuationPassingStyle
#FunctionalProgramming

This #compiler for the #RosettaCode Virtual Machine assembly language can now target any of #ATS, #C, #Mercury, or #Scheme --

https://sourceforge.net/p/chemoelectric/rosettacode-contributions/ci/default/tree/vmc.dats

The Scheme code runs very fast in #ChezScheme, so-so in all else I have tried. I wonder how they do it. Maybe a lot of C code (instead of Scheme) in the runtime is part of it?

The generated Mercury is not so fast, but such is life with Mercury. It’s fastish, considering.

#ATSlang #ContinuationPassingStyle #FunctionalProgramming

chemoelectric / rosettacode-contributions / [47b182] /vmc.dats

Watch "BOB 2021 Jeremy Gibbons - Keynote" on YouTube - https://youtu.be/vE1NB8z8ly8
#continuationpassingstyle
BOB 2021 Jeremy Gibbons - Keynote

YouTube

#Scheme compiled into C functions F
F never reach the return statement
F call a new #continuation Cn when complete.
Cn are F passed on as extra arguments to other Fs. They are calculated by compiler.

So far, this is the essence of #continuationpassingstyle

#Scheme compiled into C functions F
F never reach the return statement
F call a new #continuation Cn when complete.
Cn are F passed on as extra arguments to other Fs. They are calculated by compiler.

So far, this is the essence of #continuationpassingstyle