From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Daniel Kraft Newsgroups: gmane.lisp.guile.devel Subject: Some more elisp aspects: Reader and documentation Date: Sat, 01 Aug 2009 16:39:30 +0200 Message-ID: <4A7453A2.2020808@domob.eu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1249137564 32015 80.91.229.12 (1 Aug 2009 14:39:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 1 Aug 2009 14:39:24 +0000 (UTC) Cc: guile-devel To: Andy Wingo Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sat Aug 01 16:39:17 2009 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MXFjw-0002ar-6V for guile-devel@m.gmane.org; Sat, 01 Aug 2009 16:39:16 +0200 Original-Received: from localhost ([127.0.0.1]:32958 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MXFjv-0007Lj-Hp for guile-devel@m.gmane.org; Sat, 01 Aug 2009 10:39:15 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MXFjq-0007Le-8h for guile-devel@gnu.org; Sat, 01 Aug 2009 10:39:10 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MXFjk-0007LS-KL for guile-devel@gnu.org; Sat, 01 Aug 2009 10:39:09 -0400 Original-Received: from [199.232.76.173] (port=35937 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MXFjk-0007LP-Hd for guile-devel@gnu.org; Sat, 01 Aug 2009 10:39:04 -0400 Original-Received: from taro.utanet.at ([213.90.36.45]:52785) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MXFjj-0003s3-UU for guile-devel@gnu.org; Sat, 01 Aug 2009 10:39:04 -0400 Original-Received: from paris.xoc.tele2net.at ([213.90.36.7]) by taro.utanet.at with esmtp (Exim 4.69) (envelope-from ) id 1MXFje-0002jO-J2; Sat, 01 Aug 2009 16:38:58 +0200 Original-Received: from d86-32-16-106.cust.tele2.at ([86.32.16.106] helo=[192.168.1.18]) by paris.xoc.tele2net.at with esmtpa (Exim 4.69) (envelope-from ) id 1MXFje-0006em-Ak; Sat, 01 Aug 2009 16:38:58 +0200 User-Agent: Thunderbird 2.0.0.0 (X11/20070425) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:9009 Archived-At: Hi Andy and all, as the main elisp compiler gets more and more complete (well, still a lot details missing as well as probably even most built-ins, but anyways), I think I'll also work on a real elisp reader (currently, Guile's Scheme reader is used) as well as some (internals) documentation about what I did, am doing and will do in the future. I hope this sounds like a good plan ;) BTW, if you want to review the compiler, we could agree on a "freeze" to compiler changes on the branch so you can do it freely, while I work entirely on the reader or documentation? Regarding the reader, I think we've got two basic options (this was already disussed briefly here at the start of my project, IIRC): 1) Use the existing reader code in C and try to adapt it so that it (maybe controlled by some kind of "options") cares correctly about the differences between elisp and Scheme. This might save some work as the basic reading of S-expressions, literals and the like can be shared, and the code will probably run fast; on the other hand, I'm not sure if we might risk messing things up and getting some passages complicated in order to have it handle alternatively both Scheme and elisp. To be honest, I've so far not looked at the reader C code thoroughly, so I can't judge what this will really lead us to. 2) Write a seperate elisp reader, possibly in Scheme (but could be C as well if that's important for performance). This helps us keep "both" readers clean and seperate, but all has to be done from ground up and the code is probably slower (when written in Scheme). But my opinion is that performance will not matter that much here anyways (because the compiler probably takes most of the time, not the parser), and implementing parsing of S-expressions and the like is not really hard, so we won't lose much by not sharing existing code here. So if you don't have another opinion because you know the existing code better than I do or see problems I don't, I'd go with this approach. For this and in order to get meaningful debug and error outputs, I guess I'll have to find and associate the source code positions myself with read objects, right? It seems that I can use port-line and port-column to get the position of something just read, and set-source-properties! to associate line/column to the expressions? Anything else I need to care about then? Documentation: Currently, I've got the module/language/elisp/README file with some notes, mainly about stuff implemented/missing as well as the extensions I implemented over original elisp. Additionally, I tried to explain most "internal workings" very briefly directly with comments in the source code; but I think it would be nice to have some very basic information (like, how dynamic binding or the "void" value of variables is implemented, or the different modules for function/value slots) also in the real docs. Where do you suggest I put them (chapter/section/subsection of what part of the documentation)? Yours and have a nice weekend! Daniel -- Done: Arc-Bar-Cav-Ran-Rog-Sam-Tou-Val-Wiz To go: Hea-Kni-Mon-Pri