[#13775] Problems with racc rule definitions — Michael Neumann <neumann@...>

15 messages 2001/04/17
[#13795] Re: Problems with racc rule definitions — Minero Aoki <aamine@...> 2001/04/18

Hi,

[#13940] From Guido, with love... — Dave Thomas <Dave@...>

52 messages 2001/04/20

[#13953] regexp — James Ponder <james@...>

Hi, I'm new to ruby and am coming from a perl background - therefore I

19 messages 2001/04/21

[#14033] Distributed Ruby and heterogeneous networks — harryo@... (Harry Ohlsen)

I wrote my first small distributed application yesterday and it worked

15 messages 2001/04/22

[#14040] RCR: getClassFromString method — ptkwt@...1.aracnet.com (Phil Tomson)

It would be nice to have a function that returns a class type given a

20 messages 2001/04/22

[#14130] Re: Ruby mascot proposal — "Conrad Schneiker" <schneik@...>

Guy N. Hurst wrote:

21 messages 2001/04/24
[#14148] Re: Ruby mascot proposal — Stephen White <spwhite@...> 2001/04/24

On Tue, 24 Apr 2001, Conrad Schneiker wrote:

[#14188] Re: Ruby mascot proposal — matz@... (Yukihiro Matsumoto) 2001/04/25

Hi,

[#14193] Re: Ruby mascot proposal — "W. Kent Starr" <elderburn@...> 2001/04/25

On Tuesday 24 April 2001 23:02, Yukihiro Matsumoto wrote:

[#14138] Re: python on the smalltalk VM — Conrad Schneiker <schneik@...>

FYI: Thought this might be of interest to the JRuby and Ruby/GUI folks.

27 messages 2001/04/24
[#14153] Re: python on the smalltalk VM — Andrew Kuchling <akuchlin@...> 2001/04/24

Conrad Schneiker <schneik@austin.ibm.com> writes:

[#14154] array#flatten! question — Jim Freeze <jim@...> 2001/04/24

Hello.

[#14159] Can I insert into an array — Jim Freeze <jim@...> 2001/04/24

Ok, this may be a dumb question, but, is it possible to insert into an

[#14162] Re: Can I insert into an array — Dave Thomas <Dave@...> 2001/04/24

Jim Freeze <jim@freeze.org> writes:

[#14289] RCR: Array#insert — Shugo Maeda <shugo@...> 2001/04/27

At Wed, 25 Apr 2001 01:28:36 +0900,

[#14221] An or in an if. — Tim Pettman <tjp@...>

Hi there,

18 messages 2001/04/25

[#14267] Re: Ruby mascot proposal — "Conrad Schneiker" <schneik@...>

Danny van Bruggen,

16 messages 2001/04/26

[#14452] How to do it the Ruby-way 3 — Stefan Matthias Aust <sma@3plus4.de>

First a question: Why is

21 messages 2001/04/30

[ruby-talk:13838] Re: Ruby on a JVM - good or bad idea?

From: Mathieu Bouchard <matju@...>
Date: 2001-04-19 01:14:59 UTC
List: ruby-talk #13838
On Wed, 18 Apr 2001, Stefan Matthias Aust wrote:
> On Tue, 17 Apr 2001 06:45:49 +0900, Mathieu Bouchard
> <matju@sympatico.ca> wrote:
> >I think the most difficult part of writing a "Ruby for Java" interpreter
> >is getting the parser right. Of course that parser should be written in
> >Ruby itself.
> Why do you think this would be advantageous?

Because you can reuse that parser for parsing without executing, and then
Ruby basically becomes homoiconic. When this happens, a whole category of
programs become easier to write: compilers, editors, interpreters, ...

Also you can reuse that parser to put it in a third implementation or even
replace the one of the first implementation. If the parser is written in
Java then it becomes dependent on Java just like the current one is
dependent on C and Yacc.

> I noticed there's
> something like RACC which seems to be a Ruby version of yacc.  A
> parser in Ruby would perhaps help to formalize the grammar and make is
> easier to understand than a yacc file, but what shall a Ruby parser in
> Ruby generate?

A parser should not generate anything; a parser generator has got to
generate a parser which is written in a language, and that language can be
Ruby just like the generator itself can be written in Ruby. But that
doesn't mean there should absolutely be a parser generator ("grammar
compiler") because it could as well be a "grammar interpreter" instead, or
something else, as long as it does the job.

> I already raised that question:  Is Ruby creating some precompiled
> intermediate language which then can be interpretered on a ruby VM?

A tree of objects; those objects are of special internal classes. 

> >I also think a version 1.0 of that, probably shouldn't support Threads,
> >Continuations, nor Resumable Exceptions, but that's about all.
> Yes, it's probably the best idea to start with a subset of Ruby.

It's also best to continue with a subset of Ruby, or a superset of a
subset of Ruby, simply because there are things that don't map well from C
to Java, or even become irrelevant. Let me add three other things to the
list: 

* Garbage Collection (in JVM, it is none of our business)

* ObjectSpace, Object#id (can be done but may be costly)

* Ruby interface to C procedures (replace by: Ruby interface to Java
classes using reflection, constructed very differently for maximum
comfort)

> I also agree with another poster, that it would be very important to
> make sure, that C-Ruby and JRuby have the same semantics.  I don't
> think there's a formal definition of Ruby's semantic but a large set
> of unit tests would also be very helpful.

Well, a large enough set of unit tests becomes by itself a kind of formal
specification, albeit in an "organic" way (in the sense of making the
spec "emerge" from the mesh of tests)

Contracts, however, would help for more thorough testing, as they can test
correctness of library calls *while* executing "real code", thus
harnessing real code for doing real testing. Also the contracts are pretty
much formal specifications in the more usual sense.

I think it's a good idea to write contracts for Ruby's builtin classes.
Those could be merged into Rubicon (which would then have two related
purposes), or into Ruby itself, or into MetaRuby.

matju

In This Thread

Prev Next