unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Tobias Gerdin <tgerdin@gmail.com>
To: Andy Wingo <wingo@pobox.com>
Cc: guile-user@gnu.org
Subject: Re: project: translate guile-tutorial.texi to use guile-cairo
Date: Tue, 20 Sep 2011 11:51:27 +0200	[thread overview]
Message-ID: <CAJiKzQMmSpbkGeT-JuuVHOcrYQXKa0Hmp8T6-J7qz0g=vkf_3A@mail.gmail.com> (raw)

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



             reply	other threads:[~2011-09-20  9:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-20  9:51 Tobias Gerdin [this message]
2011-09-20 19:19 ` project: translate guile-tutorial.texi to use guile-cairo Tobias Gerdin
  -- strict thread matches above, loose matches on Subject: below --
2011-04-28  9:41 Andy Wingo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAJiKzQMmSpbkGeT-JuuVHOcrYQXKa0Hmp8T6-J7qz0g=vkf_3A@mail.gmail.com' \
    --to=tgerdin@gmail.com \
    --cc=guile-user@gnu.org \
    --cc=wingo@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).