From: Julian Graham <joolean@gmail.com>
Cc: Guile User Mailing List <guile-user@gnu.org>
Subject: Re: Newbie - desigining apps
Date: Thu, 7 Oct 2004 22:49:04 -0400 [thread overview]
Message-ID: <2bc5f82104100719495e954519@mail.gmail.com> (raw)
In-Reply-To: <4165E98D.3090304@triad.rr.com>
Hi Max,
It might help the people on this list to have a little bit more
information about the type of application you're trying to write. For
the sake of my response, I'm going to assume it's an application where
some degree of extensibility makes sense -- it goes without saying
(although I guess I'm saying it) that just because Guile is the
recommended extensibility language for Free Software projects doesn't
mean you need to support it in your Free Software project.
To your specific questions:
> Have others found that supporting Guile in an application means
> rethinking how it runs at it's very core? For example, instead of
> writing use cases and designing from that, now I have a use case like
> "let the user call any higher-level function".
There are some basic requirements for using Guile in your code that
are going to affect the "core" -- the most obvious example is that
you'll probably need to wrap most of the functionality of your current
main() in the function called by scm_boot_guile(). Second, if you
really do want to make it possible to let users call "core" functions
from Guile Scheme code, you'll need to make these functions (or
wrappers around them) able to handle Guile's SCM type. (Making your
software Guile-controllable may require enough work that you may find
it not much more difficult to provide an abstraction layer that would
let your "higher-level functions" be accessed by a variety of
different user interfaces, not just Guile.)
In terms of use-cases, the Guile manual describes a few different
ways that people tend to want to use Guile. A couple of the most
common are: Using Guile to provide a built-in Scheme interpreter for
your application -- .e.g., you're writing a spreadsheet and need a
language for people to write formulas in and a way to evaluate
expressions in those formulas; vs. what you seem to talking about,
which is providing a set of C functions that do something and using
Guile as a way to access them and use them in conjunction with
pre-existing features of Scheme and libraries of Scheme code.
> Even worse, what about object orientation? Is it possible to let the
> user create, then assemble together, use, then destroy various program
> objects, all from Guile? And how is even that done, returning C++
> objects back to Guile -- I assume you would have to return a handle
> representing the internal program object, then add some management layer
> that maps these handles to internal objects.
Yes, it is possible to let users construct relatively complex types
from Guile and pass them to and from C++ code. You do this by
explicitly exposing (via a Guile API call) the type to Guile and
providing some basic information to Guile on how to display it /
garbage-collect it / etc. You'll want to consult the Guile manual for
the specifics on how to do this.
> Can someone can start me off on the right foot?
Give the manual -- especially the descriptions of Scheme
programming, if you're not a functional-programming kind of person --
a thorough going-over, even though certain parts of it are out of date
or incomplete. I should mention that I'm not exactly a Guile expert.
Other people on this list may have better ideas.
Cheers,
Julian
_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user
next prev parent reply other threads:[~2004-10-08 2:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-10-08 1:12 Newbie - desigining apps Max Polk
2004-10-08 2:49 ` Julian Graham [this message]
2004-10-08 18:43 ` Anthony Kozar
2004-10-09 21:47 ` Neil Jerram
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=2bc5f82104100719495e954519@mail.gmail.com \
--to=joolean@gmail.com \
--cc=guile-user@gnu.org \
/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).