<div dir="ltr">That is more practical.  <div><br></div><div>It is a pity that the Unboxed class does not interact with the UNPACK pragma. Or it seems so. <br><div><br></div><div>The problem that round my head after being exposed to the Google phylosophy of "count the bytes" is the trade off when choosing containers: Either boxed, pure, linked multithreaded or  unboxed mutable single threaded.  </div><div><br></div><div>Haskell philosophy choose the first, while almost all the mainstream languages choose the second. That is another problem for the adoption of haskell.  Google people say: we don´t need multithreaded programs because we run many single threaded programs in one machine, we use all the cores. </div><div>Only when there is a single application to run the justification for the extra effort of multithreading is justified. And this happens rarely in the real world: In scientific, engineering, financial it is usual. It also happens in distributed settings but in that last case, performance per thread and core is also critical, so Haskell is ruled out.</div><div><br></div><div>But that hasn´t to be that way, or at least that is what I think. DiffUArrays are internally mutable but with a pure interface.  They use a kind of versioning. in single threaded environments it theoretically perform at mutable speeds.  the versioning of diffArray is the blend of packed and linked structure that can mix the two worlds.</div><div><br></div><div>If the unboxing is extended to any kind of user defined data, the versioning idea can be used to have containers that perform at C speeds when single threaded, but preserve the purity when multithreaded.  So it is possible to have the cake and eat it too.</div></div><div><br></div><div>it is even possible to codify balanced binary trees in a compact diffarray, so very fast maps can be used in single threaded applications that also are pure and work multithreaded.</div><div><br></div><div>The goal is to remove the objections about haskell coming from that side of the computer industry by having such containers available without forcing the user to know lots of things about the internals of haskell and GHC.</div><div><br></div><div>I do not know if there are thing going on in some of this direction. Maybe I´m being simplistic and there is something that I miss . </div><div><br></div><div>By experience I know that what sell more from a language is not the real performance numbers, but the approaches that the language takes and how much that promises for the future: </div><div><br></div><div>For example I can develop a kind of container following this idea that perform badly both in single and multithreaded. for sure the early version should be so. But, if  people understand that the design has potential for being optimized in the future, people will buy the idea and will accept happily the Haskell language for performance semi-critical apps because they will have arguments against the objections of this kind .</div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-11-12 23:56 GMT+01:00 Michael Snoyman <span dir="ltr"><<a href="mailto:michael@snoyman.com" target="_blank">michael@snoyman.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">How about vector-th-unbox[1]?<div><br></div><div>[1] <a href="https://www.stackage.org/package/vector-th-unbox" target="_blank">https://www.stackage.org/package/vector-th-unbox</a></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Nov 12, 2015 at 2:53 PM, Alberto G. Corona <span dir="ltr"><<a href="mailto:agocorona@gmail.com" target="_blank">agocorona@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">There are no examples. It is hard to guess the functionality and the maturity of he approach.</div><div class="gmail_extra"><div><div><br><div class="gmail_quote">2015-11-12 18:56 GMT+01:00 David Kraeutmann <span dir="ltr"><<a href="mailto:kane@kane.cx" target="_blank">kane@kane.cx</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This might be of interest to you:<br>
<a href="https://hackage.haskell.org/package/structs" rel="noreferrer" target="_blank">https://hackage.haskell.org/package/structs</a><br>
<span><br>
<br>
On 11/12/2015 6:49 PM, Alberto G. Corona wrote:<br>
> Looking at this:<br>
><br>
> <a href="https://downloads.haskell.org/~ghc/6.12.3/docs/html/users_guide/primitives.html" rel="noreferrer" target="_blank">https://downloads.haskell.org/~ghc/6.12.3/docs/html/users_guide/primitives.html</a><br>
><br>
> It seems that it is impossible to manage data in Haskell within a core<br>
> without L1 cache faults. Except for unboxed arrays of primitive types.<br>
><br>
> Since it is impossible to have unboxed arrays of user-defined types.<br>
><br>
> Am I right?<br>
><br>
> This is definitively very bad for tasks that are inherently single threaded<br>
> and in general for the image of Haskell as a practical language.<br>
><br>
> I have more to say about that, but I would like to know first if I´m right<br>
> and second If there is some idea to going on to permit user defined boxed<br>
> datatypes.  Or if there is some low level trick for having it using foreign<br>
> call and unsafeCoerce in some way,<br>
><br>
> I know that the language ATS has unboxing a la carte....<br>
><br>
><br>
><br>
</span>> _______________________________________________<br>
> Haskell-Cafe mailing list<br>
> <a href="mailto:Haskell-Cafe@haskell.org" target="_blank">Haskell-Cafe@haskell.org</a><br>
> <a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
><br>
<br>
<br>
</blockquote></div><br><br clear="all"><div><br></div></div></div><span><font color="#888888">-- <br><div>Alberto.</div>
</font></span></div>
<br>_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org" target="_blank">Haskell-Cafe@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
<br></blockquote></div><br></div>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Alberto.</div>
</div>