# Ruby Specification

**URL:** <https://rubytalk.org/t/ruby-specification/12649>\
**Category:** ruby-talk\
**Created:** [19 July 2004 06:38 UTC](https://rubytalk.org/t/ruby-specification/12649 "2004-07-19T06:38:31Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![David\_Ross2](https://avatars.discourse-cdn.com/v4/letter/d/ed8c4c/32.png) [@David\_Ross2](https://rubytalk.org/u/David_Ross2)\
**Post date:** [19 July 2004 06:38 UTC](https://rubytalk.org/t/ruby-specification/12649/1 "2004-07-19T06:38:31Z")

</div>

Request. Can someone create a ruby specification? I  
want to try to create a true rubycc compiler that is  
licensed BSD. I cannot find the Ruby Specification  
book anywhere, and I refuse to read the ruby sources  
for legal reasons. Anyone want to read up on gc.c?  
Thats mainly the monster. It would be nice to have a  
full specification on ruby though. Also, if there are  
any compiler designers out there that would like to  
help or have any comments, drop me an email. Thanks. I  
would really like to create a compiler that generates  
small executables. It is important to expanding ruby  
IMO. Something in the essence of how Lua has a  
compiler. It would be really nice. Also, thanks to  
that there is no ruby compiler I could not use it in a  
commercial project. It would have been really nice to  
use it in projects that require a compiled binary that  
is 1) not open code, 2) not byte compiled. Please  
advise, David Ross

> **···**
>
> \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> Do you Yahoo!?  
> Vote for the stars of Yahoo!'s next ad campaign!  
> [http://advision.webevents.yahoo.com/yahoo/votelifeengine/](http://advision.webevents.yahoo.com/yahoo/votelifeengine/)

---

<div class="post-metadata">

**Author:** ![Lothar\_Scholz2](https://avatars.discourse-cdn.com/v4/letter/l/f14d63/32.png) [@Lothar\_Scholz2](https://rubytalk.org/u/Lothar_Scholz2)\
**Post date:** [19 July 2004 07:06 UTC](https://rubytalk.org/t/ruby-specification/12649/2 "2004-07-19T07:06:12Z")

</div>

Hello David,

> Request. Can someone create a ruby specification? I  
> want to try to create a true rubycc compiler that is  
> licensed BSD. I cannot find the Ruby Specification  
> book anywhere, and I refuse to read the ruby sources  
> for legal reasons. Anyone want to read up on gc.c?  
> Thats mainly the monster. It would be nice to have a

That's a typo, the monster is "eval.c".  
Reading the "gc.c" file is as enjoying as reading Harry Potter.

> full specification on ruby though. Also, if there are  
> any compiler designers out there that would like to  
> help or have any comments, drop me an email. Thanks. I  
> would really like to create a compiler that generates  
> small executables. It is important to expanding ruby  
> IMO. Something in the essence of how Lua has a  
> compiler. It would be really nice. Also, thanks to  
> that there is no ruby compiler I could not use it in a  
> commercial project. It would have been really nice to  
> use it in projects that require a compiled binary that  
> is 1) not open code, 2) not byte compiled. Please  
> advise, David Ross

This is a huge project that you want to start. And in 99% projects of  
this size die faster then a local minister in iraq, leaving a lot  
of wasted energy.

You should think twice if it is not better to support matz with doing  
a rewrite of the current interpreter to get byte code for code obfuscation.  
Because of the dynamic nature of Ruby and the interface it provides to  
open languages you have to rewrite more or less the whole kernel  
anyway. So please participate in the development of Rite.

There is no legal problem with using ruby in commercial projects,  
otherwise matz would not be paid by his company.

And by the way, do you want to do this as part of some kind of job or  
as a hobbyist ?

> **···**
>
> --  
> Best regards, emailto: scholz at scriptolutions dot com  
> Lothar Scholz [http://www.ruby-ide.com](http://www.ruby-ide.com)  
> CTO Scriptolutions Ruby, PHP, Python IDE 's

---

<div class="post-metadata">

**Author:** ![Conductor1](https://avatars.discourse-cdn.com/v4/letter/c/b3f665/32.png) [@Conductor1](https://rubytalk.org/u/Conductor1)\
**Post date:** [19 July 2004 07:27 UTC](https://rubytalk.org/t/ruby-specification/12649/3 "2004-07-19T07:27:09Z")

</div>

David Ross wrote:

> Request. Can someone create a ruby specification? I  
> want to try to create a true rubycc compiler that is  
> licensed BSD. I cannot find the Ruby Specification  
> book anywhere, and I refuse to read the ruby sources  
> for legal reasons. Anyone want to read up on gc.c?  
> Thats mainly the monster. It would be nice to have a  
> full specification on ruby though. Also, if there are  
> any compiler designers out there that would like to  
> help or have any comments, drop me an email. Thanks. I  
> would really like to create a compiler that generates  
> small executables. It is important to expanding ruby  
> IMO. Something in the essence of how Lua has a  
> compiler. It would be really nice. Also, thanks to  
> that there is no ruby compiler I could not use it in a  
> commercial project. It would have been really nice to  
> use it in projects that require a compiled binary that  
> is 1) not open code, 2) not byte compiled. Please  
> advise, David Ross
> 
> \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> Do you Yahoo!?  
> Vote for the stars of Yahoo!'s next ad campaign!  
> [http://advision.webevents.yahoo.com/yahoo/votelifeengine/](http://advision.webevents.yahoo.com/yahoo/votelifeengine/)

Wow. I wish you the best of luck!

Many of us would be overjoyed to see a true rubycc. Even if its kinda like gcj with a huge runtime library. And the BSD style licensing makes it sound almost too good to be true.

If this gets started and you need volunteers, I'm sure you'll find many ready and willing.

---

<div class="post-metadata">

**Author:** ![Laurent\_Julliard4](https://avatars.discourse-cdn.com/v4/letter/l/ebca7d/32.png) [@Laurent\_Julliard4](https://rubytalk.org/u/Laurent_Julliard4)\
**Post date:** [19 July 2004 13:17 UTC](https://rubytalk.org/t/ruby-specification/12649/4 "2004-07-19T13:17:08Z")

</div>

> Request. Can someone create a ruby specification? I  
> want to try to create a true rubycc compiler that is  
> licensed BSD. I cannot find the Ruby Specification  
> book anywhere, and I refuse to read the ruby sources  
> for legal reasons.

I understand your reasons, but I think you can look at parse.y and  
refer to the ri documentation for most things, safely.  
Matz' company is definitely not SCO, I believe.

> Anyone want to read up on gc.c?

I dont think tha gc is part of a ruby specification.  
Maybe you intended eval.c ?

> Thats mainly the monster. It would be nice to have a  
> full specification on ruby though.

matz itself agrees, and he told once that he would bless someone that  
wants to fill this gap.

> Also, if there are  
> any compiler designers out there that would like to  
> help or have any comments, drop me an email. Thanks. I  
> would really like to create a compiler that generates  
> small executables.

maybe you'd like to take a look at metaruby or jruby.

> It is important to expanding ruby  
> IMO. Something in the essence of how Lua has a  
> compiler. It would be really nice.

it would, but you'd need some interpreter runtime anyway.  
Maybe you could compile to C code and link the ruby runtime library

> Also, thanks to  
> that there is no ruby compiler I could not use it in a  
> commercial project.

if you mean you need to hide/obfuscate code, maybe you just need a  
vm+bytecode, as lothar scholz pointed.

> It would have been really nice to  
> use it in projects that require a compiled binary that  
> is 1) not open code, 2) not byte compiled. Please  
> advise, David Ross

why not byte compiled? there are plenty of java and smalltalk  
commercial apps.

> **···**
>
> il Mon, 19 Jul 2004 15:38:31 +0900, David Ross \<drossruby@yahoo.com\> ha scritto::

---

<div class="post-metadata">

**Author:** ![Bill\_Kelly](https://avatars.discourse-cdn.com/v4/letter/b/cc9497/32.png) [@Bill\_Kelly](https://rubytalk.org/u/Bill_Kelly)\
**Post date:** [19 July 2004 17:52 UTC](https://rubytalk.org/t/ruby-specification/12649/5 "2004-07-19T17:52:52Z")

</div>

Hi,

> Request. Can someone create a ruby specification? I  
> want to try to create a true rubycc compiler that is  
> licensed BSD.

Please don't take this as a criticism. I am asking  
because I thought Ruby's license was said to allow  
commerical exploitation (even closed source). And  
so I'm curious if this is your impression too, or what  
additional safeguards or clauses make the BSD license  
preferable for your purposes?

> I cannot find the Ruby Specification  
> book anywhere, and I refuse to read the ruby sources  
> for legal reasons.

I find this perplexing. I thought open source  
wasn't doing a good job of being open source if you  
had to be wary of reading it for legal reasons?

An example in my field of interest is id Software's  
generous release of their older game engines, such as  
DOOM, Quake, and Quake 2 under the GPL. I was a game  
developer when the Quake source was released, and it  
never would have occurred to me to be afraid to look  
at it.

Anyway, again, this is not intended as a criticism -  
I'm just trying to understand what could possibly be  
wrong with looking at Ruby's source code.

Regards,

Bill

> **···**
>
> From: "David Ross" \<drossruby@yahoo.com\>

---

<div class="post-metadata">

**Author:** ![David\_Ross2](https://avatars.discourse-cdn.com/v4/letter/d/ed8c4c/32.png) [@David\_Ross2](https://rubytalk.org/u/David_Ross2)\
**Post date:** [19 July 2004 15:17 UTC](https://rubytalk.org/t/ruby-specification/12649/6 "2004-07-19T15:17:13Z")

</div>

> I understand your reasons, but I think you can look  
> at parse.y and  
> refer to the ri documentation for most things,  
> safely.  
> Matz' company is definitely not SCO, I believe.

I hope they are not SCO. I refuse to look at any  
source code though.

> I don't think that gc is part of a ruby

specification.

> Maybe you intended eval.c ?

I should have said, "I do not understand the GC, and  
parsing evaluations are a task as well. To start  
though I need to know how ruby is expected to work.  
Each language GC is different, but performs the same  
task.

> \>It is important to expanding ruby  
> \>IMO. Something in the essence of how Lua has a  
> \>compiler. It would be really nice.
> 
> it would, but you'd need some interpreter runtime  
> anyway.  
> Maybe you could compile to C code and link the ruby  
> runtime library

yes, you would need a runtime. I have not planned  
anything out yet, its in the idea stage.

> \>Also, thanks to  
> \>that there is no ruby compiler I could not use it  
> in a  
> \>commercial project.
> 
> if you mean you need to hide/obfuscate code, maybe  
> you just need a  
> vm+bytecode, as lothar scholz pointed.

I really do not like compiling software into bytecode.  
They wanted a standalone executable, they did not want  
any third party interpreters.

> **···**
>
> -------
> 
> Okay in response to a few things that have been  
> mentioned to me elsewhere. Even with dynamic nature of  
> ruby, it is still possible to create a native  
> compiler. You have to have a runtime running with it.  
> It is difficult, and certainly something that would  
> take a while. I'm tired of hearing, "It can't be done"  
> in software programming. Just because people think it  
> cannot be done doesn't mean they are right about it.
> 
> Why create a compiler to create stand alone  
> executables?
> 
> I find it difficult to have third part software  
> installed on the computer. Also, if someone wants to  
> include an application on a OS which I will not  
> mention, they want a standalone that does not need a  
> interpreter. This is one of the main reasons.
> 
> --David Ross
> 
> \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> Do you Yahoo!?  
> Vote for the stars of Yahoo!'s next ad campaign!  
> [http://advision.webevents.yahoo.com/yahoo/votelifeengine/](http://advision.webevents.yahoo.com/yahoo/votelifeengine/)

---

<div class="post-metadata">

**Author:** ![David\_Ross2](https://avatars.discourse-cdn.com/v4/letter/d/ed8c4c/32.png) [@David\_Ross2](https://rubytalk.org/u/David_Ross2)\
**Post date:** [19 July 2004 18:00 UTC](https://rubytalk.org/t/ruby-specification/12649/7 "2004-07-19T18:00:44Z")

</div>

> Please don't take this as a criticism. I am asking  
> because I thought Ruby's license was said to allow  
> commerical exploitation (even closed source). And  
> so I'm curious if this is your impression too, or  
> what  
> additional safeguards or clauses make the BSD  
> license  
> preferable for your purposes?

> I find this perplexing. I thought open source  
> wasn't doing a good job of being open source if you  
> had to be wary of reading it for legal reasons?

I want to make sure my code stays under the BSD  
license. Ruby's license confuses me a bit. --David Ross

> **···**
>
> \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> Do you Yahoo!?  
> Yahoo! Mail - 50x more storage than other providers!  
> [http://promotions.yahoo.com/new\_mail](http://promotions.yahoo.com/new_mail)

---

<div class="post-metadata">

**Author:** ![Jeremy\_Henty](https://avatars.discourse-cdn.com/v4/letter/j/c6cbf5/32.png) [@Jeremy\_Henty](https://rubytalk.org/u/Jeremy_Henty)\
**Post date:** [19 July 2004 18:52 UTC](https://rubytalk.org/t/ruby-specification/12649/8 "2004-07-19T18:52:11Z")

</div>

(Disclaimer: the isn't really (directly) about Ruby, so you may think  
it off-topic. But it is (indirectly) about the consequences of  
looking at the Ruby source, so I hope it is on-topic.)

In article \<019301c46db9$6a9f7930$6442a8c0@musicbox\>, Bill Kelly wrote:

> I thought open source wasn't doing a good job of being open source  
> if you had to be wary of reading it for legal reasons?

"Open source" only means "you have the right to do certain things with  
this software". It does \*not\* mean "you can do whatever you like with  
it and not worry about the consequences". \*That\* is only true of  
software released into the public domain.

> An example in my field of interest is id Software's generous release  
> of their older game engines, such as DOOM, Quake, and Quake 2 under  
> the GPL. I was a game developer when the Quake source was released,  
> and it never would have occurred to me to be afraid to look at it.

Pardon my bluntness, but that was foolish of you. The GPL requires  
you to release all derived works under the GPL too. If you looked at  
id Software's source and used it in a closed source product of your  
own then id Software would have grounds for suing you for damages.

I am not accusing you of trying to rob id Software (nor am I accusing  
id Software of being litigious \<disrespectful\_term\>s). I just want to  
point out that good intentions may not be enough to keep you out of  
court. Companies have sued ex-employees simply for working in the  
same industry, claiming "inevitable disclosure" ie. "this person  
learned their skills with us, so if they use those skills elsewhere  
they are violating our IP rights". I don't condone their behaviour (I  
actually find it loathsome), but the practical upshot is that if you  
don't like the idea of being sued by people with much more lawyers and  
money than you then you should think very hard about the licenses of  
any software you look at.

> Anyway, again, this is not intended as a criticism - I'm just trying  
> to understand what could possibly be wrong with looking at Ruby's  
> source code.

Nothing, as long as you conform to its license. But if the OP wants  
to release code under the BSD license and is not sure whether the Ruby  
license is BSD-compatible, then the OP's decision not to look at the  
Ruby source is IMHO extremely sensible.

Regards,

Jeremy Henty

---

<div class="post-metadata">

**Author:** ![Lothar\_Scholz2](https://avatars.discourse-cdn.com/v4/letter/l/f14d63/32.png) [@Lothar\_Scholz2](https://rubytalk.org/u/Lothar_Scholz2)\
**Post date:** [19 July 2004 16:20 UTC](https://rubytalk.org/t/ruby-specification/12649/9 "2004-07-19T16:20:28Z")

</div>

Hello David,

> I really do not like compiling software into bytecode.  
> They wanted a standalone executable, they did not want  
> any third party interpreters.

You can have all in one interpreter binary, even DLL's. That is for  
these people just the same.

> Okay in response to a few things that have been  
> mentioned to me elsewhere. Even with dynamic nature of  
> ruby, it is still possible to create a native  
> compiler. You have to have a runtime running with it.  
> It is difficult, and certainly something that would  
> take a while. I'm tired of hearing, "It can't be done"  
> in software programming. Just because people think it  
> cannot be done doesn't mean they are right about it.

Oh, i don't say this. I just say that compiling it will not give you  
any real advantage as long as you don't add type specifications to the  
language. Otherwise the compiler would only have a very very small  
performance advantage.

The only way to get some benefits is if you can assume that the system  
is closed, means that now new ruby files are loaded and no internal  
program structure is changed, D, Eiffel and some Lisps are taking  
this approach, it's called global program optimization and can give  
a huge boost in evaluation speed because accessing a variable or  
calling a method can be as fast as a native function call.  
But is this restriction really usefull ?

I don't have the time to go into a deep description of how to solve this  
problems with a good JIT compiler. So maybe you should read some texts  
about this first.

> Why create a compiler to create stand alone  
> executables?

> I find it difficult to have third part software  
> installed on the computer. Also, if someone wants to  
> include an application on a OS which I will not  
> mention, they want a standalone that does not need a  
> interpreter. This is one of the main reasons.

Right, but ExErb is just doing this. It's not a compiler, it does  
exist and is a living project and it is in real life usage.  
So this is not an argument for a compiler. If you are unsatisfied with  
ExErb please spend your time there.

> **···**
>
> --  
> Best regards, emailto: scholz at scriptolutions dot com  
> Lothar Scholz [http://www.ruby-ide.com](http://www.ruby-ide.com)  
> CTO Scriptolutions Ruby, PHP, Python IDE 's

---

<div class="post-metadata">

**Author:** ![Laurent\_Julliard4](https://avatars.discourse-cdn.com/v4/letter/l/ebca7d/32.png) [@Laurent\_Julliard4](https://rubytalk.org/u/Laurent_Julliard4)\
**Post date:** [19 July 2004 17:32 UTC](https://rubytalk.org/t/ruby-specification/12649/10 "2004-07-19T17:32:07Z")

</div>

yes but I intended: "you can have your own kind of gc, because ruby  
garbage collection does not really determine the behaviour of a  
program".  
If you have 3-color generational gc or simple reference counting with  
cycle detection I think that nothing will change for the final user.  
Anyway, I may be wrong.

> **···**
>
> il Tue, 20 Jul 2004 00:17:13 +0900, David Ross \<drossruby@yahoo.com\> ha scritto::
> 
> > > I don't think that gc is part of a ruby
> > 
> > specification.
> > 
> > > Maybe you intended eval.c ?
> > 
> > I should have said, "I do not understand the GC, and  
> > parsing evaluations are a task as well. To start  
> > though I need to know how ruby is expected to work.  
> > Each language GC is different, but performs the same  
> > task.

---

<div class="post-metadata">

**Author:** ![Kristof\_Bastiaensen1](https://avatars.discourse-cdn.com/v4/letter/k/9fc29f/32.png) [@Kristof\_Bastiaensen1](https://rubytalk.org/u/Kristof_Bastiaensen1)\
**Post date:** [19 July 2004 19:32 UTC](https://rubytalk.org/t/ruby-specification/12649/11 "2004-07-19T19:32:15Z")

</div>

Hi,

> Pardon my bluntness, but that was foolish of you. The GPL requires  
> you to release all derived works under the GPL too. If you looked at  
> id Software's source and used it in a closed source product of your  
> own then id Software would have grounds for suing you for damages.

I am not a lawyer, but I believe this is not correct.  
As far as I know, copyright only applies to the code, not to  
the techniques used. So as long as you are not  
copying code directly into your program, you are not in breach  
of copyright. For the GPL a derived work is only derived if it  
uses the same code. Techniques don't fall under copyright,  
but under patent law. (Wether patents should be allowed for  
software is a different discussion).  
Of course you could copy the code, change the names of some  
variables and functions, and then claim it's your code, but  
this would obviously still fall under the copyright case.  
However if you just look at the techniques used, and use  
them in you code (not verbatim), then there wouldn't be any  
grounds to be sued (apart from patents).

Kristof

> **···**
>
> On Mon, 19 Jul 2004 18:51:46 +0000, Jeremy Henty wrote:

---

<div class="post-metadata">

**Author:** ![Bill\_Kelly](https://avatars.discourse-cdn.com/v4/letter/b/cc9497/32.png) [@Bill\_Kelly](https://rubytalk.org/u/Bill_Kelly)\
**Post date:** [19 July 2004 20:05 UTC](https://rubytalk.org/t/ruby-specification/12649/12 "2004-07-19T20:05:00Z")

</div>

Hi,

> (Disclaimer: the isn't really (directly) about Ruby, so you may think  
> it off-topic. But it is (indirectly) about the consequences of  
> looking at the Ruby source, so I hope it is on-topic.)
> 
> In article \<019301c46db9$6a9f7930$6442a8c0@musicbox\>, Bill Kelly wrote:
> 
> \> I thought open source wasn't doing a good job of being open source  
> \> if you had to be wary of reading it for legal reasons?
> 
> "Open source" only means "you have the right to do certain things with  
> this software". It does \*not\* mean "you can do whatever you like with  
> it and not worry about the consequences". \*That\* is only true of  
> software released into the public domain.

Certainly. I thought that copyright law (IANAL) distinguished  
between modifying someone else's code (derivative work) and  
writing your own code from scratch. I have seen \*a lot\* of code  
in my life so far, much of it proprietary and closed source.  
You aren't supposed to be able to copyright an \*idea\*. That's  
what Software Patents do (and I think they are an abomination,  
but that's a different topic.) My point is that I don't live  
in fear that I might accidentally "steal" someone else's code  
just because I've looked at it. I know the difference between  
"copying someone else' code modifying it" vs. "implementing my  
own code from scratch based on all the knowledge I've picked up  
over my career."

I guess I'm approaching this using my own GPL software as a  
yardstick - would I care if someone learned from my GPL code,  
and then decided to re-implement the same functionality from  
scratch, just using what they'd learned? No! I'd be thrilled  
that my code was useful to someone. That's why I released it!!

> \> An example in my field of interest is id Software's generous release  
> \> of their older game engines, such as DOOM, Quake, and Quake 2 under  
> \> the GPL. I was a game developer when the Quake source was released,  
> \> and it never would have occurred to me to be afraid to look at it.
> 
> Pardon my bluntness, but that was foolish of you.

No worries, I'm here to learn . . .

> The GPL requires  
> you to release all derived works under the GPL too. If you looked at  
> id Software's source and used it in a closed source product of your  
> own then id Software would have grounds for suing you for damages.

Apologies if this is getting too off-topic... But here is an  
excerpt from id Software's release of the Quake 2 code:

&nbsp;&nbsp;The code is all licensed under the terms of the GPL (gnu public license).  
&nbsp;&nbsp;You should read the entire license, but the gist of it is that you can do  
&nbsp;&nbsp;anything you want with the code, including sell your new version. The catch  
&nbsp;&nbsp;is that if you distribute new binary versions, you are required to make the  
&nbsp;&nbsp;entire source code available for free to everyone.

&nbsp;&nbsp;The primary intent of this release is for entertainment and educational  
&nbsp;&nbsp;purposes, but the GPL does allow commercial exploitation if you obey the  
&nbsp;&nbsp;full license.

I firmly believe id Software's intent was not to say: Here's our  
code for you to learn from! DON'T LOOK AT IT!!!!!!!!!!!!!!!!!

I truly do not believe the purpose of their releasing their code  
was to try to drum up lawsuits against anyone who might have wanted  
to learn from it.

> I am not accusing you of trying to rob id Software (nor am I accusing  
> id Software of being litigious \<disrespectful\_term\>s). I just want to  
> point out that good intentions may not be enough to keep you out of  
> court. Companies have sued ex-employees simply for working in the  
> same industry, claiming "inevitable disclosure" ie. "this person  
> learned their skills with us, so if they use those skills elsewhere  
> they are violating our IP rights". I don't condone their behaviour (I  
> actually find it loathsome), but the practical upshot is that if you  
> don't like the idea of being sued by people with much more lawyers and  
> money than you then you should think very hard about the licenses of  
> any software you look at.

OK. But perhaps we can take this on a case-by-case basis? Meaning,  
We're talking about Matz here, (and in my examples, John Carmack).

I am personally willing to trust that I understand the intent of  
id Software releasing their code. And that for people to be afraid  
to look at it for fear of getting sued based on what they learned from  
it, is COMPLETELY CONTRARY to that intent. (Again I'm distinguishing  
between learning from the code, and \*copying\* it.)

Oh well, that's just me. I think there's something a little sad  
about all this though... (Maybe our nations should cease development  
of missile defense shields, and start working on lawyer containment  
mechanisms... ;-P)

Regards,

Bill

> **···**
>
> From: "Jeremy Henty" \<jeremy@chaos.org.uk\>

---

<div class="post-metadata">

**Author:** ![James\_Britt6](https://avatars.discourse-cdn.com/v4/letter/j/a87d85/32.png) [@James\_Britt6](https://rubytalk.org/u/James_Britt6)\
**Post date:** [19 July 2004 20:19 UTC](https://rubytalk.org/t/ruby-specification/12649/13 "2004-07-19T20:19:21Z")

</div>

David Ross wrote:

> ...  
> Why create a compiler to create stand alone  
> executables?
> 
> I find it difficult to have third part software  
> installed on the computer. Also, if someone wants to  
> include an application on a OS which I will not  
> mention, they want a standalone that does not need a  
> interpreter. This is one of the main reasons.

Not sure why you are so reluctant to mention an OS, or look at certain source code; quite mysterious. But on Windows, for example, the requirement for an interpreter or runtime engine is quite common. Any Java(tm) app needs a VM installed. VB apps (pre .Net) require some version of vbrun.dll.

Sometimes these things are already installed, sometimes not. But once installed they are available for other applications as well.

Plus, one can bundle up the Ruby interpreter into an executable using exerb. Makes the app larger, but still probably smaller than your typical "stand-alone" Java(tm) program.

James

---

<div class="post-metadata">

**Author:** ![Anders\_K\_Madsen](https://avatars.discourse-cdn.com/v4/letter/a/bcef8e/32.png) [@Anders\_K\_Madsen](https://rubytalk.org/u/Anders_K_Madsen)\
**Post date:** [20 July 2004 07:12 UTC](https://rubytalk.org/t/ruby-specification/12649/14 "2004-07-20T07:12:06Z")

</div>

[snippety-snip]

> I want to make sure my code stays under the BSD  
> license. Ruby's license confuses me a bit. --David Ross

Ehrm, this is just a suggestion, I'm not really into the whole licensing  
thingy, so this might not be a solution.  
But, why not get into a dialogue with matz about this?  
I mean, he must know what's right and wrong regarding the Ruby License.

And just a little note.  
I don't see why some people (e.g. Lothar) makes a problem out of someone  
wanting to make rubycc. IMO a Ruby compiler wouldn't hurt anyone. Even  
if there are some approximating the functionality around already. If  
they dislike this project, they should just ignore it and stop being so  
damn negative about it! It's not a very creative approach to anything!

I'd love to help, but unfortunately I'm most certainly not skilled  
enough for such a project.

Best regards and good luck on the project!

&nbsp;&nbsp;Madsen

> **···**
>
> On Tue, 20 Jul 2004 03:00:44 +0900 David Ross \<drossruby@yahoo.com\> wrote:
> 
> --  
> Anders K. Madsen --- [http://lillesvin.linux.dk](http://lillesvin.linux.dk)
> 
> "There are 10 types of people in the world.  
> Those who understand binary - and those who don't."

---

<div class="post-metadata">

**Author:** ![Mark10](https://avatars.discourse-cdn.com/v4/letter/m/df705f/32.png) [@Mark10](https://rubytalk.org/u/Mark10)\
**Post date:** [19 July 2004 17:49 UTC](https://rubytalk.org/t/ruby-specification/12649/15 "2004-07-19T17:49:00Z")

</div>

> yes but I intended: "you can have your own kind of gc, because ruby  
> garbage collection does not really determine the behaviour of a  
> program". If you have 3-color generational gc or simple reference counting with  
> cycle detection I think that nothing will change for the final user.  
> Anyway, I may be wrong.

I think changing to a reference counting GC system would change the behaviour of the program, since it would change when an object is collected.

I know that this subtlety has caused problems for people moving from CPython (Which uses reference counting) to Jython (which uses mark and sweep)

> **···**
>
> --  
> Mark Sparshatt

---

<div class="post-metadata">

**Author:** ![Laurent\_Julliard4](https://avatars.discourse-cdn.com/v4/letter/l/ebca7d/32.png) [@Laurent\_Julliard4](https://rubytalk.org/u/Laurent_Julliard4)\
**Post date:** [20 July 2004 09:37 UTC](https://rubytalk.org/t/ruby-specification/12649/16 "2004-07-20T09:37:11Z")

</div>

I don't think people is being "damn negative". I think everybody would  
agree that having a fastlight ruby compiler with type inference,  
runtime hotspot detection and magic based garbage collection would be  
nice.

People (me) is just pointing out that this is quite hard (as  
Cardinal, Carbone, MetaRuby, YARV, netruby and others show, ending  
such a task is really difficult, starting it is not), and that maybe  
time could be used working on matz' ruby instead of restarting from  
scratch.  
In the end I wish David Ross best luck for his own implementation,  
I'll be pleased to use it.

> **···**
>
> il Tue, 20 Jul 2004 09:07:18 +0200, "Anders K. Madsen" \<madsen@lillesvin.linux.dk\> ha scritto::
> 
> > And just a little note.  
> > I don't see why some people (e.g. Lothar) makes a problem out of someone  
> > wanting to make rubycc. IMO a Ruby compiler wouldn't hurt anyone. Even  
> > if there are some approximating the functionality around already. If  
> > they dislike this project, they should just ignore it and stop being so  
> > damn negative about it! It's not a very creative approach to anything!

---

<div class="post-metadata">

**Author:** ![Laurent\_Julliard4](https://avatars.discourse-cdn.com/v4/letter/l/ebca7d/32.png) [@Laurent\_Julliard4](https://rubytalk.org/u/Laurent_Julliard4)\
**Post date:** [19 July 2004 19:57 UTC](https://rubytalk.org/t/ruby-specification/12649/17 "2004-07-19T19:57:06Z")

</div>

CPython does reference count, while JPython should use the jvm's GC.

This problem may appear when going from refcount to gc, cause you may  
expect that an object gets gc'ed at the end of a code block (in ref  
count)while it does not (gc).  
OTOH, when you're expecting a general GC behaviour you don't make  
assumptions about the automatic deletion of an object, so this problem  
does not arise. At least, I think.

> **···**
>
> il Tue, 20 Jul 2004 02:49:00 +0900, Mark Sparshatt \<msparshatt@yahoo.co.uk\> ha scritto::
> 
> > I think changing to a reference counting GC system would change the  
> > behaviour of the program, since it would change when an object is collected.
> > 
> > I know that this subtlety has caused problems for people moving from  
> > CPython (Which uses reference counting) to Jython (which uses mark and  
> > sweep)

---

<div class="post-metadata">

**Author:** ![Mark10](https://avatars.discourse-cdn.com/v4/letter/m/df705f/32.png) [@Mark10](https://rubytalk.org/u/Mark10)\
**Post date:** [19 July 2004 20:05 UTC](https://rubytalk.org/t/ruby-specification/12649/18 "2004-07-19T20:05:38Z")

</div>

gabriele renzi wrote:

> **···**
>
> > il Tue, 20 Jul 2004 02:49:00 +0900, Mark Sparshatt \>\<msparshatt@yahoo.co.uk\> ha scritto::
> > 
> > > I think changing to a reference counting GC system would change the behaviour of the program, since it would change when an object is collected.
> > > 
> > > I know that this subtlety has caused problems for people moving from CPython (Which uses reference counting) to Jython (which uses mark and sweep)  
> > > &nbsp;&nbsp;&nbsp;  
> > > CPython does reference count, while JPython should use the jvm's GC.
> > 
> > This problem may appear when going from refcount to gc, cause you may  
> > expect that an object gets gc'ed at the end of a code block (in ref  
> > count)while it does not (gc).  
> > OTOH, when you're expecting a general GC behaviour you don't make  
> > assumptions about the automatic deletion of an object, so this problem  
> > does not arise. At least, I think.
> 
> The problem would come if someone did release an alternate implementation of Ruby with reference counting GC. Then if people who were used to alternate Ruby moved to standard ruby they might expect the same behaviour, and assume it's a bug when standard ruby behaves differently.
> 
> --  
> Mark Sparshatt

---

<div class="post-metadata">

**Author:** ![Joel\_VanderWerf1](https://avatars.discourse-cdn.com/v4/letter/j/94ad74/32.png) [@Joel\_VanderWerf1](https://rubytalk.org/u/Joel_VanderWerf1)\
**Post date:** [19 July 2004 20:19 UTC](https://rubytalk.org/t/ruby-specification/12649/19 "2004-07-19T20:19:32Z")

</div>

Mark Sparshatt wrote:

> The problem would come if someone did release an alternate implementation of Ruby with reference counting GC. Then if people who were used to alternate Ruby moved to standard ruby they might expect the same behaviour, and assume it's a bug when standard ruby behaves differently.

In my understanding, ruby makes no guarantees about memory management, except that unreferenced objects will eventually get recycled. A ruby specification should state explicitly that, aside from this guarantee, behavior is unspecified.

Of course, if programmers don't read the spec, they can still get bitten...

---

<div class="post-metadata">

**Author:** ![Laurent\_Julliard4](https://avatars.discourse-cdn.com/v4/letter/l/ebca7d/32.png) [@Laurent\_Julliard4](https://rubytalk.org/u/Laurent_Julliard4)\
**Post date:** [19 July 2004 21:22 UTC](https://rubytalk.org/t/ruby-specification/12649/20 "2004-07-19T21:22:07Z")

</div>

agreed, but given that current alghoritm is known (mark&sweep, unknown  
GC runs) I suppose the OP does not need to dwell in the internals of  
gc.c. Just my thought, anyway

> **···**
>
> il Tue, 20 Jul 2004 05:05:38 +0900, Mark Sparshatt \<msparshatt@yahoo.co.uk\> ha scritto::
> 
> > The problem would come if someone did release an alternate  
> > implementation of Ruby with reference counting GC. Then if people who  
> > were used to alternate Ruby moved to standard ruby they might expect the  
> > same behaviour, and assume it's a bug when standard ruby behaves  
> > differently.

[Next page](https://rubytalk.org/t/ruby-specification/12649.md?page=2)
