Re: [shoes] Moving code from C to Ruby
- From:
- Steve Klabnik
- Date:
- 2012-01-05 @ 19:56
Okay, so I have a first version up here:
https://github.com/shoes/shoes/tree/c_to_ruby
The strangest thing is happening to me, though: it's not actually
running my Ruby. Even though I pulled out all of the C, when I run
this program:
Shoes.app do
c1 = rgb 255, 120, 0
c2 = rgb 0, 255, 120
c3 = rgb 255, 120, 0
c4 = rgb 20, 20, 20
stack do
if c1 == c2
para "c1 == c2 (undesired behaviour)"
else
para "c1 != c2 (desired behaviour)"
end
if c1 == c3
para "c1 == c3 (desired behaviour)"
else
para "c1 != c3 (undesired behaviour)"
end
if c1 > c4
para "c1 > c4 (desired behaviour)"
else
para "c1 <= c4 (undesired behaviour)"
end
end
end
I get the old C behavior. Not my new Ruby behavior. I put alerts into
the Ruby, and they don't show up either.
Am I missing something? I did the whole clean thing, rebuilt, all of
that. The Ruby code does show up in the resulting .app.
Re: [shoes] Moving code from C to Ruby
- From:
- Chuck Remes
- Date:
- 2012-01-05 @ 21:21
On Jan 5, 2012, at 1:56 PM, Steve Klabnik wrote:
> Okay, so I have a first version up here:
> https://github.com/shoes/shoes/tree/c_to_ruby
>
> The strangest thing is happening to me, though: it's not actually
> running my Ruby. Even though I pulled out all of the C, when I run
> this program:
>
> Am I missing something? I did the whole clean thing, rebuilt, all of
> that. The Ruby code does show up in the resulting .app.
It's possible that the makefile is fubar. You should remove the *.o files by hand.
% find ./path/to/topoftree -name "*.o" -print0 | xargs -0 rm
And then try building again.
cr
Re: [shoes] Moving code from C to Ruby
- From:
- Steve Klabnik
- Date:
- 2012-01-05 @ 21:25
There aren't any .o files. I hand-rm'd dist/.
Re: [shoes] Moving code from C to Ruby
- From:
- Tobias Pfeiffer
- Date:
- 2012-01-05 @ 21:27
I'll try to give it a try tomorrow
On 01/05/2012 10:25 PM, Steve Klabnik wrote:
> There aren't any .o files. I hand-rm'd dist/.
Re: [shoes] Moving code from C to Ruby
- From:
- Steve Klabnik
- Date:
- 2012-01-05 @ 21:29
> I'll try to give it a try tomorrow
Awesome. Note that it's still failing on Travis:
http://travis-ci.org/#!/shoes/shoes/builds/482673
So you might need to do a little bit of screwing around with it, if
you're doing stuff on Linux or Windows.
Re: [shoes] Moving code from C to Ruby
- From:
- Tobias Pfeiffer
- Date:
- 2012-01-06 @ 23:57
On 01/05/2012 10:29 PM, Steve Klabnik wrote:
>> I'll try to give it a try tomorrow
> Awesome. Note that it's still failing on Travis:
> http://travis-ci.org/#!/shoes/shoes/builds/482673
>
> So you might need to do a little bit of screwing around with it, if
> you're doing stuff on Linux or Windows.
With my lack of knowledge of the concrete shoes implementation and C
screwing around unfortunately isn't so easy, I get the following error:
https://gist.github.com/1573067
I believe it's the following line:
shoes/native/gtk.c:1196:46: error: ‘cColor’ undeclared (first use in
this function)
I guess I need to tell shoes somewhere to use the ruby version instead
of the C version - but where?
Thanks and good night everyone!
Tobi
Re: [shoes] Moving code from C to Ruby
- From:
- Steve Klabnik
- Date:
- 2012-01-07 @ 01:58
Ah! add a 'extern VALUE cColor' to the top of gtk.h
Re: [shoes] Moving code from C to Ruby
- From:
- Tobias Pfeiffer
- Date:
- 2012-01-11 @ 16:39
Sorry for being so late, lots of university stuff to do...
There is no gtk.h :-( I put it in native.h instead (I hope that's ok?)
but I still get an error
(where I as a non Cer thin the error comes from)
shoes/native/gtk.c:1094:15: error: ‘_color’ undeclared (first use in
this function)
(full error log for more knoledgable people)
https://gist.github.com/1595531
Tobi
On 01/07/2012 02:58 AM, Steve Klabnik wrote:
> Ah! add a 'extern VALUE cColor' to the top of gtk.h
Re: [shoes] Moving code from C to Ruby
- From:
- Tobias Pfeiffer
- Date:
- 2012-01-05 @ 21:35
On 01/05/2012 10:29 PM, Steve Klabnik wrote:
>> I'll try to give it a try tomorrow
> Awesome. Note that it's still failing on Travis:
> http://travis-ci.org/#!/shoes/shoes/builds/482673
>
> So you might need to do a little bit of screwing around with it, if
> you're doing stuff on Linux or Windows.
Linux. First finishing a paper until 16:00 and explaining why I think
that the task is bad and hasn't been thought through, then meetup with
friends and then some open source, sounds like a good day ;-)