[#6143] — Christophe Poucet <christophe.poucet@...>

Hello,

17 messages 2005/10/04
[#6147] Re: patch.tgz — nobu.nokada@... 2005/10/04

Hi,

[#6199] Kernel rdoc HTML file not being created when rdoc is run on 1.8.3 — James Britt <ruby@...>

When 1.8.3 came out, I grabbed the source and ran rdoc on it. After

9 messages 2005/10/08

[#6251] RubyGems, upstream releases and idempotence of packaging — Mauricio Fern疣dez <mfp@...>

[sorry for the very late reply; I left this message in +postponed and forgot

14 messages 2005/10/12

[#6282] Wilderness: Need Code to invoke ELTS_SHARED response — "Charles E. Thornton" <ruby-core@...>

Testing the My Object Dump and I am trying to cause creation

13 messages 2005/10/14
[#6283] Re: Wilderness: Need Code to invoke ELTS_SHARED response — Mauricio Fern疣dez <mfp@...> 2005/10/14

On Fri, Oct 14, 2005 at 05:04:59PM +0900, Charles E. Thornton wrote:

[#6288] Re: Wilderness: Need Code to invoke ELTS_SHARED response — "Charles E. Thornton" <ruby-core@...> 2005/10/14

Mauricio Fern疣dez wrote:

[#6365] Time for built-in Rational and Complex classes? — Gavin Sinclair <gsinclair@...>

There has been some support for, but no comment on, RCR #260 ("Make

12 messages 2005/10/24
[#6366] Re: Time for built-in Rational and Complex classes? — "Ara.T.Howard" <Ara.T.Howard@...> 2005/10/24

On Mon, 24 Oct 2005, Gavin Sinclair wrote:

[#6405] Re: [PATCH] Pathname.exists?() — "Berger, Daniel" <Daniel.Berger@...>

12 messages 2005/10/25
[#6406] Re: [PATCH] Pathname.exists?() — TRANS <transfire@...> 2005/10/25

On 10/25/05, Berger, Daniel <Daniel.Berger@qwest.com> wrote:

[#6408] Re: [PATCH] Pathname.exists?() — Gavin Sinclair <gsinclair@...> 2005/10/25

On 10/26/05, TRANS <transfire@gmail.com> wrote:

[#6442] Wilderness: I Have formatted README.EXT into an HTML Document — "Charles E. Thornton" <ruby-core@...>

I have taken README.EXT (English Version Only) and have reformatted

14 messages 2005/10/27

[#6469] csv.rb a start on refactoring. — Hugh Sasse <hgs@...>

For a database application I found using CSV to be rather slow.

50 messages 2005/10/28
[#6470] Re: csv.rb a start on refactoring. — "Ara.T.Howard" <Ara.T.Howard@...> 2005/10/28

[#6471] Re: csv.rb a start on refactoring. — James Edward Gray II <james@...> 2005/10/28

On Oct 28, 2005, at 8:53 AM, Ara.T.Howard wrote:

[#6474] Re: csv.rb a start on refactoring. — "Ara.T.Howard" <Ara.T.Howard@...> 2005/10/28

On Fri, 28 Oct 2005, James Edward Gray II wrote:

[#6484] Re: csv.rb a start on refactoring. — James Edward Gray II <james@...> 2005/10/29

On Oct 28, 2005, at 9:58 AM, Ara.T.Howard wrote:

[#6485] Re: csv.rb a start on refactoring. — "Ara.T.Howard" <Ara.T.Howard@...> 2005/10/29

On Sat, 29 Oct 2005, James Edward Gray II wrote:

[#6486] Re: csv.rb a start on refactoring. — James Edward Gray II <james@...> 2005/10/29

On Oct 28, 2005, at 8:25 PM, Ara.T.Howard wrote:

[#6487] Re: csv.rb a start on refactoring. — "Ara.T.Howard" <Ara.T.Howard@...> 2005/10/29

On Sat, 29 Oct 2005, James Edward Gray II wrote:

[#6491] Re: csv.rb a start on refactoring. — James Edward Gray II <james@...> 2005/10/29

On Oct 28, 2005, at 8:43 PM, Ara.T.Howard wrote:

[#6493] Re: csv.rb a start on refactoring. — James Edward Gray II <james@...> 2005/10/29

On Oct 28, 2005, at 10:06 PM, James Edward Gray II wrote:

[#6496] Re: csv.rb a start on refactoring. — "Ara.T.Howard" <Ara.T.Howard@...> 2005/10/29

On Sun, 30 Oct 2005, James Edward Gray II wrote:

[#6502] Re: csv.rb a start on refactoring. — James Edward Gray II <james@...> 2005/10/30

On Oct 29, 2005, at 12:11 PM, Ara.T.Howard wrote:

[#6505] Re: csv.rb a start on refactoring. — "Ara.T.Howard" <Ara.T.Howard@...> 2005/10/30

On Mon, 31 Oct 2005, James Edward Gray II wrote:

[#6511] Planning FasterCSV (was Re: csv.rb a start on refactoring.) — James Edward Gray II <james@...> 2005/10/30

I've decided to create a FasterCSV library, based on the code we

[#6516] Re: Planning FasterCSV (was Re: csv.rb a start on refactoring.) — "Ara.T.Howard" <Ara.T.Howard@...> 2005/10/31

On Mon, 31 Oct 2005, James Edward Gray II wrote:

[#6518] Re: Planning FasterCSV (was Re: csv.rb a start on refactoring.) — "NAKAMURA, Hiroshi" <nakahiro@...> 2005/10/31

-----BEGIN PGP SIGNED MESSAGE-----

c++ Compileability and bugs in 1.9

From: Christophe Poucet <christophe.poucet@...>
Date: 2005-10-04 15:14:40 UTC
List: ruby-core #6140
Hello,

I will repost my comments here because I think here would be more suitable
than on the NG (comp.lang.ruby).
I'm interested in inserting certain profiling templates into ruby for some
experiments. This means that ruby must be c++-compileable. I started using
1.9 instead of 1.8 because I noticed a large effort had been made to step
away from K&R function syntax to ANSI C function syntax, for which I am
glad. After struggling with the compiler for a bit I finally managed to make
it compile in c++. The steps that were required to achieve this were:
1) make sure that all .c and .h files include something like
#if defined(__cplusplus)
extern "C" {
#endif
... code
#if defined(__cplusplus)
}
#endif
2) Make sure there are no typing errors. C++ is a lot stricter on types.
Therefore I made some changes here and there to functions that took no
arguments but were designated as /* ??? */ and made them take ANYARGS. I
then declared the following helper functions in ruby.h
#define VALUEFUNC(f) ((VALUE (*)(ANYARGS))f)
#define VOIDFUNC(f) ((void (*)(ANYARGS))f)
#define INTFUNC(f) ((int (*)(ANYARGS))f)
In hindsight I could probably reduce all these to a single macro. These were
then used to remove type-problems such as:
rb_define_method(rb_cArray, "==", rb_ary_equal, 1);
By transforming that into
rb_define_method(rb_cArray, "==", VALUEFUNC(rb_ary_equal), 1);

A few (I can't remember if it's 1 or 2) structs tables had to be changed to
take functions that take ANYARGS instead of no parameters.
3) The last major effort was in regular expressions where the usage of
unsigned char *, char* and UChar * flow through each other. I just followed
the compiler and added appropriate casts.
4) At certain points -1 is returned even though it's long, where I just
added a cast. Also in certain places K&R syntax was still used

If you would like I could send a patch with these changes. However someone
would have to look at the changes of point 1) and 4) to make sure they are
consequential, I was just trying to get it done, not to get it done cleanly.
I have only done this for ruby itself, not for the ext/ folder. I started
doing it but then there were some issues with the makefiles in regards to
bigdecimal which led to the failure of any further ext's being compiled.

As was mentioned, I could link in C++ code easily. But that is not the
point, I want to use my templates WITHIN the code of the interpreter to
measure certain things. That is why I wanted it C++ compileable. I think
this is a worthy effort that could be placed into CVS because it does
alleviate future problems.

One issue I had is that array test 37 and 38 (sample/test.rb 804 and 808)
failed. Is this due to my changes or is this due to ruby 1.9? I'll try to
compare but sadly I'm having issues keeping an active version of ruby on my
computer at work given the fact that I'm firewalled and hence can not access
your cvs port

With regards,
Christophe Poucet

In This Thread

Prev Next