unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* Shared arrays
@ 2004-10-28  9:31 Mikael Djurfeldt
  2004-10-28 11:48 ` Marius Vollmer
  2004-10-30 14:38 ` Neil Jerram
  0 siblings, 2 replies; 5+ messages in thread
From: Mikael Djurfeldt @ 2004-10-28  9:31 UTC (permalink / raw)
  Cc: djurfeldt, guile-devel

2004-10-27  Marius Vollmer  <marius.vollmer@uni-dortmund.de>

	First cut at integrating uniform vectors from srfi-4 with the rest
	of Guile.  This change replaces scm_tc7_byvect with a s8 uniform
	vector.  The plan is to gradually replace one type after the other
	until none is left and then to consider general cleanups and
	optimizations.

This is great.  Just one comment.  I do hope we'll keep the ability to
create shared arrays.  This is similar in spirit to list structures
and mutation-sharing substrings, and extremely useful.

M


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-devel


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Shared arrays
  2004-10-28  9:31 Shared arrays Mikael Djurfeldt
@ 2004-10-28 11:48 ` Marius Vollmer
  2004-10-28 11:54   ` Mikael Djurfeldt
  2004-10-30 14:38 ` Neil Jerram
  1 sibling, 1 reply; 5+ messages in thread
From: Marius Vollmer @ 2004-10-28 11:48 UTC (permalink / raw)
  Cc: guile-devel

Mikael Djurfeldt <mdj@kvast.blakulla.net> writes:

> 2004-10-27  Marius Vollmer  <marius.vollmer@uni-dortmund.de>
>
> 	First cut at integrating uniform vectors from srfi-4 with the rest
> 	of Guile.  This change replaces scm_tc7_byvect with a s8 uniform
> 	vector.  The plan is to gradually replace one type after the other
> 	until none is left and then to consider general cleanups and
> 	optimizations.
>
> This is great.  Just one comment.  I do hope we'll keep the ability to
> create shared arrays.  This is similar in spirit to list structures
> and mutation-sharing substrings, and extremely useful.

Yes, definitely.  What worries me a bit right now is that
one-dimensional shared arrays look like (uniform) vectors, but you
can't use them in all the places that you can use (uniform) vectors.

For example (excuse the density):

  (vector? (make-shared-array (make-array 1 3 3) (lambda (i) (list i i)) 3))
  => #f

although one can of course argue that the diagonal of a 2-d array is a
vector.


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-devel


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Shared arrays
  2004-10-28 11:48 ` Marius Vollmer
@ 2004-10-28 11:54   ` Mikael Djurfeldt
  2004-10-28 12:15     ` Marius Vollmer
  0 siblings, 1 reply; 5+ messages in thread
From: Mikael Djurfeldt @ 2004-10-28 11:54 UTC (permalink / raw)
  Cc: djurfeldt, guile-devel

Marius Vollmer <marius.vollmer@uni-dortmund.de> writes:

> What worries me a bit right now is that one-dimensional shared
> arrays look like (uniform) vectors, but you can't use them in all
> the places that you can use (uniform) vectors.
>
> For example (excuse the density):
>
>   (vector? (make-shared-array (make-array 1 3 3) (lambda (i) (list i i)) 3))
>   => #f
>
> although one can of course argue that the diagonal of a 2-d array is a
> vector.

Yes,

I think it's ugly to have two alternative representations for a
1-dimensional list of numbers (uniform vector + 1D uniform array).
Just as we convert bignums small enough to fit in an inum, we should,
in my opinion, only use the uniform vector representation.

Or, perhaps even simpler, represent uniform vectors as 1D arrays.

M


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-devel


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Shared arrays
  2004-10-28 11:54   ` Mikael Djurfeldt
@ 2004-10-28 12:15     ` Marius Vollmer
  0 siblings, 0 replies; 5+ messages in thread
From: Marius Vollmer @ 2004-10-28 12:15 UTC (permalink / raw)
  Cc: guile-devel

Mikael Djurfeldt <djurfeldt@nada.kth.se> writes:

> Or, perhaps even simpler, represent uniform vectors as 1D arrays.

Yes, we could do that.  The downside to this is that the interface for
accessing these vectors from C becomes much more complicated since the
elements of the vector are not necessarily contiguous in memory.

Right now, I would be happy with just stating clearly that 1-d shared
arrays are not vectors, full stop.  (Of course, 1-d _non_-shared
arrays _are_ vectors.)

But now might be the right time to go for the clean solution, now that
the new interface is being defined... hmm.

I will first clean up the functionality that we have now, and then
worry about new functionality.

Related to this: should vector-set! etc work with uniform vectors?
With strings?


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-devel


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Shared arrays
  2004-10-28  9:31 Shared arrays Mikael Djurfeldt
  2004-10-28 11:48 ` Marius Vollmer
@ 2004-10-30 14:38 ` Neil Jerram
  1 sibling, 0 replies; 5+ messages in thread
From: Neil Jerram @ 2004-10-30 14:38 UTC (permalink / raw)
  Cc: Mikael Djurfeldt, guile-devel

Mikael Djurfeldt wrote:

>2004-10-27  Marius Vollmer  <marius.vollmer@uni-dortmund.de>
>
>	First cut at integrating uniform vectors from srfi-4 with the rest
>	of Guile.  This change replaces scm_tc7_byvect with a s8 uniform
>	vector.  The plan is to gradually replace one type after the other
>	until none is left and then to consider general cleanups and
>	optimizations.
>
>This is great.  Just one comment.  I do hope we'll keep the ability to
>create shared arrays.  This is similar in spirit to list structures
>and mutation-sharing substrings, and extremely useful.
>  
>
Just for the record (as I know you've already responded on this point), 
I second this.  My application - which I described in the survey thread 
- depends heavily on shared subarrays/subvectors.

Regards,
          Neil




_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-devel


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-10-30 14:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-28  9:31 Shared arrays Mikael Djurfeldt
2004-10-28 11:48 ` Marius Vollmer
2004-10-28 11:54   ` Mikael Djurfeldt
2004-10-28 12:15     ` Marius Vollmer
2004-10-30 14:38 ` Neil Jerram

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).