Are there any Stackless Python like projects for other languages (Java, Lisp, Haskell, Go etc)

Well thats the question. Are there any projects for other languages which try to imitate what stackless python is doing for python?


Andrew Appel wrote long time ago a book Compiling with Continuations, implemented some old version (110?) of SML/NJ (without a stack, but with garbage collected "continuation frames"), and wrote a paper Garbage Collection Can Be Faster Than Stack Allocation (all this in the previous century).

Several papers mention compilation with continuations e.g. Flanagan, etc

Scheme has a continuation-related primitive call/cc.

Also, Queinnec's Lisp In Small Pieces, and even a chapter from J.Pitrat's book Artificial Beings (the conscience of a conscious machine)

And Go Routines, etc..

Recent GCC gives -fsplit-stack which is quite similar (and useful notably for implementation of the Go Language front-end to GCC), and usable (with care) in many languages compiled by GCC (including C & C++).

Chicken Scheme is playing strange tricks with the stack (notably for tail calls and call/cc).

So I don't think that Stackless Python was the first of thinking of this (and implementing these ideas).

See also the call stack wikipage.

PS. And of course Haskell, Erlang, Oz, ...

If you mean the stackless compilation with lightweight concurrency, Haskell has done that from the very beginning. IIRC the first compilation scheme for Haskell was called the G-machine. Later that was replaced by the STG-machine. This is actually necessary for efficient laziness, but easy concurrency and parallelism comes as an additional bonus.

Another notable language in this sector is Erlang and its bad joke imitation language Go, as well as continuation-based languages like Scheme. Unlike Haskell they don't use an STG compilation scheme.

Both Haskell and Erlang contain (in the standard implementation) microthreads/green threads with multi-core support, a preemptive scheduler, and some analogue of channels. The only rather unique feature of Stackless that I can think of is serialisation of threads, although you can sometimes fake it by providing a way of serializing function state.

Need Your Help

Symbolically access object created by getSymbols

r quantmod

In the following pseudo-code, I don't know how to identify ?unknown?. I realize that y has the name of the symbol pointed to by asset. The objects for the symbols are stored in the environment. I n...

Extract all fields from XML result using Google Geocoding API

xml geolocation geocoding

I am using the Google Geocoding API, specifically relying on the XML output format. The code below loops through the array $arrGeocodeSales and for each row it retrieves the $lat and $long, which ...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.