From thenouse at gmail.com Tue Nov 2 22:04:34 2004 From: thenouse at gmail.com (Nouse) Date: Tue Nov 2 22:04:47 2004 Subject: [Yarv-devel] nmake test fails on Windows XP(Home) In-Reply-To: <20041101123417.538a89%ko1@atdot.net> References: <4164B507.1010102@everestkc.net> <4166962D.2040402@everestkc.net> <20041009000957.3020137%ko1@atdot.net> <416AC6EC.4090100@everestkc.net> <4f3bba060410120025771ba366@mail.gmail.com> <20041013144932.3fcec7%ko1@atdot.net> <4f3bba0604101300004c711c4b@mail.gmail.com> <20041025200530.164587c%ko1@atdot.net> <4f3bba060410260034d004880@mail.gmail.com> <20041101123417.538a89%ko1@atdot.net> Message-ID: <4f3bba0604110219045251cbc6@mail.gmail.com> I tried it again and it works! Regards, Nouse On Mon, 01 Nov 2004 12:34:17 +0900, SASADA Koichi wrote: > Nouse wrote : > [ Re: [Yarv-devel] nmake test fails on Windows XP(Home) ] > at Tue, 26 Oct 2004 00:34:43 -0700 > > Hi, > > I (maybe) fixed that :) > > "test" target name changed to "test-all". > > Thanks, > -- > // SASADA Koichi at atdot dot net > // > > > -- original message > -- > > > > The execption test still crashes on my machine. I tried it with both > > my old version of ruby 1.9 and then the latest version ruby 1.9. Im > > using VC7.1, so it may be a special problem related to that compiler > > :) > > > > I believe the changes above to vm.c and eval.c address this problem. > > My patch above is really for two problems: > > > > - ruby_iter getting set to a bad value (during a rescue?), and then > > being dereferenced. This is the crash im still getting. > > - a crash on garbage collection during exception processing. This is > > the crash you fixed. > > > > Hope this helps some, > > Nouse > > > > P.S here's the stack trace: > > msvcrt-ruby19.dll!rb_call0() Line 5471 + 0x5 C > > msvcrt-ruby19.dll!rb_call(unsigned long klass=44607848, unsigned > > long recv=44589200, unsigned long mid=3377, int argc=1, const unsigned > > long * argv=0x024023f4, int scope=1) Line 5745 + 0x28 C > > msvcrt-ruby19.dll!rb_funcall(unsigned long recv=44589200, unsigned > > long mid=3377, int n=1, ...) Line 5828 + 0x93 C > > msvcrt-ruby19.dll!rb_exc_new3(unsigned long etype=44589200, unsigned > > long str=45955824) Line 338 + 0x1d C > > msvcrt-ruby19.dll!rb_make_exception(int argc=1, unsigned long * > > argv=0x02ed0094) Line 4406 + 0x12 C > > msvcrt-ruby19.dll!rb_f_raise() Line 4385 + 0xd C > > yarvcore.so!call_cfunc() Line 201 + 0x11 C > > > > > > On Mon, 25 Oct 2004 20:05:30 +0900, SASADA Koichi wrote: > >> Nouse wrote : > >> [ Re: [Yarv-devel] nmake test fails on Windows XP(Home) ] > >> at Wed, 13 Oct 2004 00:00:40 -0700 > >> > >> Hi, > >> > >> > unitialized variables). When you put in your fix, I'll check it again > >> > to make sure works with vc++. > >> > >> Sorry for late response, I commit fixed version. Could you try that? > >> ( only add 3 lines ^^; ) > >> > >> > >> > >> Regards, > >> -- > >> // SASADA Koichi at atdot dot net > >> // > >> > > > > From sdate at everestkc.net Tue Nov 2 23:34:57 2004 From: sdate at everestkc.net (Shashank Date) Date: Tue Nov 2 23:35:10 2004 Subject: [Yarv-devel] nmake test fails on Windows XP(Home) In-Reply-To: <4f3bba0604110219045251cbc6@mail.gmail.com> References: <4164B507.1010102@everestkc.net> <4166962D.2040402@everestkc.net> <20041009000957.3020137%ko1@atdot.net> <416AC6EC.4090100@everestkc.net> <4f3bba060410120025771ba366@mail.gmail.com> <20041013144932.3fcec7%ko1@atdot.net> <4f3bba0604101300004c711c4b@mail.gmail.com> <20041025200530.164587c%ko1@atdot.net> <4f3bba060410260034d004880@mail.gmail.com> <20041101123417.538a89%ko1@atdot.net> <4f3bba0604110219045251cbc6@mail.gmail.com> Message-ID: <41885FF1.4050002@everestkc.net> Hi, Nouse wrote: >I tried it again and it works! > >Regards, >Nouse > > I was able to compile and run the benchmark tests too ! This is on Win XP (Home) using 10/4 nightly snapshot of ruby and the latest version of YARV (revision 53) compiled using mswin VC ++ 6.0. Very encouraging. Thanks, -- Shashank From rubyroid2000-yarv at yahoo.com Tue Nov 23 02:20:04 2004 From: rubyroid2000-yarv at yahoo.com (Kent Sibilev) Date: Tue Nov 23 02:19:32 2004 Subject: [Yarv-devel] Calling YARV from within Ruby Message-ID: <20041123072004.91448.qmail@web60909.mail.yahoo.com> playing with YARV and I can tell it's a very promising Ruby VM. In the current state, it seems impossible to call YARV bytecode from within Ruby. For example, $ cat t.rb class A def initialize puts 'ok' end end A.new $ ruby t.rb ok $ ruby -ryarvutil -e 'YARVUtil.eval(File.read("t.rb"), "t", 1)' t:8: [BUG] unknown node type 95 ruby 1.9.0 (2004-11-23) [powerpc-darwin7.6.0] Abort trap Does it mean that eval.c file has to be patched to make it work? Cheers, Kent. From ko1 at atdot.net Tue Nov 23 03:01:20 2004 From: ko1 at atdot.net (SASADA Koichi) Date: Tue Nov 23 03:01:42 2004 Subject: [Yarv-devel] Calling YARV from within Ruby In-Reply-To: <20041123072004.91448.qmail@web60909.mail.yahoo.com> References: <20041123072004.91448.qmail@web60909.mail.yahoo.com> Message-ID: <41A2EE50.6010408@atdot.net> Hi, > playing with YARV and I can tell it's a very > promising Ruby VM. Thanks :) > In the current state, it seems impossible to call YARV > bytecode from within Ruby. For example, (snip) > Does it mean that eval.c file has to be patched to > make it work? Yes. Calling method defined in YARV from C function is impossible. I will write patch for eval.c. Thanks, From ko1 at atdot.net Tue Nov 30 02:33:02 2004 From: ko1 at atdot.net (SASADA Koichi) Date: Tue Nov 30 02:33:12 2004 Subject: [Yarv-devel] Calling YARV from within Ruby In-Reply-To: <20041123072004.91448.qmail@web60909.mail.yahoo.com> References: <20041123072004.91448.qmail@web60909.mail.yahoo.com> Message-ID: <41AC222E.70708@atdot.net> Hi, Kent Sibilev wrote: > playing with YARV and I can tell it's a very > promising Ruby VM. > In the current state, it seems impossible to call YARV > bytecode from within Ruby. For example, I supported it :) (and provide much more patch http://www.atdot.net/svn/yarv/trunk/evalc.patch ) BTW, does anyone have scripts for benchmark? I already use Language Shootout examples, but they are too simple. *) The Computer Language Shootout Benchmarks http://shootout.alioth.debian.org/ Regards, From rubyroid2000-yarv at yahoo.com Tue Nov 30 10:12:08 2004 From: rubyroid2000-yarv at yahoo.com (Kent Sibilev) Date: Tue Nov 30 10:11:21 2004 Subject: [Yarv-devel] Calling YARV from within Ruby In-Reply-To: <41AC222E.70708@atdot.net> Message-ID: <20041130151208.88878.qmail@web60906.mail.yahoo.com> Very nice. You are getting close! :-) As far as I can see currently it is impossible to access a variable defined in the outer scope from inside the block: $ cat t.rb i = 0 (1..10).each do |i| puts i end $ ruby -ryarvutil -e 'YARVUtil.eval(File.read("t.rb"), "t", 1)' t:6: [BUG] block parameter must be NODE_MASGN or NODE_DASGN_CURR(NODE_LASGN) ruby 1.9.0 (2004-11-30) [powerpc-darwin7.6.0] Abort trap There are still some node type that are not supported yet, e.g. NODE_SUPER, NODE_ZSUPER. But all in all you are making a good progress and my benchmarks are encouraging. BTW, during compassion to the bytecode the '+' method gets converted to opt_plus bytecode. But this bytecode works only with Fixnum arguments and it fails if given arguments of some other types. Is it possible to delegate to generic '+' method in the case like this: $ cat t1.rb i = 123123123123 puts(i + 1) $ ruby -ryarvutil -e 'YARVUtil.eval(File.read("t1.rb"), "t1", 1)' t1:3: [BUG] unsupport + method ruby 1.9.0 (2004-11-30) [powerpc-darwin7.6.0] Abort trap Cheers, kent --- SASADA Koichi wrote: > Hi, > > Kent Sibilev wrote: > > playing with YARV and I can tell it's a very > > promising Ruby VM. > > In the current state, it seems impossible to call > YARV > > bytecode from within Ruby. For example, > > I supported it :) > (and provide much more patch > http://www.atdot.net/svn/yarv/trunk/evalc.patch ) > > > BTW, does anyone have scripts for benchmark? > I already use Language Shootout examples, but they > are too simple. > > *) The Computer Language Shootout Benchmarks > http://shootout.alioth.debian.org/ > > > Regards, > From ko1 at atdot.net Tue Nov 30 10:26:56 2004 From: ko1 at atdot.net (SASADA Koichi) Date: Tue Nov 30 10:28:06 2004 Subject: [Yarv-devel] Calling YARV from within Ruby In-Reply-To: <20041130151208.88878.qmail@web60906.mail.yahoo.com> References: <20041130151208.88878.qmail@web60906.mail.yahoo.com> Message-ID: <41AC9140.8080501@atdot.net> Hi, > As far as I can see currently it is impossible to > access a variable defined in the outer scope from > inside the block: > > $ cat t.rb > i = 0 > (1..10).each do |i| > puts i > end > $ ruby -ryarvutil -e 'YARVUtil.eval(File.read("t.rb"), > "t", 1)' > t:6: [BUG] block parameter must be NODE_MASGN or > NODE_DASGN_CURR(NODE_LASGN) > ruby 1.9.0 (2004-11-30) [powerpc-darwin7.6.0] > > Abort trap Yes. Ruby2.0's specification will be changed about block local parameter. Second "i" at block parameter will be block local parameter (different variable from first "i"). Or will be error :) (duplicate local and block local parameter) > There are still some node type that are not supported > yet, e.g. NODE_SUPER, NODE_ZSUPER. Yes. I don't support it. It's not very difficult but it will take more time to impliment. > But all in all you are making a good progress and my > benchmarks are encouraging. Do you have benchmarks? > BTW, during compassion to the bytecode the '+' method > gets converted to opt_plus bytecode. But this bytecode > works only with Fixnum arguments and it fails if given > arguments of some other types. Is it possible to > delegate to generic '+' method in the case like this: Yes. It's YARV's current specification :-P (so I can't do that: "abc" + "def") Regards, -- // SASADA Koichi at atdot dot net // From rubyroid2000-yarv at yahoo.com Tue Nov 30 12:49:07 2004 From: rubyroid2000-yarv at yahoo.com (Kent Sibilev) Date: Tue Nov 30 12:48:19 2004 Subject: [Yarv-devel] Calling YARV from within Ruby In-Reply-To: <41AC9140.8080501@atdot.net> Message-ID: <20041130174907.63151.qmail@web60908.mail.yahoo.com> > > Yes. Ruby2.0's specification will be changed about > block local > parameter. Second "i" at block parameter will be > block local > parameter (different variable from first "i"). Or > will be > error :) (duplicate local and block local parameter) Oh, yes I remember Matz mentioned it. I have to revisit his presentation about upcoming Ruby2 changes. > > > > There are still some node type that are not > supported > > yet, e.g. NODE_SUPER, NODE_ZSUPER. > > Yes. I don't support it. It's not very difficult but > it will > take more time to impliment. > Impatiently waiting for it :-P > > > But all in all you are making a good progress and > my > > benchmarks are encouraging. > > Do you have benchmarks? Unfortunately, I don't have anything handy, but the real test would be to run it against some existing Ruby libraries, for example the pure Ruby implementation of the mysql extension. > Yes. It's YARV's current specification :-P > (so I can't do that: "abc" + "def") Hm, is it something you're going to change? Cheers, kent From ko1 at atdot.net Tue Nov 30 18:51:48 2004 From: ko1 at atdot.net (SASADA Koichi) Date: Tue Nov 30 18:52:54 2004 Subject: [Yarv-devel] Calling YARV from within Ruby In-Reply-To: <20041130174907.63151.qmail@web60908.mail.yahoo.com> References: <20041130174907.63151.qmail@web60908.mail.yahoo.com> Message-ID: <41AD0793.3090100@atdot.net> Hi, > Unfortunately, I don't have anything handy, but the > real test would be to run it against some existing > Ruby libraries, for example the pure Ruby > implementation of the mysql extension. Currently, "require" (or "load") is not supported so you must try with all files concatenating and eval with YARV. >>Yes. It's YARV's current specification :-P >>(so I can't do that: "abc" + "def") > > > Hm, is it something you're going to change? I supported it now. But due to too complex control flow, slow down 5%. ("goto" in opt_plus to "send" insn) -- // SASADA Koichi at atdot dot net //