Hi Nicolas,<br><br><div class="gmail_quote">On Mon, Jun 21, 2010 at 2:59 PM, Nicolas Cellier <span dir="ltr">&lt;<a href="mailto:nicolas.cellier.aka.nice@gmail.com">nicolas.cellier.aka.nice@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;">2010/6/21 Nicolas Cellier &lt;<a href="mailto:nicolas.cellier.aka.nice@gmail.com">nicolas.cellier.aka.nice@gmail.com</a>&gt;:<br>

<div class="im">&gt; Compiler hack is available for Squeak 3.9 at<br>
&gt; <a href="http://bugs.squeak.org/view.php?id=2918" target="_blank">http://bugs.squeak.org/view.php?id=2918</a><br>
&gt; Load the 3 .cs in indicated order.<br>
&gt;<br>
&gt; I will publish an update for latest trunk at the same place when I&#39;ll<br>
&gt; have a bit of time...<br>
&gt;<br>
<br>
</div>Finally, I published a Compiler version for latest trunk in this<br>
SqueakSource repository<br>
Plus a hack or two to make external interface loadable in closure VM<br>
(there is an additional limitation in closure that is max number of<br>
block copied values&lt;16)<br></blockquote><div><br></div><div>I&#39;m interested to see the code that exceeds this limitation.  Hopefully it&#39;ll be temporary, but it&#39;ll take a bytecode redesign to overcome, so I can&#39;t fix this anytime soon.  Sorry it has bitten you!</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
Sometimes, it gets a bit tricky to initialize Smallapack.<br>
I did something like:<br>
<br>
LapackMatrix initialize.<br>
LapackMatrix allSubclasses do: [:e | [e initializeClassInstVars] ifError: []].<br>
<font color="#888888"><br>
Nicolas<br>
</font><div><div></div><div class="h5"><br>
&gt; Then the latest Smallapack code is at<br>
&gt; <a href="http://www.squeaksource.com/Smallapack.html" target="_blank">http://www.squeaksource.com/Smallapack.html</a><br>
&gt;<br>
&gt; If you are on linux, you&#39;d better use a relatively new VM correcting<br>
&gt; <a href="http://bugs.squeak.org/view.php?id=3929" target="_blank">http://bugs.squeak.org/view.php?id=3929</a><br>
&gt;<br>
&gt; Nicolas<br>
&gt;<br>
&gt;<br>
&gt; 2010/6/21 arul selvan &lt;<a href="mailto:arul.selvan@gmail.com">arul.selvan@gmail.com</a>&gt;:<br>
&gt;&gt; nicolas,<br>
&gt;&gt;<br>
&gt;&gt; i will be interested to test if a port for squeak is available<br>
&gt;&gt;<br>
&gt;&gt; arul<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; On Mon, Jun 21, 2010 at 12:41 PM, Nicolas Cellier<br>
&gt;&gt; &lt;<a href="mailto:nicolas.cellier.aka.nice@gmail.com">nicolas.cellier.aka.nice@gmail.com</a>&gt; wrote:<br>
&gt;&gt;&gt; I started Smallapack for this purpose.<br>
&gt;&gt;&gt; Smallapack interfaces BLAS+LAPACK thru FFI.<br>
&gt;&gt;&gt; Very much like numpy...<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Smallapack works quite well in VW and Dolphin...<br>
&gt;&gt;&gt; (In fact it did work very well since 1990 with st80 user primitives...)<br>
&gt;&gt;&gt; ...Unfirtunately not so in Squeak (VM crach possibly).<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; I&#39;d like to put more time in it, but so far there has not been so much interest.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Nicolas<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; 2010/6/21 Jimmie Houchin &lt;<a href="mailto:jdev@cyberhaus.us">jdev@cyberhaus.us</a>&gt;:<br>
&gt;&gt;&gt;&gt; On 6/20/2010 10:41 AM, Lawson English wrote:<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; On 6/20/10 6:08 AM, Nicolas Cellier wrote:<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; 2010/6/20 Michael Haupt&lt;<a href="mailto:mhaupt@gmail.com">mhaupt@gmail.com</a>&gt;:<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; Hi Nicolas,<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; On Sun, Jun 20, 2010 at 11:17 AM, Nicolas Cellier<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; &lt;<a href="mailto:nicolas.cellier.aka.nice@gmail.com">nicolas.cellier.aka.nice@gmail.com</a>&gt;  wrote:<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; About 8) :  True, every single operation results in memory allocation<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; / garbage collection, a burden for number crunching.<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; really?<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; There is this nice book by Didier Besset called &quot;Object-Oriented<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; Implementation of Numerical Methods. An Introduction with Java and<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; Smalltalk.: An Introduction with Java and Smalltalk&quot;. It can&#39;t be<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; *that* bad. :-)<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; Agree, &quot;not worse than Matlab&quot; was the meaning of my message.<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; My own answer was: use C/FORTRAN for optimized number crunching<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; functions. Use Smalltalk for any higher level/GUI function (via<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; DLLCC/FFI). We may have more than 1 hammer in your toolset!<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; With GPU connectivity things emerging, number crunching might even be<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; an interesting area for Smalltalk.<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; Best,<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; Michael<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; Yes, this falls in vectorizing the operations.<br>
&gt;&gt;&gt;&gt;&gt;&gt; But I would go for a GPU-BLAS implementation available to any language<br>
&gt;&gt;&gt;&gt;&gt;&gt; (Smalltalk and C as well).<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; Nicolas<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; How many parallel squeak processes would be required to = the speed of one<br>
&gt;&gt;&gt;&gt;&gt; native library for arbitrary precision math, or for other math intensive<br>
&gt;&gt;&gt;&gt;&gt; purposes?<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Lawson<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Hello,<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; I would love to be using Squeak for my financial application. Numerical<br>
&gt;&gt;&gt;&gt; performance isn&#39;t currently what is stopping me. My problem is that I<br>
&gt;&gt;&gt;&gt; require interfacing with a Windows COM dll and in a future version with a<br>
&gt;&gt;&gt;&gt; Java library. Hopefully at some point I will be able to port to Squeak. I<br>
&gt;&gt;&gt;&gt; would much prefer it to using Python, which is what I am currently using.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; I didn&#39;t even know Squeak was in the running until I discovered the Matrix<br>
&gt;&gt;&gt;&gt; class. And for what I need to do it performs reasonably adequately. However<br>
&gt;&gt;&gt;&gt; Squeak does not to my knowledge have a comprehensive collection of<br>
&gt;&gt;&gt;&gt; mathematics methods to be able to be applied to a variety of data. Currently<br>
&gt;&gt;&gt;&gt; I am using Python and Numpy which has a nicely optimized<br>
&gt;&gt;&gt;&gt; Mathematics/Scientific set of functions using optimized C/Fortran libraries.<br>
&gt;&gt;&gt;&gt; I would love to see Squeak compete in this area. In fact the Numpy people<br>
&gt;&gt;&gt;&gt; are currently refactoring the library to turn it into a C library usable by<br>
&gt;&gt;&gt;&gt; other languages.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Here is some samples from my experimentation.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Some of what I am doing is doing rolling calculations over my dataset.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; dataset is one weeks worth of OHLC data of a currency pair.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; In Squeak I have.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; ttr := [<br>
&gt;&gt;&gt;&gt;  1 to: ((m rowCount) -500) do: [:i || row rowSum rowMax rowMin rowMedian<br>
&gt;&gt;&gt;&gt; rowAverage |<br>
&gt;&gt;&gt;&gt;  row := (m atRows: i to: (499+i) columns: 5 to: 5).<br>
&gt;&gt;&gt;&gt;  rowSum := row sum.<br>
&gt;&gt;&gt;&gt;  rowMax := row max.<br>
&gt;&gt;&gt;&gt;  rowMin := row min.<br>
&gt;&gt;&gt;&gt;  rowMedian := row median.<br>
&gt;&gt;&gt;&gt;  rowAverage := row average.<br>
&gt;&gt;&gt;&gt;  omd add: {rowSum . rowMax . rowMin . rowMedian . rowAverage}]] timeToRun.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Squeak:  17 seconds,  with Cog 4.2 seconds  (nice work guys<br>
&gt;&gt;&gt;&gt; (Eliot/Teleplace)<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; In Python/Numpy I have.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; import numpy as np<br>
&gt;&gt;&gt;&gt; def speedtest(array,omd):<br>
&gt;&gt;&gt;&gt;    t1 = time.time()<br>
&gt;&gt;&gt;&gt;    for i in range(0, (len(a)-500)):<br>
&gt;&gt;&gt;&gt;        rowmax = np.max(a[&#39;bidclose&#39;][i:i+500])<br>
&gt;&gt;&gt;&gt;        rowmin = np.min(a[&#39;bidclose&#39;][i:i+500])<br>
&gt;&gt;&gt;&gt;        rowsum = np.sum(a[&#39;bidclose&#39;][i:i+500])<br>
&gt;&gt;&gt;&gt;        rowmedian = np.median(a[&#39;bidclose&#39;][i:i+500])<br>
&gt;&gt;&gt;&gt;        rowmean = np.mean(a[&#39;bidclose&#39;][i:i+500])<br>
&gt;&gt;&gt;&gt;        omd.append((rowsum, rowmax, rowmin, rowmedian, rowmean))<br>
&gt;&gt;&gt;&gt;    return time.time()-t1<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Python:  .7 seconds<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Python/Numpy performs well, is reasonably nice to work with. But I would<br>
&gt;&gt;&gt;&gt; give up the performance to be able to use Squeak. The live environment and<br>
&gt;&gt;&gt;&gt; debugging would be invaluable for experimentation.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Hopefully this will give you some idea.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Jimmie<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;<br>
<br>
</div></div></blockquote></div><br>