<div dir="ltr"><br><br><div class="gmail_quote">On Fri, Oct 3, 2008 at 4:36 AM, minh thu <span dir="ltr">&lt;<a href="mailto:noteed@gmail.com">noteed@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
2008/10/3 Mitchell, Neil &lt;<a href="mailto:neil.mitchell.2@credit-suisse.com">neil.mitchell.2@credit-suisse.com</a>&gt;:<br>
<div><div></div><div class="Wj3C7c">&gt;<br>
&gt; Hi<br>
&gt;<br>
&gt;<br>
&gt;&gt; &gt; &gt; You mean shared libraries without the opportunity to<br>
&gt;&gt; inline library code?<br>
&gt;&gt; &gt; &gt; This would result in a huge performance loss, I think.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Usually _mild_ performance loss, in exchange for major code-size<br>
&gt;&gt; &gt; savings, I would think. C obviously has worked quite fine under<br>
&gt;&gt; &gt; exactly this restraint (though C implementations obviously aren&#39;t<br>
&gt;&gt; &gt; built to take as great advantage of inlining library code<br>
&gt;&gt; as Haskell may be).<br>
&gt;&gt;<br>
&gt;&gt; I think that the performance loss is much higher in the case<br>
&gt;&gt; of Haskell because of Lazy Evaluation, massive use of higher<br>
&gt;&gt; order functions and possibly more.<br>
&gt;<br>
&gt; Example 1:<br>
&gt;<br>
&gt; foo x | &quot;test&quot; `isPrefixOf` xs = ...<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp;| otherwise = ...<br>
&gt;<br>
&gt; If you have cross-module inlining, you get the rather obvious if like<br>
&gt; construct. If you don&#39;t, you have to evaluate otherwise and test its<br>
&gt; value.<br>
&gt;<br>
&gt; Example 2:<br>
&gt;<br>
&gt; (a :: Int) + b<br>
&gt;<br>
&gt; If you have cross-module specialisation you get a primitive integer<br>
&gt; arithmetic instruction (possibly with a bit of unboxing, although often<br>
&gt; not). If you don&#39;t, you get a dictionary lookup, followed by a higher<br>
&gt; order application.<br>
&gt;<br>
&gt; One reason cross-module inlining is essential is that many Haskell<br>
&gt; functions don&#39;t do very much, think of (+), (||), (&gt;&gt;), not, otherwise<br>
&gt; etc. In C these would be built-in&#39;s, so are always available to the<br>
&gt; optimiser (and usually just one instruction), in Haskell you need to get<br>
&gt; them from the Prelude.<br>
<br>
</div></div>What happens in the C++ world where good chunk of functionnalities are<br>
in header files (templates or inline methods);<br>
is there the same LGPL problem that the one discussed here w.r.t.<br>
static/shared linking ?<br></blockquote><div><br></div><div>I don&#39;t know what happens on platforms that don&#39;t have shared libraries with LGPL. &nbsp;If you build stuff statically, I&#39;m pretty sure you can&#39;t claim stuff is loosely coupled.</div>
<div><br></div><div>Dave</div><div>&nbsp;</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
Thanks,<br>
<font color="#888888">Thu<br>
</font><div><div></div><div class="Wj3C7c">_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
</div></div></blockquote></div><br></div>