sorry for the typos…corrected:
On Jan 29, 2014, at 5:56 AM, Frank Shearar frank.shearar@gmail.com wrote:
On 29 January 2014 12:23, Robert Withers robert.w.withers@gmail.com wrote:
Exactly, I am suggesting doing inferencing at runtime. Instead of locking those types down, at compile time, be able to do the message send Smalltalk wise, then JIT it to be typed. So dynamically switched from dynamic late-binding typing, to an early typing, with the optimizations.
I figured it could useful to type at runtime, but if it is not needed...
Oh, I see. The mention of Scala threw me off to thinking you specifically meant Hindley-Milner, as opposed to, say, k-CFA.I think I asked Eliot about this before: I wanted to know if the VM could expose the types of a particular call site to the image, so that tools could say "after the test suite ran, this method here at this call site is sent to Number", or similar.
I only know functional a little. I still can’t think functionally; I think objects, but dynamic objects instead of those pojos, DOA. I do think the details of the type systems is interesting. Specifically, what I wanted to do in a typed (though inferenced) language, is to address the need for a wrapper proxy on an eventual ref. One reason we need a wrapper is no reference mutations are allowed on the JVM. If we build Java support in Cog, we can change the mutation policy.
The other reason is that I wanted the returned promise to be typed as the real return and let the inferencer do its thing and rewrite send sites from dynamic lookup to direct calls. I was told that Hindley-Milner was what I wanted. *shrug*
Getting to the type info at runtime is key, I think. Aren’t there 2 types of type systems? Type vs class? Do you or anyone know about that?
The strategy behind my request is to see if Cog could support multiple languages and modern languages - i.e. broadly used languages. It seems a dynamic runtime is better than a static vm to support both flavors of languages, though runtime feedback type inferencing seems important, in my gut. Maybe it is just cool tech, great for ops.
- Robert