From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.user Subject: Re: Trying guile as an extention language for a 'real world' product Date: Thu, 08 Jul 2010 11:45:22 +0100 Message-ID: References: <20100703053651.GA13073@yeeloong> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1278587511 6129 80.91.229.12 (8 Jul 2010 11:11:51 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 8 Jul 2010 11:11:51 +0000 (UTC) Cc: guile-user To: rixed@happyleptic.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Thu Jul 08 13:11:49 2010 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.69) (envelope-from ) id 1OWp1B-0004z9-4b for guile-user@m.gmane.org; Thu, 08 Jul 2010 13:11:49 +0200 Original-Received: from localhost ([127.0.0.1]:39809 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OWp1A-0006Nh-DJ for guile-user@m.gmane.org; Thu, 08 Jul 2010 07:11:48 -0400 Original-Received: from [140.186.70.92] (port=39285 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OWp0y-0006J4-A7 for guile-user@gnu.org; Thu, 08 Jul 2010 07:11:37 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OWp0w-0003BY-Tb for guile-user@gnu.org; Thu, 08 Jul 2010 07:11:36 -0400 Original-Received: from a-pb-sasl-quonix.pobox.com ([208.72.237.25]:47946 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OWp0w-00037W-P8 for guile-user@gnu.org; Thu, 08 Jul 2010 07:11:34 -0400 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id 0092BC1C49; Thu, 8 Jul 2010 07:11:10 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=mgpiw/a80M43gndKDvlud+DATbk=; b=WwkRGa 8HGEHUkSrg+DgN2LVoq/5du9amTG5pD6tHsIBvRkbhr1v6Ql1+fEZf31We8zUJm8 nnE+4QIEWUuuro9uTlZd3+U5h7XgOkjkhN5vrvFlTf8EmwGxb0HUz+6zLqfNtbFB 9B5ex2S59sKxzzPFV1PJGZd0vpljIK02O1vjk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=eU7H2PSS25z2lnhuJbMttwXiKqGxCt0p 8/66idpOs0gcnlPKLY/YaXsD6NEmyN7y1Umbu92TeWpjatQqefXIq+vFnTxGsyc8 xiMaRZKfzKnq3FzrjSOZLtmFYXJFnN3Cj/uIXfo/oG2iCglaPOEDdwm9XSenLKs/ 7+n2g9K23yY= Original-Received: from a-pb-sasl-quonix. (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id E2645C1C48; Thu, 8 Jul 2010 07:11:08 -0400 (EDT) Original-Received: from unquote.localdomain (unknown [81.253.44.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTPSA id 54B57C1C47; Thu, 8 Jul 2010 07:11:07 -0400 (EDT) In-Reply-To: <20100703053651.GA13073@yeeloong> (rixed@happyleptic.org's message of "Sat, 3 Jul 2010 07:36:51 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) X-Pobox-Relay-ID: 827C68A6-8A81-11DF-BD85-9056EE7EF46B-02397024!a-pb-sasl-quonix.pobox.com X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) 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:7973 Archived-At: Hi! On Sat 03 Jul 2010 06:36, rixed@happyleptic.org writes: > At work, I recently pushed the idea to use an extention language for our > main product, which is a middle sized program written in C with many > threads, that must run quickly without without interruption 24/7, and > that have little memory nor CPU to spare. > > As nobody comes with a better idea, and as I'm secretly in love with > scheme and aligned to the GNU world domination plans, this extention > language is going to be guile. > > The first usage for this extention language would be to replace the > various configuration system with a simpler and more powerfull interface > from scheme to C configuration datas. But I just came across Andy's > slides for ghm 2009, where he says that guile is "not so much for config > files (days of fvwmrc long gone)". > > What does he mean by that ? Are there any contraindication against using > guile as an extention language for configuration ? Cool! It's fine to use Guile to handle configuration. I guess what I meant though is that it almost seems a waste to make applications like that: Guile is so much more pleasant to hack in, it expands to fill the tolerance for Scheme in your organization :) Also, the times have changed a bit, and it doesn't seem that apps are made like fvwm (for example) any more (complicated conf language). It is a political act to use Guile as an extension language. It says that you would like for more of your program to be hackable in Scheme. In most organizations, it's subversive too, because you're sneaking in technology from the Scheme underground resistance movement :-) A caveat, though: Guile is not the smallest Scheme. If you think that adding 4 MB of memory use to your application would make it impossible for you to use Scheme, then there are other, smaller ones. I hear Chibi is good, for example. But Guile is a batteries-included Scheme with a pleasant development environment, one that scales up to large programs, and I at least find it to be pleasant :) I read some of your further mails on the web but haven't downloaded them yet, and it seems that you have a lot of state to export to your users. I suggest making a new module and defining those variables in that module. If you are coming from C, use scm_c_define_module, and within the init thunk, use scm_c_define () to define all of your variables. Evaluate your users' code within the returned module. Happy hacking, Andy -- http://wingolog.org/