Re: ArrayArrays

2015-09-08 Thread Simon Marlow
about directly supporting an >> >>>>>>>> extensib

Re: ArrayArrays

2015-09-08 Thread Edward Kmett
>> >>>>>>> Given that it'd have a couple of >> words for those counts it'd >> >> >>

Re: ArrayArrays

2015-09-08 Thread Simon Marlow
>> >>>>>>>> (like Ed said), and I'm trying to fully understand why it's hard. >> >>>>>>>> >> >>

RE: ArrayArrays

2015-09-08 Thread Simon Peyton Jones
| Without any unlifted kind, we need |- ArrayArray# |- a set of new/read/write primops for every element type, | either built-in or made from unsafeCoerce# | | With the unlifted kind, we would need |- ArrayArray# |- one set of new/read/write primops | | With levity

Re: ArrayArrays

2015-09-08 Thread Simon Marlow
On 08/09/2015 13:10, Simon Peyton Jones wrote: | Without any unlifted kind, we need |- ArrayArray# |- a set of new/read/write primops for every element type, | either built-in or made from unsafeCoerce# | | With the unlifted kind, we would need |- ArrayArray# |- one set

RE: ArrayArrays

2015-09-07 Thread Simon Peyton Jones
From: ghc-devs [mailto:ghc-devs-boun...@haskell.org] On Behalf Of Ryan Newton Sent: 31 August 2015 23:11 To: Edward Kmett; Johan Tibell Cc: Simon Marlow; Manuel M T Chakravarty; Chao-Hong Chen; ghc-devs; Ryan Scott; Ryan Yates Subject: Re: ArrayArrays Dear Edward, Ryan Yates, and other interested

Re: ArrayArrays

2015-09-07 Thread Edward Kmett
; *To:* Simon Peyton Jones > *Cc:* Ryan Newton; Johan Tibell; Simon Marlow; Manuel M T Chakravarty; > Chao-Hong Chen; ghc-devs; Ryan Scott; Ryan Yates > *Subject:* Re: ArrayArrays > > > > I had a brief discussion with Richard during the Haskell Symposium about > how we m

Re: ArrayArrays

2015-09-07 Thread Dan Doel
On Mon, Sep 7, 2015 at 4:16 PM, Edward Kmett wrote: > Notably, it'd be interesting to explore the ability to allow parametricity > over the portion of # that is just a gcptr. Which is also a necessary part of Ed Yang's unlifted types proposal. This portion of # becomes the

Re: ArrayArrays

2015-09-07 Thread Edward Kmett
nks > > > > Simon > > > > *From:* ghc-devs [mailto:ghc-devs-boun...@haskell.org] *On Behalf Of *Ryan > Newton > *Sent:* 31 August 2015 23:11 > *To:* Edward Kmett; Johan Tibell > *Cc:* Simon Marlow; Manuel M T Chakravarty; Chao-Hong Chen; ghc-devs; > Ryan Scott; R

Re: ArrayArrays

2015-09-07 Thread Edward Kmett
Newton > *Sent:* 31 August 2015 23:11 > *To:* Edward Kmett; Johan Tibell > *Cc:* Simon Marlow; Manuel M T Chakravarty; Chao-Hong Chen; ghc-devs; > Ryan Scott; Ryan Yates > *Subject:* Re: ArrayArrays > > > > Dear Edward, Ryan Yates, and other interested parties -- > > &

Re: ArrayArrays

2015-09-07 Thread Ryan Newton
ailto:ghc-devs-boun...@haskell.org] *On Behalf Of *Ryan >> Newton >> *Sent:* 31 August 2015 23:11 >> *To:* Edward Kmett; Johan Tibell >> *Cc:* Simon Marlow; Manuel M T Chakravarty; Chao-Hong Chen; ghc-devs; >> Ryan Scott; Ryan Yates >> *Subject:* Re: ArrayA

Re: ArrayArrays

2015-09-07 Thread Edward Kmett
d >>> design? And, I earnestly hope, also describes the menagerie of currently >>> available array types and primops so that users can have some chance of >>> picking the right one?! >>> >>> >>> >>> Thanks >>> >>> >

Re: ArrayArrays

2015-08-31 Thread Ryan Newton
nbounded >>>>> >> >>>>>> length) with extra payload. >>>>> >> >>>>>> >>>>> >> >>>>>> I can see how we can do without structs if we have arrays, >>>>> >> >>>&

Re: ArrayArrays

2015-08-31 Thread Johan Tibell
t;>>>> the heap. > >>>>>> >> >>>>>>>>> > >>>>>> >> >>>>>>>>> > >>>>>> >> >>>>>>>>&g

Re: ArrayArrays

2015-08-29 Thread Johan Tibell
To: Simon Peyton Jones Cc: Manuel M T Chakravarty; Simon Marlow; ghc-devs Subject: Re: ArrayArrays An ArrayArray# is just an Array# with a modified invariant. It points directly to other unlifted ArrayArray#'s or ByteArray#'s. While those live

RE: ArrayArrays

2015-08-28 Thread Simon Peyton Jones
Chakravarty; Simon Marlow; ghc-devs Subject: Re: ArrayArrays An ArrayArray# is just an Array# with a modified invariant. It points directly to other unlifted ArrayArray#'s or ByteArray#'s. While those live in #, they are garbage collected objects, so this all lives on the heap. They were added to make

Re: ArrayArrays

2015-08-28 Thread Simon Marlow
On 27/08/2015 19:36, Edward Kmett wrote: On Thu, Aug 27, 2015 at 1:24 PM, Edward Z. Yang ezy...@mit.edu mailto:ezy...@mit.edu wrote: It seems to me that we should take a page from OCaml's playbook and add support for native mutable fields in objects, because this is essentially what

Re: ArrayArrays

2015-08-28 Thread Edward Kmett
...@gmail.com] Sent: 27 August 2015 16:54 To: Simon Peyton Jones Cc: Manuel M T Chakravarty; Simon Marlow; ghc-devs Subject: Re: ArrayArrays An ArrayArray# is just an Array# with a modified invariant. It points directly to other unlifted ArrayArray#'s or ByteArray#'s. While those

Re: ArrayArrays

2015-08-28 Thread Ryan Yates
, please do make it into a wiki page on the GHC Trac, and maybe make a ticket for it. Thanks Simon From: Edward Kmett [mailto:ekm...@gmail.com] Sent: 27 August 2015 16:54 To: Simon Peyton Jones Cc: Manuel M T Chakravarty; Simon Marlow; ghc-devs Subject: Re: ArrayArrays

Re: ArrayArrays

2015-08-28 Thread Edward Kmett
2015 16:54 *To:* Simon Peyton Jones *Cc:* Manuel M T Chakravarty; Simon Marlow; ghc-devs *Subject:* Re: ArrayArrays An ArrayArray# is just an Array# with a modified invariant. It points directly to other unlifted ArrayArray#'s or ByteArray#'s. While those live in #, they are garbage

Re: ArrayArrays

2015-08-28 Thread Ryan Newton
Chakravarty *Cc:* Simon Marlow; ghc-devs *Subject:* Re: ArrayArrays When (ab)using them for this purpose, SmallArrayArray's would be very handy as well. Consider right now if I have something like an order-maintenance structure I have: data Upper s = Upper {-# UNPACK

Re: ArrayArrays

2015-08-28 Thread Edward Kmett
Simon From: Edward Kmett [mailto:ekm...@gmail.com] Sent: 27 August 2015 16:54 To: Simon Peyton Jones Cc: Manuel M T Chakravarty; Simon Marlow; ghc-devs Subject: Re: ArrayArrays An ArrayArray# is just an Array# with a modified invariant. It points directly to other unlifted

Re: ArrayArrays

2015-08-28 Thread Edward Kmett
Simon *From:* Edward Kmett [mailto:ekm...@gmail.com] *Sent:* 27 August 2015 16:54 *To:* Simon Peyton Jones *Cc:* Manuel M T Chakravarty; Simon Marlow; ghc-devs *Subject:* Re: ArrayArrays An ArrayArray# is just an Array# with a modified invariant. It points directly to other unlifted

Re: ArrayArrays

2015-08-28 Thread Ryan Newton
-devs *Subject:* Re: ArrayArrays An ArrayArray# is just an Array# with a modified invariant. It points directly to other unlifted ArrayArray#'s or ByteArray#'s. While those live in #, they are garbage collected objects, so this all lives on the heap. They were added to make some

Re: ArrayArrays

2015-08-28 Thread Ryan Newton
*To:* Simon Peyton Jones *Cc:* Manuel M T Chakravarty; Simon Marlow; ghc-devs *Subject:* Re: ArrayArrays An ArrayArray# is just an Array# with a modified invariant. It points directly to other unlifted ArrayArray#'s or ByteArray#'s. While those live in #, they are garbage collected

Re: ArrayArrays

2015-08-28 Thread Edward Kmett
Kmett [mailto:ekm...@gmail.com] *Sent:* 27 August 2015 16:54 *To:* Simon Peyton Jones *Cc:* Manuel M T Chakravarty; Simon Marlow; ghc-devs *Subject:* Re: ArrayArrays An ArrayArray# is just an Array# with a modified invariant. It points directly to other unlifted ArrayArray#'s or ByteArray

Re: ArrayArrays

2015-08-28 Thread Ryan Newton
it into a wiki page on the GHC Trac, and maybe make a ticket for it. Thanks Simon *From:* Edward Kmett [mailto:ekm...@gmail.com] *Sent:* 27 August 2015 16:54 *To:* Simon Peyton Jones *Cc:* Manuel M T Chakravarty; Simon Marlow; ghc-devs *Subject:* Re: ArrayArrays An ArrayArray# is just

Re: ArrayArrays

2015-08-28 Thread Ryan Yates
From: Edward Kmett [mailto:ekm...@gmail.com] Sent: 27 August 2015 16:54 To: Simon Peyton Jones Cc: Manuel M T Chakravarty; Simon Marlow; ghc-devs Subject: Re: ArrayArrays An ArrayArray# is just an Array# with a modified invariant. It points directly to other unlifted ArrayArray#'s

RE: ArrayArrays

2015-08-27 Thread Simon Peyton Jones
] On Behalf Of Edward Kmett Sent: 21 August 2015 05:25 To: Manuel M T Chakravarty Cc: Simon Marlow; ghc-devs Subject: Re: ArrayArrays When (ab)using them for this purpose, SmallArrayArray's would be very handy as well. Consider right now if I have something like an order-maintenance structure I

Re: ArrayArrays

2015-08-27 Thread Edward Z. Yang
It seems to me that we should take a page from OCaml's playbook and add support for native mutable fields in objects, because this is essentially what a mix of words and pointers is. The big question, as always, is what the syntax should be. Edward Excerpts from Ryan Yates's message of

Re: ArrayArrays

2015-08-27 Thread Edward Kmett
05:25 *To:* Manuel M T Chakravarty *Cc:* Simon Marlow; ghc-devs *Subject:* Re: ArrayArrays When (ab)using them for this purpose, SmallArrayArray's would be very handy as well. Consider right now if I have something like an order-maintenance structure I have: data Upper s = Upper

Re: ArrayArrays

2015-08-27 Thread Edward Kmett
On Thu, Aug 27, 2015 at 1:24 PM, Edward Z. Yang ezy...@mit.edu wrote: It seems to me that we should take a page from OCaml's playbook and add support for native mutable fields in objects, because this is essentially what a mix of words and pointers is. That actually doesn't work as well as

Re: ArrayArrays

2015-08-21 Thread Ryan Yates
Hi Edward, I've been working on removing indirection in STM and I added a heap object like SmallArray, but with a mix of words and pointers (as well as a header with metadata for STM). It appears to work well now, but it is missing the type information. All the pointers have the same type which

Re: ArrayArrays

2015-08-21 Thread Edward Kmett
On Fri, Aug 21, 2015 at 9:49 AM, Ryan Yates fryguy...@gmail.com wrote: Hi Edward, I've been working on removing indirection in STM and I added a heap object like SmallArray, but with a mix of words and pointers (as well as a header with metadata for STM). It appears to work well now, but

Re: ArrayArrays

2015-08-20 Thread Manuel M T Chakravarty
That’s an interesting idea. Manuel Edward Kmett ekm...@gmail.com: Would it be possible to add unsafe primops to add Array# and SmallArray# entries to an ArrayArray#? The fact that the ArrayArray# entries are all directly unlifted avoiding a level of indirection for the containing

Re: ArrayArrays

2015-08-20 Thread Edward Kmett
When (ab)using them for this purpose, SmallArrayArray's would be very handy as well. Consider right now if I have something like an order-maintenance structure I have: data Upper s = Upper {-# UNPACK #-} !(MutableByteArray s) {-# UNPACK #-} !(MutVar s (Upper s)) {-# UNPACK #-} !(MutVar s (Upper