3 ms·
Alright. I didn't know. But I will say that Scheme is a particularly hard language to build an FFI for. In order to do The Right Thing, and have continuations
by qwertyuiop924 10y ago
Alright. I didn't know. But I will say that Scheme is a particularly hard language to build an FFI for. In order to do The Right Thing, and have continuations work across language boundries, you have to integrate continuations into a system that is gleefully unaware of their existance. Depending on the design decisions made, making the FFI do The Right Thing is either impossible, or painfully expensive. So many implementations don't. The only thing RnRS could do is define as implementation inspecific an API as possible, and define any use with continuations undefined behaviour. And that would only be moderately better than not having them at all.
- dleslie 10y agoWhy should continuations need to safely work across language boundaries? Plenty of Schemes support FFIs with the enormous warning that call/cc exists and you should be aware of that. This solution is hugely superior to having none at all; as it means that bindings to foreign libraries may trivially be ported across many Schemes. Choosing the right Scheme will be less about what libraries are available, and more about which provides the best execution environment for your needs. In this case, doing the right thing happens to be doing nothing more than warning the user, as is often the case. Attempting to design a system that safely captures foreign state with continuations is almost certainly an over-engineered solution.
- qwertyuiop924 10y agoActually, you're right. God, what was I thinking. The only potential problem is that implementations that DO implement callcc across ffi will wind up with code that won't run on implementations that DON'T. That would be bad, but not the end of the world. The real problem is that it's unlikely such a thing would be standardized.