* project: translate guile-tutorial.texi to use guile-cairo
@ 2011-04-28 9:41 Andy Wingo
0 siblings, 0 replies; 3+ messages in thread
From: Andy Wingo @ 2011-04-28 9:41 UTC (permalink / raw)
To: guile-devel; +Cc: Daniel Kraft
Hi,
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?
Andy
--
http://wingolog.org/
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: project: translate guile-tutorial.texi to use guile-cairo
@ 2011-09-20 9:51 Tobias Gerdin
2011-09-20 19:19 ` Tobias Gerdin
0 siblings, 1 reply; 3+ messages in thread
From: Tobias Gerdin @ 2011-09-20 9:51 UTC (permalink / raw)
To: Andy Wingo; +Cc: guile-user
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: project: translate guile-tutorial.texi to use guile-cairo
2011-09-20 9:51 project: translate guile-tutorial.texi to use guile-cairo Tobias Gerdin
@ 2011-09-20 19:19 ` Tobias Gerdin
0 siblings, 0 replies; 3+ messages in thread
From: Tobias Gerdin @ 2011-09-20 19:19 UTC (permalink / raw)
To: Andy Wingo; +Cc: guile-user
2011/9/20 Tobias Gerdin <tgerdin@gmail.com>:
> 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).
This would be a possible fix that WFM, but too hackish? But is there
no standard robust method for doing this? Will not all Guile libraries
need to solve this problem?
-Tobias
diff --git a/configure.ac b/configure.ac
index df7a306..eb90bea 100644
--- a/configure.ac
+++ b/configure.ac
@@ -34,7 +34,7 @@ AC_PROG_CC
AC_STDC_HEADERS
AC_PROG_LIBTOOL
-if test "x$prefix" = xNONE; then
+if test "x$prefix" = xNONE -a `guile-config info prefix` != "/usr/local"; then
AC_MSG_ERROR([No explicit prefix given.
Guile-Cairo requires you to explicitly enter in a prefix when
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-09-20 19:19 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-20 9:51 project: translate guile-tutorial.texi to use guile-cairo Tobias Gerdin
2011-09-20 19:19 ` Tobias Gerdin
-- strict thread matches above, loose matches on Subject: below --
2011-04-28 9:41 Andy Wingo
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).