Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!news.misty.com!news.iecc.com!.POSTED!nerds-end From: orchidaceae phalaenopsis Newsgroups: comp.compilers Subject: What do I need to know to write a scheme compiler? Date: Thu, 29 Jan 2015 17:24:39 +0000 Organization: Compilers Central Lines: 21 Sender: news@iecc.com Approved: comp.compilers@iecc.com Message-ID: <15-02-001@comp.compilers> NNTP-Posting-Host: news.iecc.com Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: miucha.iecc.com 1422799098 87876 2001:470:1f07:1126:0:676f:7373:6970 (1 Feb 2015 13:58:18 GMT) X-Complaints-To: abuse@iecc.com NNTP-Posting-Date: Sun, 1 Feb 2015 13:58:18 +0000 (UTC) Keywords: Scheme, question Posted-Date: 01 Feb 2015 08:58:18 EST X-submission-address: compilers@iecc.com X-moderator-address: compilers-request@iecc.com X-FAQ-and-archives: http://compilers.iecc.com Xref: csiph.com comp.compilers:1503 Hello comp.compilers, My goal is to write a self hosting compiler for scheme to x86 64 assembly. I will be happy to leave call/cc out of it since I think it complicates things. What I am focusing on is lambda and tail call elimination. I've tried to do it using the CPS transform but this produced code that was far too slow to self host. I think that it introduces too many lambdas all of which get heap allocated, I don't know how to do analysis on the code to find out how which closures can be stack allocated. Could anyone give me advice on what I need to learn about implementing closures in order to make a compiler that's efficient enough to self host rather than just compiling tiny test programs? Should I stick with CPS and try to do optimizations based on 0CFA (I have read about it and it seems powerful but it looks very very difficult). Thanks!