<div dir="ltr">Hi Rob,<div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jan 28, 2014 at 8:15 PM, Rob Withers <span dir="ltr">&lt;<a href="mailto:robert.w.withers@gmail.com" target="_blank">robert.w.withers@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="auto"><div>Ok, I&#39;m Robert, for professional reasons and done. &nbsp;Charlie Robert is my nickname from long time back. &nbsp;So let me stick to this email address...<br>
</div><div class="im"><div><br>On Jan 28, 2014, at 1:54 PM, Eliot Miranda &lt;<a href="mailto:eliot.miranda@gmail.com" target="_blank">eliot.miranda@gmail.com</a>&gt; wrote:<br><br></div><blockquote type="cite"><div><div dir="ltr">
Hi Charlie,<div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jan 24, 2014 at 9:11 PM, charlie robert <span dir="ltr">&lt;<a href="mailto:charlie.robert@icloud.com" target="_blank">charlie.robert@icloud.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word">I was curious whether java may be used in Cog. &nbsp;I recall a fair project with the serialization and core pojo representation, but my memory &nbsp; Might java interoperate natively, so as to call a java function in smalltalk, as a smalltalk call with a closure/continuation, or perhaps in the other direction? </div>

</blockquote><div><br></div><div>I&#39;m sure one can write a Smalltalk/Java interconnect. &nbsp;There are a number of ways to do it. &nbsp;What are your requirements? &nbsp;What do you mean by &quot;native&quot; operation? &nbsp;e.g. VisualAgeForJava?</div>
</div></div></div></div></blockquote><div><br></div></div>My requirements, hmm. &nbsp;&nbsp;<div><br></div><div>1 - I would like to have .class files able to load in your VM/ObjectMemory. &nbsp;</div><div>2 - I would like java byte codes &quot;JITted&quot; into Smalltalk byte codes. &nbsp;</div>
<div>3 - I would like if one side (squeak) could invoke the other side (java) without explicit wrappers, and vice versa. &nbsp;I mean this as native.</div><div>4 - I would like java serialization support.&nbsp;</div><div>5 - like JVM 8 has a byte code for reflective lookup, I would like Smalltalk bytecodes to have one bytecode for direct invocation, and bypass the reflective meta call</div>
<div>6 - I want to run scala on Cog/Spur</div><div>7 - then the &quot;JIT&quot;...I would like the program to start in dynamic mode then &quot;JIT&quot; with a call to the inferencer to determine type.</div><div><br></div>
<div>This way, we have a JVM with mutable refs (become) so it would be a JVM++.<br><div><br></div><div>The thing that gets me is that barely anything really interoperates.</div></div></div></blockquote><div><br></div><div>
Have you had a look at Smalltalk/X? &nbsp;They have a compiled method format that allows up to four distinct bytecode sets and one of these is Java. &nbsp;So they may have a lot of what you want (which is doable, but a substantial project with duration I estimate in the in the 2-5 person-years range) &nbsp;.</div>
<div><br></div><div>To better understand your underlying motivations could you state what&#39;s unsatisfactory about running scala on Java VMs? &nbsp;(and in language that a neophyte like me can understand? &nbsp;I know Java a little and more about Java VMs but I don&#39;t know scala).</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="auto"><div><div class="im"><blockquote type="cite">
<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word">&nbsp;COudl a scala type inferencer be built in Spur&rsquo;s runtime? runtime?</div>

</blockquote><div><br></div><div>I&#39;m not sure what you mean. &nbsp;Could you elaborate? &nbsp;Spur is an object representation and set of garbage collection/memory management facilities. &nbsp;As such wouldn&#39;t it live below any type inferencer?</div>
</div></div></div></blockquote><div><br></div></div>Ok it is the inner Cog axle I think of, not Spur. &nbsp;The lookup and invocation of a send, of a method. &nbsp;At its root handler it could call an inline scala type inferencer.</div>
</div></blockquote><div><br></div><div>[I&#39;ve read ahead to the exchange between you and Frank Shearer so I&#39;m chearting here. &nbsp;It helped a lot].</div><div><br></div><div>Fascinating.</div><div><br></div><div>So the issue is that on the Smalltalk side there&#39;s dynamic typing and on the java/scala side there&#39;s static typing right? &nbsp;And you want to check the call for type safety at the time of call and allow it to proceed if safe? &nbsp;My immediate reaction is that down in the VM is far too low-level a place to implement this, quite complex, functionality. &nbsp;Implementing it in Smalltalk in some sort of wrapper class for scala/java objects allows you lots of freedom in implementation, cacheing previous results, and not least efficient development; implementing at the VM level is alas slow, even in the simulator.</div>
<div><br></div><div>Is there a necessity to push it down to the VM level?</div><div><br></div><div>Wouldn&#39;t it make more sense to get a working system at the Smalltalk level and then push this down once the design was fully determined and you&#39;d profiled?</div>
<div><span style="color:rgb(80,0,80)">&nbsp;</span></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="auto">
<div><div class="im"><blockquote type="cite"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div style="word-wrap:break-word"><div>Eliot, I am quite intrigued on your blog post on Spur&rsquo;s object stack representation. &nbsp;Does this format touch on the heap structure of an object?</div>
</div></blockquote><div><br></div><div>What exactly do you mean by &quot;Spur&rsquo;s object stack representation&quot;? &nbsp;Do you mean Spur&#39;s object representation, or do you mean the ObjStack datatype? &nbsp;The latter is merely a segmented stack, like building OrderedCollection out of a linked list of pages, each page containing up to N elements.</div>

<div>&nbsp;</div></div></div></div></blockquote><div><br></div></div>So Spur specifies heap structure? &nbsp;</div></div></blockquote><div><br></div><div>Right. &nbsp;Sista, which is being worked on mostly by Clément Bera, is the name we&#39;ve given to Cog&#39;s support for adaptive optimization and speculative inlining (Sista = Speculative Inlining Small talk Architecture). &nbsp;One part of the VM infrastructure for Sista is a primitive that yields the satte of the inline caches in a method. &nbsp;That&#39;s I suspect the kind of type informaiton youre after. &nbsp;Am I right?</div>
<div>&nbsp;</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="auto"><div>Vis-a-Vis the lack of interoperability, Cap&#39;n Proto would be just the thing to interoperate java and squeak and scala and groovy. &nbsp; You own the metal so you can do whatever you imagine.</div>
</div></blockquote><div><br></div><div>Right.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div dir="auto"><div><div class="im"><blockquote type="cite"><div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div style="word-wrap:break-word"><div> &nbsp;Either way, using Cap&rsquo;n Proto in the heap and Spur for the stack/queue structures would be really nice if someone had one. &nbsp;Does a lord or lady own such a magic item +4? &nbsp;on a raspberry?<br>

</div></div></blockquote><div><br></div><div><a href="https://plus.google.com/+KentonVarda/posts/GRJ4h4w2UN9" target="_blank">https://plus.google.com/+KentonVarda/posts/GRJ4h4w2UN9</a>? &nbsp;Or am I being cynical?</div></div>
</div></div></div></blockquote><div><br></div></div>I am missing all this, &#39;cuse me &#39;</div></div></blockquote><div><br></div><div>Your initial post went rather over my head and I thought perhaps you were pulling my chain. &nbsp;I googled Cap&#39;n Proto and saw &quot;Cap&#39;n Proto april fool&quot; and thought that I might be being led down the path :-). &nbsp;I can see now that&#39;s far from the case. &nbsp;Forgive me.</div>
<div>&nbsp;</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="auto"><div>Indeed, best,<br></div><div>
Robert</div><div class="im"><blockquote type="cite"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<div style="word-wrap:break-word"><div></div><div><div>so sorry for all that noise ,<br></div><div><div>
<div style="text-indent:0px;letter-spacing:normal;text-align:start;text-transform:none;white-space:normal;word-wrap:break-word;word-spacing:0px"><div style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:start;font-style:normal;font-weight:normal;line-height:normal;text-transform:none;font-size:12px;white-space:normal;font-family:Helvetica;word-spacing:0px">

- charlie (Rob WIthers)</div></div></div></div></div></div></blockquote></div><div><br></div>-- <br>best,<div>Eliot</div></div></div></blockquote><blockquote type="cite"><div><span></span></div></blockquote></div></div></blockquote>
</div><div><br></div>-- <br>best,<div>Eliot</div>
</div></div>