[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GCCJIT and proper tail calls



On 05/12/2016 09:59 PM, David Malcolm wrote:

> Do any Scheme implementations auto-generate C?

Several of them do. Chicken Scheme https://www.call-cc.org/ and Bigloo https://www-sop.inria.fr/indes/fp/Bigloo/ notably.

Also, Christian Queinnec wrote an excellent book: Lisp In Small Pieces
https://pages.lip6.fr/Christian.Queinnec/WWW/LiSP.html which explain in great details several (interpreted & compiled) implementations of Lisp, including a Scheme translator to C.

The common point is that none the Scheme to C compilers I know are expecting or building upon the ability of the C compiler to emit proper tail-recursive calls. So GCCJIT really needs support for that (and IMHO, GCC itself should have a pragma to check that and warn if a given call cannot be compiled as a tail-calll).

Regards.

--
Basile STARYNKEVITCH         http://starynkevitch.net/Basile/
email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359
8, rue de la Faiencerie, 92340 Bourg La Reine, France
*** opinions {are only mine, sont seulement les miennes} ***