guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Updated Guile Tutorial


From: Daniel Kraft
Subject: Re: Updated Guile Tutorial
Date: Thu, 13 Aug 2009 09:43:10 +0200
User-agent: Thunderbird 2.0.0.0 (X11/20070425)

Hi Andy,

thanks for your comments and checking over my revised tutorial!

Andy Wingo wrote:
A few comments, IMO of course. Neil probably has a better perspective.

I agree with you in general on those, and will try what I can improve on them; so please wait with a commit in any case ;) Should I think that the current version is best of all my trials, I'll also let you know...

 1) It would be better to have a more neutral narrator -- not a
    first-person narrator. If you feel like you need to speak from the
    first person, use "we". OTOH your style is infectious :), so perhaps
    it would work as "Guile Tutorial, by Daniel Kraft" :)

That's something I usually also try to achieve in writings "like that" -- however, I liked the original's style and tried to get my own version in the same spirit. Here, I'm not sure if I can get rid of first person entirely; and I think I tried to use "we" wherever possible, but for stuff like "I wanted to use Gtk+ but resided finally to Gnuplot because..." I'm not sure how to do this; overall, it's really meant from the author's perspective and not something like "we're going to do that now".

I'll still try to work over the text when I find time and maybe I can reformulate it -- concrete suggestions are welcome, if you stumble upon certain passages, of course.

 2) Don't mention the history of the tutorial. Just have it be a current
    document.

I wanted to give credits to the original author, but you're right that I should probably move this to some concluding section. As you make me think about that, I also need to add a GNU FDL note somewhere.

 3) In general, use short sentences. Let your words breathe.

Ok, I'll see what can be done there; I just fear that this is a remainder of German being my native language, so I'm usually not content with short sentences...

 4) If you're forking to run gnuplot, why not do so from Scheme? Of
    course if you did that it would obviate the whole "extending C"
    story, but still, if given this particular problem, that's what I'd
    do.

I've never tried this actually myself, but I think it would not be too hard to implement all of this in Scheme alone; but as you mentioned, I just needed something to write in C ;)

But if you've got a suggestion as what I could reasonable still change (maybe some final remarks that this example would also be possible in Scheme) I'll consider it.

 5) Running a main loop (as gtk+ does) and a REPL is indeed an
    interesting problem. See event-repl.scm or graphical-repl.scm in
    guile-gnome for a couple of takes.

I imagine the "correct" solution would be to start the REPL in a seperate thread and do drawing by updating some shared data structure that is read and rendered from the Gtk+ loop's exposed-callbacks; or something alike.

This shouldn't be too hard if we wanted to implement a clean program anyways, but for means of the tutorial I think the current version is better.

 6) I wish we had a better Scheme->C story; our C->Scheme story is fine,
    but a better FFI would be nice.

I'm not sure about that... For all I did so far, the Scheme->C stuff I regard also as quite good. The only thing is that you need to write wrappers for each function; so maybe we could try to get a FFI where you can just define the interface of a C function and Guile does the SCM boxing/unboxing accordingly on calls. Are there already plans (or at least the concrete desire) to do stuff like this? I think at least for some very basic functionality it should not be too hard to do?

Cheers,
Daniel

--
Done:  Arc-Bar-Cav-Ran-Rog-Sam-Tou-Val-Wiz
To go: Hea-Kni-Mon-Pri




reply via email to

[Prev in Thread] Current Thread [Next in Thread]