[jvm-l] Re: avoiding boxing

2008-05-01 Thread John Wilson
On 5/1/08, Jochen Theodorou [EMAIL PROTECTED] wrote: Charles Oliver Nutter schrieb: Jochen Theodorou wrote: [...] ok, let me try to explain what I think of... The current system in Groovy works like this: you have a narrow API, with some core that actually selects and executes the

[jvm-l] Re: avoiding boxing

2008-05-01 Thread Jochen Theodorou
John Wilson schrieb: On 5/1/08, Jochen Theodorou [EMAIL PROTECTED] wrote: Charles Oliver Nutter schrieb: Jochen Theodorou wrote: [...] ok, let me try to explain what I think of... The current system in Groovy works like this: you have a narrow API, with some core that actually selects

[jvm-l] Re: avoiding boxing

2008-05-01 Thread Jochen Theodorou
Charles Oliver Nutter schrieb: [...] - JRuby currently doesn't do multihosting using the classloader hierarchy; instead, we have a simple org.jruby.Ruby object that represents a given runtime. This means we pass Ruby through most stacks to get at things like Fixnum caches. Statics are most

[jvm-l] Re: avoiding boxing

2008-05-01 Thread Charles Oliver Nutter
John Rose wrote: Or (I don't know if it could be made to work, but it's worth thinking about) method handles could interoperate more tightly with closures, by having each individual method handle somehow take on the appropriate function interface type. I think this could lead to some kind

[jvm-l] Re: avoiding boxing

2008-05-01 Thread Rémi Forax
Charles Oliver Nutter a écrit : John Rose wrote: Or (I don't know if it could be made to work, but it's worth thinking about) method handles could interoperate more tightly with closures, by having each individual method handle somehow take on the appropriate function interface type.

[jvm-l] Re: avoiding boxing

2008-04-30 Thread Jochen Theodorou
Attila Szegedi schrieb: On 2008.04.30., at 11:49, Jochen Theodorou wrote: Rich Hickey schrieb: On Apr 29, 5:36 pm, Jochen Theodorou [EMAIL PROTECTED] wrote: [...] I think the answer is tags, as John Rose discussed here: http://blogs.sun.com/jrose/entry/fixnums_in_the_vm That, standard

[jvm-l] Re: avoiding boxing

2008-04-30 Thread John Wilson
On 4/30/08, Attila Szegedi [EMAIL PROTECTED] wrote: On 2008.04.30., at 11:49, Jochen Theodorou wrote: Rich Hickey schrieb: On Apr 29, 5:36 pm, Jochen Theodorou [EMAIL PROTECTED] wrote: [...] I think the answer is tags, as John Rose discussed here:

[jvm-l] Re: avoiding boxing

2008-04-30 Thread John Rose
On Apr 30, 2008, at 6:37 AM, John Wilson wrote: On 4/30/08, Attila Szegedi [EMAIL PROTECTED] wrote: On 2008.04.30., at 11:49, Jochen Theodorou wrote: I don't see how this will help me in Groovy. We use the Java types, so there is no need to represent a 20 bit integer. It doesn't help

[jvm-l] Re: avoiding boxing

2008-04-30 Thread Attila Szegedi
On 2008.04.30., at 20:59, John Rose wrote: On Apr 30, 2008, at 6:37 AM, John Wilson wrote: I'm rather unsure about the value of making changes like this to the JVM. The timescale from now to when they become useable is rather long (2-3 years to get into a released JVM then another 2-3

[jvm-l] Re: avoiding boxing

2008-04-30 Thread Charles Oliver Nutter
Jochen Theodorou wrote: Charles Oliver Nutter schrieb: [...] I see... maybe the JRuby problem is just very different from the Groovy problem here Well, not really...you box all arguments in arrays too, and you're paying a cost for that. Whether that cost is measurable in the face of

[jvm-l] Re: avoiding boxing

2008-04-29 Thread John Cowan
On Tue, Apr 29, 2008 at 5:36 PM, Jochen Theodorou [EMAIL PROTECTED] wrote: I wanted to collect a bit data to how you avoid boxing in your language implementations. My language provides bignums and flonums, which I simply represent as BigIntegers and Doubles. I pay the boxing penalty, but

[jvm-l] Re: avoiding boxing

2008-04-29 Thread Charles Oliver Nutter
A few JRuby techniques to reduce argument boxing: * We have specific-arity call paths for up to three arguments and with or without a block. The compiler calls one of those when it can do so, and calls the default [] version otherwise. This means that from the call site down, there's 10 paths

[jvm-l] Re: avoiding boxing

2008-04-29 Thread Jochen Theodorou
John Cowan schrieb: On Tue, Apr 29, 2008 at 5:36 PM, Jochen Theodorou [EMAIL PROTECTED] wrote: I wanted to collect a bit data to how you avoid boxing in your language implementations. My language provides bignums and flonums, which I simply represent as BigIntegers and Doubles. I pay

[jvm-l] Re: avoiding boxing

2008-04-29 Thread Jochen Theodorou
Jochen Theodorou schrieb: [...] well in case of adding two ints I get numbers telling me the factor is more 20, then 2.5. I take that back, I overlooked a decimal... so it is more like 200 than 2.5 here. At last with jdk 1.6 and standard BigInteger. That also means it is much worse than

[jvm-l] Re: avoiding boxing

2008-04-29 Thread Jochen Theodorou
Charles Oliver Nutter schrieb: A few JRuby techniques to reduce argument boxing: * We have specific-arity call paths for up to three arguments and with or without a block. The compiler calls one of those when it can do so, and calls the default [] version otherwise. This means that from

[jvm-l] Re: avoiding boxing

2008-04-29 Thread Rich Hickey
On Apr 29, 5:36 pm, Jochen Theodorou [EMAIL PROTECTED] wrote: Hi all, I wanted to collect a bit data to how you avoid boxing in your language implementations. I am asking because currently Groovy makes lots of calls via Reflection, and that means creating for each call an Object[],