Inline assembly in Linux
I&#x27;m trying to add call&#x2F;cc to node, or to lua.<p>Recap: call&#x2F;cc is the ability to save the current state of a running thread, then revert to that state at a later point in time.  In other words, at any point in your program, you can say &quot;Save the current stack.&quot;  It&#x27;s saved as a function.  Later, whenever you call that function, the current stack is thrown out, and replaced with the saved stack.<p>This is very useful for a number of reasons.  It&#x27;s also a very rare feature to have in your language.<p>Neither node nor lua has support for this.  The closest I&#x27;ve found is a Lua extension which adds coroutine.clone().  In principle, this is the solution.  In practice, it has a number of limitations, such as restrictions on when you&#x27;re allowed to call coroutine.clone().  (For example, if your stack looks like Lua -&gt; C -&gt; Lua, then it won&#x27;t work.)<p>I tried to channel my inner Mike Pall and solve this problem once and for all, but I&#x27;m not Mike Pall, and this is really hard.  I was hoping you might know of any possible solution which is (a) practical, (b) cross-platform, and (c) works in all cases.<p>Why post this here?  Because this post happens to attract exactly the kind of people that might know a way forward.  There <i>must</i> be a way.  Apologies for the off-topic comment.