unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Andy Wingo <wingo@pobox.com>
To: ludo@gnu.org (Ludovic Courtès)
Cc: guile-devel@gnu.org
Subject: Re: towards a more unified procedure application mechanism
Date: Thu, 03 Sep 2009 10:39:43 +0200	[thread overview]
Message-ID: <m38wgw2zhs.fsf@pobox.com> (raw)
In-Reply-To: <87iqg474s0.fsf@gnu.org> ("Ludovic Courtès"'s message of "Mon, 31 Aug 2009 10:42:55 +0200")

Hi Ludovic,

On Mon 31 Aug 2009 10:42, ludo@gnu.org (Ludovic Courtès) writes:

> Andy Wingo <wingo@pobox.com> writes:
>
>>>  scm_tc7_subr_2o            SCM (*) () -- 0 arguments.
>>>  scm_tc7_subr_1             SCM (*) (SCM) -- 1 argument.
>>>  scm_tc7_subr_1o            SCM (*) (SCM) -- 1 optional argument.
>>>  scm_tc7_subr_2o            SCM (*) (SCM, SCM) -- 2 required args.
>>>  scm_tc7_subr_2o            SCM (*) (SCM, SCM) -- 2 optional args.
>>>  scm_tc7_subr_3             SCM (*) (SCM, SCM, SCM) -- 3 required args.
>>>  scm_tc7_lsubr              SCM (*) (SCM) -- list subrs
>>>  scm_tc7_lsubr_2            SCM (*) (SCM, SCM, SCM)
>>
>> I would like to make these all be gsubrs. There are very few places
>> where these constants actually exist in code "out there" -- normally the
>> way to do this is to use scm_c_define_gsubr, and it does the right
>> thing.
>>
>> I'll probably do a:
>>
>> #define scm_tc7_subr_2o \
>>   scm_tc7_subr_2o_NO_LONGER_EXISTS_USE_scm_c_define_gsubr
>>
>> or something like that.
>
> You can't do that because such subrs are created by `create_gsubr ()'
> when the signature allows it.  Or did you mean `create_gsubr ()' would
> now create only gsubrs?

Yes, I mean for create_gsubr to return gsubrs.

> These specialized subr types allow for faster dispatch, as opposed to
> the argument count checks (and argument copies) that are done in
> `scm_i_gsubr_apply ()'.  Thus, I think replacing all of them with gsubrs
> may have a negative impact performance-wise.

That might be true with the current implementation, but it need not be
true with dispatch in the VM. The specialized subr types don't actually
gain us anything; you can do a gsubr dispatch just as fast, comparing
the tc16 instead of the tc7.

>>>  scm_tc7_dsubr              double (*) (double) -- double subrs
>>
>> I'll remove these, changing their implementations to be gsubrs. This
>> only affects $sin et al; I'll probably roll the transcendental versions
>> into the subrs as well.
>
> Yes, it seems to be seldom used.  However, it might be a semi-public
> API...

Undocumented of course. I seriously doubt this removal will cause
problems.

> Sounds like a nice plan!

We'll see how it goes :) This will be on my subr-simplification branch.

A
-- 
http://wingolog.org/




  reply	other threads:[~2009-09-03  8:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-29 11:38 towards a more unified procedure application mechanism Andy Wingo
2009-08-30 15:45 ` Andy Wingo
2009-08-31  8:42   ` Ludovic Courtès
2009-09-03  8:39     ` Andy Wingo [this message]
2009-09-03 16:10       ` Ludovic Courtès

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=m38wgw2zhs.fsf@pobox.com \
    --to=wingo@pobox.com \
    --cc=guile-devel@gnu.org \
    --cc=ludo@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).