Hi all,
Is there any project which deals with an implementation of ruby into
Microsoft’s .NET plattform?
Markus Hahn wrote:
Is there any project which deals with an implementation of ruby into
Microsoft’s .NET plattform?
Not really. There have been talk of .NET interfaces for the interpreter.
If you want to re-implement Ruby in .NET then maybe you could leverage
some of our work with JRuby. Also have a look at the experiments people
have done with Python on .NET.
/Anders
···
–
A n d e r s B e n g t s s o n | ndrsbngtssn@yahoo.se
Stockholm, Sweden |
Gratis e-mail resten av livet på www.yahoo.se/mail
Busenkelt!
Hi all,
Is there any project which deals with an implementation of ruby into
Microsoft’s .NET plattform?
Sort of. There is NETRuby
http://www.geocities.co.jp/SiliconValley-PaloAlto/9251/ruby/nrb.html
which is the Ruby interpreter ported to C#.
The documentation is sparse, and mostly in Japanese.
I’ve managed to build the source using VS.net, but have encountered problems
running example code.
James
I’m afraid NET framework does not support some concepts like mixing or
extending objects. But I’m now writing a Ruby module loading NET framework
into Ruby (not Ruby to NET!) and marshalling calls to the NET framework. So
one could use NET classes as Ruby ones. But exposing Ruby classes to NET as
well as mixing NET and Ruby or NET and NET classes and objects seems being
difficult.
Aleksei Guzev
JamesBritt wrote:
Sort of. There is NETRuby
which is the Ruby interpreter ported to C#.
Cool, I had no idea about this!
The documentation is sparse, and mostly in Japanese.
I’ve managed to build the source using VS.net, but have encountered problems
running example code.
Yet another victim of the language divide. I guess I’ll just have to get
myself a C# compiler and see how it works.
/Anders
···
–
A n d e r s B e n g t s s o n | ndrsbngtssn@yahoo.se
Stockholm, Sweden |
Gratis e-mail resten av livet på www.yahoo.se/mail
Busenkelt!
Hello Anders,
Wednesday, November 13, 2002, 5:12:32 PM, you wrote:
Is there any project which deals with an implementation of ruby
into Microsoft’s .NET plattform?
Not really.
i seen alpha version of ruby interpreter translated to C#. afair, it
is on yaraa
···
–
Best regards,
Bulat mailto:bulatz@integ.ru
“Aleksei Guzev” aleksei.guzev@bigfoot.com wrote in message
news:aqvds0$d6ono$1@ID-167200.news.dfncis.de…
I’m afraid NET framework does not support some concepts like mixing or
extending objects. But I’m now writing a Ruby module loading NET framework
into Ruby (not Ruby to NET!) and marshalling calls to the NET framework.
So
one could use NET classes as Ruby ones. But exposing Ruby classes to NET
as
well as mixing NET and Ruby or NET and NET classes and objects seems being
difficult.
C# has got and indexer method. This goes back to COM where you can write
myobject.mymember
as if mymember was a member of myobject. In reality, myobject.mymember is
defined as myobject.item(“mymember”). So it’s sort of Ruby’s method_missing.
Also note that indexers can have parameters: myobject.myothermember(2) = 3.
You can implement Ruby in whatever way in dot net. The interesting part is
how other languages access members. If a Ruby object is just a dot not
object with an indexer method, I think you can cover most issues.
It’s a misconception that dot net is necessarily statically typed, but
obviously you can represent a dynamic Ruby class directly as a typed dot net
class.
dot net needs to interoperate with COM objects. COM objects are sometimes
only exposed via IDistpatch, which is a runtime access interface where you
can query a function by name and subsequently call it. While dot not is not
COM clearly some of the same principles must apply to Ruby. Note how
IDispatch is used to integrate COM objects in Ruby (and there’s also a
stalled project making Ruby objects COM objects also relying on IDispatch).
Mikkel
I’ve managed to build the source using VS.net, but have encountered problems
running example code.Yet another victim of the language divide. I guess I’ll just have to get
myself a C# compiler and see how it works.
I suspect NETRuby was done with Mono in mind (the web pages refer to jay, which
is part of mono). I used vs.net because I’ve had problems getting mono going
Rotor might work, too.
James
···
/Anders
–
A n d e r s B e n g t s s o n | ndrsbngtssn@yahoo.se
Stockholm, Sweden |
Gratis e-mail resten av livet på www.yahoo.se/mail
Busenkelt!
Hello!
Maybe mono can compile it.
s
Pablo
···
Em Qua 13 Nov 2002 14:08, Anders Bengtsson escreveu:
JamesBritt wrote:
Sort of. There is NETRuby
which is the Ruby interpreter ported to C#.
Cool, I had no idea about this!
The documentation is sparse, and mostly in Japanese.
I’ve managed to build the source using VS.net, but have encountered
problems running example code.Yet another victim of the language divide. I guess I’ll just have to get
myself a C# compiler and see how it works./Anders
–
Pablo Lorenzzoni (Spectra) spectra@debian.org
GnuPG Key ID 268A084D at search.keyserver.net
Webpage: http://people.debian.org/~spectra/
All that’s why I say there is a way to bridge from Ruby to .NET. But Ruby
cannot be integrated to .NET tightly. One cannot compile Ruby into IL, Ruby
class cannot be a .NET class, and Ruby object cannot be a .NET object. They
could have some kind of proxies, not more.
“Aleksei Guzev” aleksei.guzev@bigfoot.com wrote in message
news:ar1srm$egbvp$1@ID-167200.news.dfncis.de…
All that’s why I say there is a way to bridge from Ruby to .NET. But Ruby
cannot be integrated to .NET tightly. One cannot compile Ruby into IL,
Ruby
class cannot be a .NET class, and Ruby object cannot be a .NET object.
They
could have some kind of proxies, not more.
You can compile Ruby into IL but the objects will just be objects. The main
difference between this and interop is that there would be no separate
interpreter with separate memory management.
Mikkel
“MikkelFJ” mikkelfj-anti-spam@bigfoot.com wrote in message
news:3dd55e48$0$35977$edfadb0f@dread13.news.tele.dk…
You can compile Ruby into IL but the objects will just be objects. The
main
difference between this and interop is that there would be no separate
interpreter with separate memory management.
Whould you give some example, please. For instance a peace of IL
implementing adding a singleton method to a .NET object.
“Aleksei Guzev” aleksei.guzev@bigfoot.com wrote in message
news:ar9qtj$fq9up$1@ID-167200.news.dfncis.de…
“MikkelFJ” mikkelfj-anti-spam@bigfoot.com wrote in message
news:3dd55e48$0$35977$edfadb0f@dread13.news.tele.dk…You can compile Ruby into IL but the objects will just be objects. The
main
difference between this and interop is that there would be no separate
interpreter with separate memory management.Whould you give some example, please. For instance a peace of IL
implementing adding a singleton method to a .NET object.
Considering the time I would need to this, I’d rather not - not unless I
actually planned to do a Ruby implementation in .NET - I certainly have been
tempted many times - I’ve just got too many other projects.
But a hash based class layout instead of a vtable based class layout would
deal with such issues. Obviously the tables would need to be chained somehow
to handle object specialization.
You can make it as fancy as you like - for instance optimized branching code
for classes where you assume it is defined once then never modified - and
disable that feature when you discover you were wrong.
The main point is that whatever lookup method you choose, the public
interface of a Ruby class would be the Item method or perhaps there is a
more advanced way to intercept dynamic method lookups as I’m not that much
into the details of .NET.
What matters is that you can treat it as an object in other .NET languages
with respect to storing references and calling methods.
JScript and VBScript runs .NET and you can say any of these languages are
big on static typing.
Mikkel