[#18974] Perl/Python/Ruby common backend (Perl6) — ptkwt@...1.aracnet.com (Phil Tomson)

There is a thread about using .NET's CLR as a backend for Ruby, but how

17 messages 2001/08/01

[#19064] ANN: Code Amelioration Contest (presented by Ruby Conference 2001) — David Alan Black <dblack@...>

17 messages 2001/08/03
[#19184] Re: ANN: Code Amelioration Contest (presented by Ruby Conference 2001) — John Carter <john.carter@...> 2001/08/06

On Fri, 3 Aug 2001, David Alan Black wrote:

[#19185] Re: ANN: Code Amelioration Contest (presented by Ruby Conference 2001) — David Alan Black <dblack@...> 2001/08/06

Hello --

[#19186] Re: ANN: Code Amelioration Contest (presented by Ruby Conference 2001) — John Carter <john.carter@...> 2001/08/06

On Mon, 6 Aug 2001, David Alan Black wrote:

[#19125] My 1st look @ ruby: No prototypes and problem with String#gsub — stesch@... (Stefan Scholl)

My first ruby program:

23 messages 2001/08/04

[#19192] Some remarks from a nembie in Ruby — Renaud HEBERT <renaud.hebert@...>

After having read the book "Programming Ruby: The Pragmatic Programmer's

38 messages 2001/08/06

[#19269] Re: Perl/Python/Ruby common backend (Parrot, can Ruby play too?) — ptkwt@...1.aracnet.com (Phil Tomson)

In article <72X97.12093$9i1.972452@e420r-atl1.usenetserver.com>,

50 messages 2001/08/07
[#19349] Re: Perl/Python/Ruby common backend (Parrot, can Ruby play too?) — Mathieu Bouchard <matju@...> 2001/08/08

[#19456] Re: Perl/Python/Ruby common backend (Parrot, can Ruby play too?) — Harry Ohlsen <harryo@...> 2001/08/09

Ned Konz wrote:

[#19451] Re: Help! I'm still confused about threadin g in the ML — "Morris, Chris" <chris.morris@...>

> Is there an Outlook option to turn on In-Reply-To or References

14 messages 2001/08/09
[#19453] Re: Help! I'm still confused about threadin g in the ML — Dave Thomas <Dave@...> 2001/08/09

"Morris, Chris" <chris.morris@snelling.com> writes:

[#19506] the way class variables work — David Alan Black <dblack@...>

Hello --

51 messages 2001/08/10
[#19511] Re: the way class variables work — Chris Uzdavinis <chris@...> 2001/08/11

David Alan Black <dblack@candle.superlink.net> writes:

[#19524] order and freedom in Ruby (was: Re: Re: the way class variables work) — David Alan Black <dblack@...> 2001/08/11

Hello --

[#19517] Why not?: Assigning to self — furufuru@... (Ryo Furue)

Hi there,

55 messages 2001/08/11
[#19689] Re: Why not?: Assigning to self — Ron Jeffries <ronjeffries@...> 2001/08/14

On 13 Aug 2001 20:59:54 -0700, furufuru@ccsr.u-tokyo.ac.jp (Ryo Furue)

[#19694] Re: Why not?: Assigning to self — Ned Konz <ned@...> 2001/08/14

On Tuesday 14 August 2001 05:09 am, Ron Jeffries wrote:

[#19695] Re: Why not?: Assigning to self — ts <decoux@...> 2001/08/14

>>>>> "N" == Ned Konz <ned@bike-nomad.com> writes:

[#19696] Re: Why not?: Assigning to self — Ned Konz <ned@...> 2001/08/14

On Tuesday 14 August 2001 07:51 am, you wrote:

[#19697] Re: Why not?: Assigning to self — ts <decoux@...> 2001/08/14

>>>>> "N" == Ned Konz <ned@bike-nomad.com> writes:

[#19700] Re: Why not?: Assigning to self — Ned Konz <ned@...> 2001/08/14

On Tuesday 14 August 2001 08:27 am, you wrote:

[#19701] Re: Why not?: Assigning to self — ts <decoux@...> 2001/08/14

>>>>> "N" == Ned Konz <ned@bike-nomad.com> writes:

[#19703] Re: Why not?: Assigning to self — Ned Konz <ned@...> 2001/08/14

On Tuesday 14 August 2001 09:05 am, Guy Decoux wrote:

[#19704] Re: Why not?: Assigning to self — ts <decoux@...> 2001/08/14

>>>>> "N" == Ned Konz <ned@bike-nomad.com> writes:

[#19708] Re: Why not?: Assigning to self — Ned Konz <ned@...> 2001/08/14

On Tuesday 14 August 2001 09:27 am, you wrote:

[#19709] Re: Why not?: Assigning to self — ts <decoux@...> 2001/08/14

>>>>> "N" == Ned Konz <ned@bike-nomad.com> writes:

[#19713] Re: Why not?: Assigning to self — Ned Konz <ned@...> 2001/08/14

On Tuesday 14 August 2001 09:45 am, you wrote:

[#19750] Re: Why not?: Assigning to self — matz@... (Yukihiro Matsumoto) 2001/08/15

Hi,

[#19819] Re: Why not?: Assigning to self — Ned Konz <ned@...> 2001/08/15

On Tuesday 14 August 2001 08:14 pm, matz wrote:

[#19852] Re: Why not?: Assigning to self — matz@... (Yukihiro Matsumoto) 2001/08/16

Hi,

[#19857] Re: Why not?: Assigning to self — "Florian G. Pflug" <fgp@...> 2001/08/16

On Thu, Aug 16, 2001 at 11:05:59AM +0900, Yukihiro Matsumoto wrote:

[#19858] Re: Why not?: Assigning to self — matz@... (Yukihiro Matsumoto) 2001/08/16

Hi,

[#19867] Re: Why not?: Assigning to self — "Pit Capitain" <pit@...> 2001/08/16

Just a followup at (my) current end of the thread:

[#19550] Forced garbage collection — Lars Christensen <larsch@...>

14 messages 2001/08/11
[#19562] Re: Forced garbage collection — "Nat Pryce" <nat.pryce@...13media.com> 2001/08/12

From: "Lars Christensen" <larsch@cs.auc.dk>

[#19551] /.ed again — Tobias Reif <tobiasreif@...>

Ruy gets slasdotted again ;)

19 messages 2001/08/11

[#19650] Ruby Newbie mailing list — Michael Pence <mikepence@...>

Hello all.

14 messages 2001/08/13
[#19656] RE: Ruby Newbie mailing list — "Louis Brothers" <lcb134@...> 2001/08/13

We had a similar discussion on the OmniWeb Objective-C mailing list not to

[#19659] Re: Ruby Newbie mailing list — Michael Pence <mikepence@...> 2001/08/13

I appreciate your references to Objectionable-C ;-)

[#19685] Compiling Ruby with cygwin and Tk support — Manuel Zabelt <ng@...>

Hello!

13 messages 2001/08/14

[#19718] General (GUI/license) questions — Ryan Tarpine <rtarpine@...>

First: Kero commented in the description of his new Ruby Agenda program

18 messages 2001/08/14

[#19755] "new" returning nil: how to report the failure of object creation — furufuru@... (Ryo Furue)

Hi there,

14 messages 2001/08/15

[#19758] The GUI poll is in, and the results are surprising — Dave Thomas <Dave@...>

40 messages 2001/08/15
[#19774] Re: The GUI poll is in, and the results are surprising — Lars Christensen <larsch@...> 2001/08/15

On Wed, 15 Aug 2001, Dave Thomas wrote:

[#19784] Re: The GUI poll is in, and the results aresurprising — "Lyle Johnson" <ljohnson@...> 2001/08/15

> Please don't forget what Ruby is all about in this discussion! I think

[#19824] Ruby GUI — "Hal E. Fulton" <hal9000@...>

The concept of a new GUI is somewhat appealing,

16 messages 2001/08/15

[#20033] Ruby Article — Joshua Drake <jd.nospam@...>

Hello,

38 messages 2001/08/20

[#20127] Another Possible RCR - Wrappers via Mixins — Stephen White <spwhite@...>

The main difference between mix-ins and multiple inheritence is (to my understanding) that parent classes do not call child code, but mix-ins do.

15 messages 2001/08/22

[#20135] Bruce Eckel's criticism of Ruby — Ned Konz <ned@...>

Python.org links to http://www.mindview.net/Etc/notes.html#Ruby , saying

24 messages 2001/08/22

[#20183] ++ Operator — kamphausen@... (SKa)

Dear Community,

35 messages 2001/08/23
[#20234] Re: ++ Operator — Dave Thomas <Dave@...> 2001/08/24

matz@ruby-lang.org (Yukihiro Matsumoto) writes:

[#20236] Re: ++ Operator — matz@... (Yukihiro Matsumoto) 2001/08/24

Hi,

[#20209] In Ruby 0 is true but nil is false.. or how to shoot yourself?.. — Guillaume Cottenceau <gc@...>

I have a simple Audio-CD database (using CSV format). I was writing a

11 messages 2001/08/23

[#20254] File.readline(s) — Michael Husmann <michael.husmann@...>

I am reading a 55MB ASCII file by using File.readline(s) which takes on

14 messages 2001/08/24

[#20303] New Windows InstallShield version of Ruby — Andrew Hunt <andy@...>

19 messages 2001/08/24

[#20307] Backwards language — "Sean Middleditch" <elanthis@...>

Greetings,

30 messages 2001/08/24

[ruby-talk:20421] Re: CORBA Ruby mapping

From: Daisuke KANDA <MAP2303@...>
Date: 2001-08-27 09:06:24 UTC
List: ruby-talk #20421

> On a related note, I've been thinking for a while about (but haven't
> had any time to work on) an idea that would take portability still
> further.  It would achieve similar portability to the above approach,
> but would actually extend it to proprietary ORB's for which the
> internal API is unavailable.  Basically it uses the DII, TypeCode, and
> DynAny interfaces to construct a universal CORBA client (and possibly
> a limited CORBA server using the DSI).  All marshaling/unmarshaling,
> method dispatch, and other details which are traditionally accessible
> only through the ORB's internal API can, at least theoretically, be
> implemented purely in terms of these standard CORBA interfaces.  I

   I think it is the other style of portability defined in the IDL to Java specification.

   In the chapter "1.21.5.1 Stub/SkeletonArchitecture" of the specification(you can get it
  from http://www.omg.org/cgi-bin/doc?formal/01-06-06 ), there are two portable stub code,
  Stream-based and DII-based. I like the Stream-based code mainly because of its ease.
  But the DII-based code is superior than Stream-based one in point of flexibility.


> The way I think our projects could fit
> together is something like this.  We first define the Ruby-IDL
> mapping.  Then we (or you) define the standard Ruby client/server
> interface.  Then we (or I) implement this interface purely in terms of
> the IDL C++ mapping.  Now we have an API which can have either an
> ORB-specific implementation (like your ORBit wrapper) for efficiency,
> or a portable implementation (possibly at some loss of efficiency,
> depending on how well the DynAny and DII interfaces are implemented). 
> I think this combination would put Ruby way ahead of other scripting
> languages.  What are your thoughts (and anyone else's)?

  If I correctly understand your plan, I think our schemes are compensate together ;-)
  Althoug I don't know how to define CORBA in other script languages, I think Ruby mapping
becomes more dynamic than and at least same structured to Java.
  As you say, at first we should define IDL-Ruby mapping.



  from [ruby-talk:20247]
  
> Dai <MAP2303@mapletown.net> wrote in message news:<20010820082358G.MAP2303@mapletown.net>...

> >   following is my comment on Tobin's README.
> > 
> > ---
> > > 1. Modules

> >   I also think IDL's module or constant name should be capitalized in Ruby.
> >   But there are one problem. If its name conflicts with language predefined name,
> > other language bindings prefixes it with `_' while mapping from IDL name.
> > As you know, Ruby's constant cannot start with a underscore.
> 
> I'm inclined to think now that module names should have the first
> letter capitalized in the Ruby mapping.  This shouldn't cause name
> conflicts since IDL won't let you use two identifiers in the same
> scope that differ only in case.  Same goes for constants--my approach
> (creating "constant" methods) was just too confusing.

  But conflict occures between IDL's name and Ruby's one.
  for example,

  // IDL
  module String {
    ...
  };

  # ruby
  module String  # error!
    ...
  end

  What should this identifier mapped to?
  Although Java mapping specify it is mapped to "_String", but first underscore character
is not allowed as Ruby constant(or classname).

  FYI, IDL identifiers is defined as
|    An identifier is an arbitrarily long sequence of ASCII alphabetic, digit, and
|   underscore("_") characters. The first character must be an ASCII alphabetic character.

  And Ruby's constant is the same except that it should start with captal letter.
  I currently ignore this issue, because any good idea comes into my mind.
  Can anyone solve it?


> > > 2. Interfaces
> > 
> > IDL interfaces are also mapped to Ruby modules.
> > > Each Ruby module
> > > corresponding to an IDL interface includes the base module CORBA::Object,
> > > which declares all the methods found in the IDL CORBA::Object interface,
> > > prefixed with an underscore, along with an additional method, repo_id,
> > > which returns the interface's Repository ID.
> > 
> >   In other language binding, a method like repo_id() defined in its Portability
> > Specification. In Java, the _ids() method id defined in the class of
> > org.omg.CORBA.portable.ObjectImpl.
> > 
> > 
> > > myBaz = CORBA::ORBit::Stub.new()
> > > myBaz.extend(Foo::Bar::Baz)
> > 
> >   I prefer to use Stub's _narrow() method for it.
> 
> Maybe you misunderstood--this code was only for purposes of
> illustration (stubs are never explicitly instantiated).  This is just
> Ruby pseudocode for the C implementation.  Clients are expected to use
> _narrow() in my mapping.

  I see.
  To implement _narrow() method is responsible for each ORB vender.



| 3. Operations
| 
| IDL operations are mapped to Ruby method definitions.  As a rule,
| in arguments are passed as ordinary parameters, return values and
| out arguments are returned as a single array, and inout arguments are
| passed in like in parameters and returned like out parameters, with no
| "pass-by-reference" semantics involved.  E.g.,

| //IDL
| interface Foo {
| 	long do_it(in long in_arg, out long out_arg, inout long
| 		inout_arg);
| };
| 
| #Ruby
| #somehow get reference myFoo to Foo object
| ret_val, out_arg, inout_arg_ret = myFoo.do_it(in_arg, inout_arg_par)


  I agree.
  But I suspect if there are only one returned value, it is useful that the value itself is
returned.

    //IDL
    interface Foo {
    	long do_it(in long in_arg);
    	void do_it2(in long in_arg, inout inout_arg);
    };
    #Ruby
    ret_val1 = myFoo.do_it(in_arg)
    ret_val2 = myFoo.do_it2(in_arg, inout_arg)

  I think invoking do_it() is reasonable but do_it2() is a bit confusable...



| Specifically, if
| a block is supplied with a CORBA operation invocation, the block will be
| executed with all block parameters set to the values of corresponding out
| arguments returned by the invocation.  Since Ruby binds block parameters
| to any local variables with the same name defined in the enclosing scope
| of the block, this can be used to simulate "call-by-reference".  E.g.,
|
|   arg1, arg2, arg3 = nil
|   do_it() {|arg1, arg2, arg3|}
|   p arg1, arg2, arg3 #prints 1, 2, 3

  It is interesting.
  I also think if block is given to remote method invocation, then returned array is
normally passed to block argument. This rule is very fit to Ruby.
  And as you show, if the block argument is already defined in outer scope, they are
automatically set.
  I think we say that you can give an iteretor to any remote method invocation and that
substitution to outer variable is a tips not a rule.


| //IDL
| interface Foo {
| 	void do_it(inout inout_arg);
| };
| //implementation adds 1 to inout_arg
| 
| #Ruby
| #somehow get reference myFoo to Foo object
| inout_arg = 10
| do_it(:inout_arg, inout)
| p inout_arg #prints 11

  It seem to be overspec.
  I think inout parameter is rarely used and eventually confusable.
  So it is unnecessary to make it easy to write.


| 4. Attributes
|
| IDL attributes are mapped to Ruby methods of the same name.  For ordinary
| attributes, a "getter/setter" pair of methods is created; for readonly
| methods, only a "getter" method is created.  These follow the ordinary
| Ruby naming conventions for attributes, e.g.,

  I think so.


| 5. Constants

| For at least two reasons, IDL constants are *not* mapped to Ruby
| constants.  In the first place, as we all know, Ruby "constants" are not
| really constant.  This is at variance with the "immutable" semantics
| implicit in IDL.  In the second place, Ruby constants must begin with
| a capital letter.  This is clearly an unreasonable requirement to place
| on CORBA implementors who write their IDL with other languages in mind.
| Therefore I implement constants as methods returning the value of the
| constant.  E.g.,

  Although I agree the first problem, I think it is better that IDL constant is mapped
to Ruby constatnt. Using method is not to solve this problem because Ruby allows
programmer to redefine any method.

  And I don't mind the second problem because there are same restrict in module, interface,
method(its first letter must be lower case letter), and so on.


//IDL
module Foo {
	const float pi	= 3.14159265;
};

#Ruby
module Foo
  Pi = 3.14159265   # or it may be good that capitalize all characters...
end


  following sections are on the next time...

| 6. Exceptions
| 7. Structs
| 8. Unions
| 9. Sequences
| 10. Arrays
| 11. Enumerations
| 12. Typedefs
| 13. Any
| 14. TypeCodes
| 15. The Client-Side Mapping for the ORB Pseudo-Object

In This Thread