From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jon Wilson Newsgroups: gmane.lisp.guile.user Subject: Re: How could this be implemented? Date: Sun, 14 Jan 2007 21:34:35 -0600 Message-ID: <45AAF64B.6040707@fastmail.fm> References: <45AAB39F.6000408@fastmail.fm> <45AAC50F.5090304@bothner.com> <45AADADA.6080603@fastmail.fm> <45AAEBF8.6050504@bothner.com> 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: sea.gmane.org 1168893514 4190 80.91.229.12 (15 Jan 2007 20:38:34 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 15 Jan 2007 20:38:34 +0000 (UTC) Cc: Guile Users Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Mon Jan 15 21:38:32 2007 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1H6XS1-00085R-3q for guile-user@m.gmane.org; Mon, 15 Jan 2007 20:25:01 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H6IcO-0006tt-KH for guile-user@m.gmane.org; Sun, 14 Jan 2007 22:34:44 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1H6IcA-0006td-0u for guile-user@gnu.org; Sun, 14 Jan 2007 22:34:30 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1H6Ic8-0006tQ-LI for guile-user@gnu.org; Sun, 14 Jan 2007 22:34:28 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H6Ic8-0006tN-E5 for guile-user@gnu.org; Sun, 14 Jan 2007 22:34:28 -0500 Original-Received: from [131.225.111.12] (helo=mailgw2.fnal.gov) by monty-python.gnu.org with esmtp (Exim 4.52) id 1H6Ic7-0001UT-Px for guile-user@gnu.org; Sun, 14 Jan 2007 22:34:28 -0500 Original-Received: from mailav1.fnal.gov (mailav1.fnal.gov [131.225.111.18]) by mailgw2.fnal.gov (iPlanet Messaging Server 5.2 HotFix 2.06 (built Mar 28 2005)) with SMTP id <0JBW00L594LFDS@mailgw2.fnal.gov> for guile-user@gnu.org; Sun, 14 Jan 2007 21:34:27 -0600 (CST) Original-Received: from mailgw2.fnal.gov ([131.225.111.12]) by mailav1.fnal.gov (SAVSMTP 3.1.7.47) with SMTP id M2007011421342732038 for ; Sun, 14 Jan 2007 21:34:27 -0600 Original-Received: from conversion-daemon.mailgw2.fnal.gov by mailgw2.fnal.gov (iPlanet Messaging Server 5.2 HotFix 2.06 (built Mar 28 2005)) id <0JBW0010143PG1@mailgw2.fnal.gov> (original mail from j85wilson@fastmail.fm) for guile-user@gnu.org; Sun, 14 Jan 2007 21:34:27 -0600 (CST) Original-Received: from [192.168.0.2] (cpe-24-162-120-52.hot.res.rr.com [24.162.120.52]) by mailgw2.fnal.gov (iPlanet Messaging Server 5.2 HotFix 2.06 (built Mar 28 2005)) with ESMTPA id <0JBW00DYL4LDMM@mailgw2.fnal.gov>; Sun, 14 Jan 2007 21:34:27 -0600 (CST) In-reply-to: <45AAEBF8.6050504@bothner.com> Original-To: Per Bothner User-Agent: Thunderbird 1.5.0.9 (X11/20070103) X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:5779 Archived-At: Hi Per, Per Bothner wrote: > You really don't want to do non-trivial programming in bash ... > > Also, remember it's a different niche. If you try to combine bash > and scheme, you might get something that sort-of-works but has > terrible performance, debugability, etc. But this is precisely what I'm aiming at. Something that is like bash, but with scheme syntax and other language features. It would be very useful to combine the power and elegance of scheme with bash's easy access to programs that others have written. However, of course you wouldn't want to do non-trivial programming with it. I'm not proposing to do so. But not wanting to do non-trivial programming in bash hasn't kept it from being one of the most useful and most used languages on a GNU box. I doubt that the performance will be that bad (for scripting). The debugability might be more of an issue, but no more so really than with bash itself. > >> So, what "that we can see" means is anything which eval is already >> and normally able to resolve to some value. > > The problem is you're killing lexical scoping. You can no > longer tell statically if an identifier reference resolves to > a lexical binding. This means the compiler has to be extra > conservative. It makes harder for people to reason about the > program. And it makes it harder for a compiler to issue useful > error messages. > > These are features not to be easily given up. I'm certainly not proposing to add this to guile scheme as an integral part of the language. It would be a module, an add-on, to be used when you want to use it, and devoutly to be ignored otherwise. Besides, IIRC, guile is not a compiling scheme in any case! Anyway, I'm not sure how what I am proposing would be noticeably different from adding bindings for the symbols ls, cd, etc, etc, etc at the toplevel. You first look in the innermost lexical environment. Do we have a binding for this symbol here? No? Then look one lexical environment up. No binding there? Eventually get to the top level. Is there a binding for this symbol here? No? Well then, look at the filesystem and see if there is an executable in path with this name. It would not be any different from having another lexical environment which is one level higher than what we call toplevel, really, except that the actual symbol lookup mechanism for this lexical environment is slightly more messy. But really, I suppose the same effect could be achieved by running, in .guile I suppose, a bit of code which bound, to the result of string->symbol on every executable in the path, a function (perhaps macro) which executed that program with the semantics for the arguments that I described earlier. Of course, that would take an enormous amount of time, and you run the risk of stepping on the toes of other things that are defined already when guile starts up. However, if this were what was done, then I don't see how it would possible screw up scoping in the slightest. At any rate, it would certainly not screw up scoping any more than any other top level define of a procedure (or perhaps macro). Regards, Jon _______________________________________________ Guile-user mailing list Guile-user@gnu.org http://lists.gnu.org/mailman/listinfo/guile-user