unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Neil Jerram <neil@ossau.uklinux.net>
Cc: guile-user <guile-user@gnu.org>
Subject: Re: language translator help
Date: 28 Apr 2002 19:21:51 +0100	[thread overview]
Message-ID: <m3662b3cqo.fsf@laruns.ossau.uklinux.net> (raw)
In-Reply-To: 15563.18078.788420.299836@segfault.bogus.domain

>>>>> "John" == John W Eaton <jwe@bevo.che.wisc.edu> writes:

    John> On 27-Apr-2002, Neil Jerram <neil@ossau.uklinux.net> wrote:
    John> | If Elisp is a guide [...]

    John> I think it performance might be better in most cases because Octave's
    John> interpreter is known to be really slow for many operations.

OK, let's hope so.

    John> | - You have to believe that implementing your language constructs in
    John> |   Scheme is easier to maintain than implementing them in C.

    John> Well, I'm not sure.  But it is a lot of work to write an maintain an
    John> interperter for a special language, and much of that effort is
    John> duplicated by every scripting language.  People using Octave and Guile
    John> both want access to OS system calls and library functions (from basic
    John> stuff to GUI toolkits) so it seems wasteful to me that we build many
    John> interfaces to all these different libraries.  I think it would be much
    John> better to take advantage of existing work that's already been done.

Agreed - there is duplication that can be removed, and it will be cool
to have, e.g., a gnuplot interface available in Guile in general.

But I think the point about Scheme vs. C is still important.  If your
language has a `for' construct, you have to implement it somehow,
unless you are lucky enough that the target language already has an
identical construct.  IMO, Scheme is easier for this than C in
individual cases (e.g. compare unwind-protect in CVS
guile-core/lang/elisp/primitives/syntax.scm and in the Emacs source
eval.c).  And, where there is a pattern in the way that a group of
constructs maps from your language to the target, Scheme has more ways
than C of allowing you to express that pattern in your construct
definitions.

    John> | [...] might end up wanting to
    John> |   keep it in C anyway (but switch to using Guile data types).

    John> Along with a way to call Guile functions, this would offer a lot, but
    John> I would still like to get away from having to maintain the low-level
    John> details of an interpreter.

Agreed.  The low-level details I can think of that Guile could handle
for you are:

- memory allocation and GC

- evaluation, function and macro dispatching

- having to have a representation for the code that you have read in

- bignums, if Guile's bignum meet Octave's existing needs

- other basic data types like numbers and strings

- arrays, if you think that Guile's uniform array implementation is
  suitable.

Any others?

    John> | Right, but this is just a matter of wrapping existing code, isn't it?

    John> Yes and no.  There is the opportunity to correct some of the mistakes
    John> of the past too, which might mean more than just wrapping the current
    John> Octave classes.

OK.

    John> |     John> [...] having the translator is essential.
    John> | 
    John> | Totally agree; this is what Guile is supposed to be about: providing
    John> | language flexibility to its users.

    John> Yes, but there seem to be no fully functional examples of actually
    John> doing this yet.  If that's correct, why not?  What's keeping people
    John> from doing this?

    John> One problem that I can imagine is that for languages like Perl, or
    John> Python, which are starting to be quite large, it's not enough to just
    John> translate the syntax to scheme, you need the run-time.  Integrating
    John> all of that could be a lot of work.  But I think that a bigger problem
    John> is that there is no standard for these languages, so the language
    John> definition is whatever the real Perl or Python interpreters do today.
    John> Unless the authors of those tools integrate the Guile interpreter in
    John> their own code, the fork becomes difficult to maintain.

    John> These sorts of problems would not cause trouble for Octave, because I
    John> would be integrating Guile completely.  I'm just trying to understand
    John> what might be the reasons that we don't have many translators.

This is my analysis too.  In the Elisp case, FWIW, it's certainly true
that you need the runtime to have a useful system, and that the best
way to get (most of) it is to build the Emacs source in a modified
form.  This is what Ken Raeburn's Guile-based Emacs project is doing.

Therefore, it's a codebase management issue (or, equivalently, a
not-wanting-to-fork issue).  Tracking a separately managed project is
already very hard even if your aim is only to copy its syntax and
semantics.  When you want to reuse a lot of that project's source code
as well, but in a modified form, but also stay in sync as new releases
come out, it gets harder.  Cf. Ken's project, which was put back some
way by Emacs 21 coming out.

Ideally, serious political will is needed on the part of the project
that you are trying to track.  (Note that this does not exist in the
Emacs case, AFAIK.)  Barring that, I imagine it helps if the target is
standardized or changing very slowly.

My guess is that writing a good translator without full Guile
integration may prove impossible.  But perhaps Thomas Bushnell's
Python will provide a counter-example - I hope so.

        Neil


_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-user


  parent reply	other threads:[~2002-04-28 18:21 UTC|newest]

Thread overview: 125+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-26 17:55 language translator help John W. Eaton
2002-04-26 21:14 ` Thomas Bushnell, BSG
2002-04-27  9:48 ` Neil Jerram
2002-04-28  0:47   ` John W. Eaton
2002-04-28  1:21     ` Thomas Bushnell, BSG
2002-04-28  1:32       ` John W. Eaton
2002-04-28  2:10         ` Thomas Bushnell, BSG
2002-04-28 14:44           ` John W. Eaton
2002-04-28 18:41             ` Thomas Bushnell, BSG
2002-04-28 22:18               ` John W. Eaton
2002-04-29  5:16                 ` Thomas Bushnell, BSG
2002-04-29 16:36                   ` John W. Eaton
2002-04-29 20:28                     ` Thien-Thi Nguyen
2002-04-30 17:57                     ` MJ Ray
2002-05-01  6:31                       ` Thomas Bushnell, BSG
2002-04-30 22:49                     ` Thomas Bushnell, BSG
2002-04-28 18:21       ` Neil Jerram
2002-04-28 18:42         ` Thomas Bushnell, BSG
2002-05-01 22:19           ` Neil Jerram
2002-05-15 11:35         ` Thien-Thi Nguyen
2002-05-15 20:49           ` Marius Vollmer
2002-05-15 23:13             ` Thien-Thi Nguyen
2002-05-16  0:26               ` Bill Gribble
2002-05-16  1:20                 ` Thien-Thi Nguyen
2002-05-16  5:02                 ` Per Bothner
2002-05-16 21:57               ` Marius Vollmer
2002-05-16 22:36                 ` Thien-Thi Nguyen
2002-05-22 12:37                   ` Marius Vollmer
2002-05-22 19:26                     ` Thien-Thi Nguyen
2002-05-22 20:50                       ` Marius Vollmer
2002-05-22 22:23                         ` Thien-Thi Nguyen
2002-05-23  0:23                           ` Marius Vollmer
2002-05-23  4:59                             ` Thien-Thi Nguyen
2002-05-23 11:37                               ` Bill Gribble
2002-05-23 23:41                                 ` Thien-Thi Nguyen
2002-05-23 11:46                           ` MJ Ray
2002-05-23 17:33                             ` Marius Vollmer
     [not found]                               ` <mvo@zagadka.ping.de>
2002-05-23 22:20                                 ` MJ Ray
2002-05-27 20:26                                   ` Marius Vollmer
2002-05-29  8:55                                     ` Thien-Thi Nguyen
2002-05-29 18:56                                       ` Marius Vollmer
2002-05-29 19:17                                         ` Thien-Thi Nguyen
2002-05-29 19:46                                           ` Marius Vollmer
2002-05-29 19:59                                             ` Thien-Thi Nguyen
2002-05-30 12:16                                               ` Marius Vollmer
2002-05-30 22:39                                                 ` Thien-Thi Nguyen
2002-05-30  2:28                                           ` Christopher Cramer
2002-05-30  7:38                                             ` Thien-Thi Nguyen
2002-06-04 22:58                                           ` MJ Ray
2002-06-04 23:56                                             ` Thien-Thi Nguyen
     [not found]                                               ` <ttn@giblet.glug.org>
2002-06-05  8:22                                                 ` MJ Ray
2002-06-05  9:42                                                   ` Thien-Thi Nguyen
2002-06-05 22:59                                                     ` MJ Ray
2002-06-05 23:32                                                       ` Thien-Thi Nguyen
2002-06-07 23:14                                                       ` Thien-Thi Nguyen
2002-06-05 23:54                                                 ` MJ Ray
2002-06-06  0:23                                                   ` Thien-Thi Nguyen
2002-06-06  2:44                                                     ` Bill Gribble
2002-06-06  7:23                                                       ` Thien-Thi Nguyen
2002-06-06  8:13                                                       ` Thien-Thi Nguyen
2002-06-06  9:24                                                 ` MJ Ray
2002-06-06 11:18                                                   ` Thien-Thi Nguyen
2002-06-07 23:25                                                     ` MJ Ray
2002-06-08  0:42                                                       ` Thien-Thi Nguyen
2002-06-08  4:49                                                       ` Thien-Thi Nguyen
2002-06-08 17:44                                                       ` rm
2002-06-10 16:45                                                         ` Marius Vollmer
2002-06-08 22:45                                                 ` MJ Ray
2002-06-08 23:18                                                   ` Thien-Thi Nguyen
2002-06-10 12:29                                                     ` MJ Ray
2002-06-10 12:31                                                     ` MJ Ray
2002-06-10 19:18                                                       ` Thien-Thi Nguyen
2002-06-10 23:30                                                 ` MJ Ray
2002-06-10 23:51                                                   ` Thien-Thi Nguyen
2002-06-11 17:50                                                     ` Robert Uhl <ruhl@4dv.net>
2002-06-11 20:09                                                       ` Thien-Thi Nguyen
2002-06-11 18:48                                                   ` news
2002-06-12 17:44                                                     ` Forking stables. was " MJ Ray
2002-06-12 20:31                                                       ` Rob Browning
2002-06-14 19:32                                                       ` Thien-Thi Nguyen
2002-06-14 20:08                                                         ` Clinton Ebadi
2002-06-14 20:21                                                           ` Thien-Thi Nguyen
2002-06-14 21:03                                                             ` Clinton Ebadi
2002-06-14 21:39                                                               ` Robert Uhl <ruhl@4dv.net>
2002-06-14 21:45                                                               ` news
2002-06-17 22:37                                                                 ` Neil Jerram
2002-06-17 23:06                                                                   ` Clinton Ebadi
2002-06-17 23:14                                                                     ` Clinton Ebadi
2002-06-17 23:35                                                                   ` Bill Gribble
2002-06-18 18:40                                                                   ` news
2002-10-04 17:53                                                                     ` Thien-Thi Nguyen
2002-06-15  6:29                                                               ` Thien-Thi Nguyen
2002-09-08 18:48                                                 ` guile 1.4.1.86 (snap) available MJ Ray
2002-09-08 20:09                                                   ` Thien-Thi Nguyen
2002-05-18 13:47           ` language translator help Neil Jerram
2002-05-19  2:32             ` Thien-Thi Nguyen
2002-05-19  3:03               ` Thien-Thi Nguyen
2002-04-28  6:53     ` Per Bothner
2002-04-28 18:21     ` Neil Jerram [this message]
2002-04-28  0:53   ` loop translations (was: Re: language translator help) John W. Eaton
2002-04-28  1:33     ` Thien-Thi Nguyen
2002-04-28  5:06       ` David Pirotte
2002-04-28  9:52         ` rm
2002-04-28 13:49     ` Marius Vollmer
2002-04-28 14:29       ` John W. Eaton
2002-04-28 18:15         ` Marius Vollmer
2002-04-28 18:48           ` Marius Vollmer
2002-04-29 20:07             ` Clinton Ebadi
2002-04-29 20:50               ` Eric E Moore
2002-04-30 15:07                 ` Eric E Moore
2002-04-28 18:21     ` Neil Jerram
2002-04-28  0:54   ` translators and scoping rules " John W. Eaton
2002-04-28 13:50     ` Marius Vollmer
2002-04-28 14:03       ` John W. Eaton
2002-04-28 14:35         ` Marius Vollmer
2002-04-29  2:26           ` John W. Eaton
2002-05-07 18:50             ` Marius Vollmer
2002-04-28 15:26         ` Per Bothner
2002-04-29  2:08           ` John W. Eaton
2002-04-29  4:37             ` Per Bothner
2002-04-29 16:27               ` John W. Eaton
2002-04-28 18:21     ` Neil Jerram
  -- strict thread matches above, loose matches on Subject: below --
2002-09-08  6:23 guile 1.4.1.86 (snap) available Thien-Thi Nguyen
2002-09-08 17:21 ` MJ Ray
2002-09-08 17:45   ` Thien-Thi Nguyen

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=m3662b3cqo.fsf@laruns.ossau.uklinux.net \
    --to=neil@ossau.uklinux.net \
    --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).