[Vm-dev] Compiling with Continuations and LLVM

Boris Shingarov boris at shingarov.com
Fri Jun 12 19:25:47 UTC 2020


Ben,

> Could Smalltalk VM be defined as a "Continuation Passing Style"
>
FWIW, back in the days when I worked at OTI our VM *was* a CPS VM.

> or is that still more the realm of more functional languages?
>
How is Smalltalk any less functional than, say, Lisp?  Ok sure from a 
syntax perspective we have syntactic sugar for what CLOS expresses in 
first-class language constructs.  Yes, sometimes this turns out to be 
rather annoying.  For example, I find it infuriating that I need to 
modify the parser to be able to have dynamic-scope variables (and then 
when I do, it crashes the tools because they try to autocomplete etc (if 
you are following "Pharo-ArchC", you may have seen what I mean).

> IR was Single Static Assignment that wasn't well suited for continuations
>
I think the world is much more beautiful than how those guys paint it.  
SSA and CPS are exactly the same thing (modulo isomorphism). The best 
explanation of this, that I know of, was in Simon Peyton Jones' talk 
"Compiling Without Continuations" at the ARM Summit in 2017.

-- Boris




More information about the Vm-dev mailing list