From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tobias Gerdin Newsgroups: gmane.lisp.guile.user Subject: Re: project: translate guile-tutorial.texi to use guile-cairo Date: Tue, 20 Sep 2011 11:51:27 +0200 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: dough.gmane.org 1316512302 11932 80.91.229.12 (20 Sep 2011 09:51:42 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 20 Sep 2011 09:51:42 +0000 (UTC) Cc: guile-user@gnu.org To: Andy Wingo Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Tue Sep 20 11:51:37 2011 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1R5wzI-00060u-SX for guile-user@m.gmane.org; Tue, 20 Sep 2011 11:51:36 +0200 Original-Received: from localhost ([::1]:40673 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R5wzI-0007Mv-41 for guile-user@m.gmane.org; Tue, 20 Sep 2011 05:51:36 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:56995) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R5wzD-0007MD-ML for guile-user@gnu.org; Tue, 20 Sep 2011 05:51:33 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R5wzB-0000jp-UG for guile-user@gnu.org; Tue, 20 Sep 2011 05:51:31 -0400 Original-Received: from mail-ww0-f49.google.com ([74.125.82.49]:56028) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R5wzB-0000jg-Pr for guile-user@gnu.org; Tue, 20 Sep 2011 05:51:29 -0400 Original-Received: by wwp14 with SMTP id 14so344072wwp.30 for ; Tue, 20 Sep 2011 02:51:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:cc:content-type; bh=VmGphwjYFNbhgbtwCi9SbbuyNONwk9j2XXxZuRqQg/8=; b=gdcHZJ+/FP1XjS639A7kph7zCWn2ZXHzUl7QG4obEPog/hpgGR4wp+iZh0jboc8H6D Lslu4K8X6CFcaDVrttsBgI3aMeS3bHR8DjQNieCp+xrQftE8r6B9INaOV3/vIwb9bhfB DZaO1oiF+1Xw0RJxnEWxN8KuMMgORUpvMeDZ0= Original-Received: by 10.227.204.198 with SMTP id fn6mr644403wbb.96.1316512287946; Tue, 20 Sep 2011 02:51:27 -0700 (PDT) Original-Received: by 10.180.82.68 with HTTP; Tue, 20 Sep 2011 02:51:27 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 74.125.82.49 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:8814 Archived-At: On 28 Apr 2011, at 11:41, Andy Wingo wrote: > Guile has a tutorial written by Daniel Kraft, which uses Scheme to > extend a C drawing process. It uses Gnuplot for the drawing, which is > not GNU, and AFAIK not even free software. It would be better to use > some other drawing library; for example, Cairo > (http://cairographics.org/). The output would be to a png file instead > of to the screen. Then we can also show a final stage of switching to > use guile-cairo, and having no C program; and possibly even using a GTK+ > surface instead of a PNG surface, which would allow the same program to > show data to the screen instead of to a file. > > What do people think? Is anyone interested in taking up this task? Hello, I am interested in working on this. However, I do think that the current gnuplot approach does have some merit in that using relatively simple code you get an interactive session where you can type commands into the Guile REPL and instantly see the results in the gnuplot window. As Daniel notes in the tutorial, drawing to a GTK window would make things markedly more complicated since you then have two main loops (The Guile REPL's and GTK's) that would need to communicate. But perhaps there is some simple way of solving this, I am not very familiar with either Guile and GTK. That said, using Cairo would be nice since in addition to the license issues its API is actually a better fit than gnuplot for the tortoise example. And just generating PNGs would make it simple to automatically insert screenshots when generating the tutorial. One interesting idea would be to build a graphical Guile REPL on top of Cairo, capable of visualizing cairo objects instead of printing out their string representation. May be a tad too complicated for a tutorial though, perhaps? I also think it would be educational to include a section containing a version using the Guile 2.0 dynamic FFI (haven't looked into it but should be possible no?). Lastly, just thought I'd mention an issue that I ran into when building Guile-Cairo (commit 1918626 from Git, looks like it corresponds to 1.9.91). When I run autogen/configure it complains that I need to supply a prefix argument because "the default prefix, /usr/local, is not in the default guile load path." But on my system it is, I built Guile from stable-2.0 branch and installed into the default /usr/local, so I do not think I should be seeing this error (it works if I supply --prefix=/usr/local to Guile-Cairo configure). Regards, Tobias