[MacRuby-devel] Bitfields and arrays in structures

2010-01-04 Thread Steven Canfield

Hello all,
I'm new to MacRuby so please bear with me. Yesterday I was going  
through the buglist and happened upon bug #280 (https://www.macruby.org/trac/ticket/280 
) "NSNumber#decimalValue cant convert to ruby object". I created an  
objective c file to print out the method signature and I got this:

{?=b8b4b1b1b18[8s]...@0:8
(The ? would be replaced by NSDecimal_ when in MacRuby)

The initial problem is happening inside of RoxorCompiler::convert_type  
(compiler.cpp) which doesn't handle the _C_BFLD type. Upon some  
further testing, it also doesn't handle the [8S] part (array of 8  
short), which is also bug #178  (https://www.macruby.org/trac/ticket/ 
178). So it seems like I need to add bitfield and structure array  
support.


My question is, how is all of this supposed to be represented. I  
assume the arrays part can just be ArrayType, while we probably want  
to treat a bitfield declaration as just a regular structure, i.e.


typedef struct {
signed   int _exponent:8;
unsigned int _length:4; // length == 0 && isNegative -> NaN
unsigned int _isNegative:1;
unsigned int _isCompact:1;
unsigned int _reserved:18;
unsigned short _mantissa[NSDecimalMaxSize];
} NSDecimal;

would be interpreted as

typedef struct {
signed   int _exponent;
unsigned int _length; // length == 0 && isNegative -> NaN
unsigned int _isNegative;
unsigned int _isCompact;
unsigned int _reserved;
unsigned short _mantissa[NSDecimalMaxSize];
} NSDecimal;

The only problem I see with this is that we have to convert back to  
NSDecimal packing on return. Maybe it would be better to have a ruby  
class that provides accessors to the NSDecimal similar to Boxed (or  
modify Boxed to handle this situation).


Just looking for a little bit of guidance,
-Steve

___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] BirdWatch: Twitter search client written in MacRuby

2010-01-04 Thread Jeremy Johnstone
That is really kickass!

-Jeremy

(I promise I am not biased just because my name is in the screenshot of
search results)

On Sun, Jan 3, 2010 at 4:51 PM, isaac kearse  wrote:

> Hey Everyone,
>
> I just released a MacRuby app that has been sitting on my hard drive for
> too long.
> You can read about it here:
> http://isaac.kearse.co.nz/2010/01/01/birdwatch/
> and get the source here: http://github.com/isaac/BirdWatch
>
> Let me know what you think.
>
> Cheers,
> Isaac
>
>
> ___
> MacRuby-devel mailing list
> [email protected]
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>
>
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] [MacRuby] #526: Can't compile r3157 in 10.5 (Leopard)

2010-01-04 Thread MacRuby
#526: Can't compile r3157 in 10.5 (Leopard)
--+-
 Reporter:  ko...@…   |Owner:  lsansone...@…
 Type:  defect|   Status:  closed   
 Priority:  critical  |Milestone:  MacRuby 0.5  
Component:  MacRuby   |   Resolution:  fixed
 Keywords:|  
--+-
Changes (by lsansone...@…):

  * status:  new => closed
  * resolution:  => fixed


Comment:

 Sorry for the late reply, patch applied as r3184. Thanks a lot :)

-- 
Ticket URL: 
MacRuby 

___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] [MacRuby] #237: NSConnection cause crash

2010-01-04 Thread MacRuby
#237: NSConnection cause crash
---+
 Reporter:  qe...@…|Owner:  lsansone...@…
 Type:  defect |   Status:  closed   
 Priority:  major  |Milestone:  MacRuby 0.5  
Component:  MacRuby|   Resolution:  fixed
 Keywords:  NSConection|  
---+
Changes (by lsansone...@…):

  * status:  new => closed
  * resolution:  => fixed


Comment:

 Closing.

-- 
Ticket URL: 
MacRuby 

___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] [MacRuby] #509: Beta 0.5 does not allow methods with more than 11 arguments

2010-01-04 Thread MacRuby
#509: Beta 0.5 does not allow methods with more than 11 arguments
---+
 Reporter:  johnmacs...@…  |   Owner:  lsansone...@…
 Type:  defect |  Status:  new  
 Priority:  minor  |   Milestone:  MacRuby 0.5  
Component:  MacRuby|Keywords:   
---+
Changes (by lsansone...@…):

  * milestone:  => MacRuby 0.5


Comment:

 That's a limitation of our dispatcher. We should address that.

-- 
Ticket URL: 
MacRuby 

___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] [MacRuby] #528: Improve Tail Call Elimination

2010-01-04 Thread MacRuby
#528: Improve Tail Call Elimination
-+--
 Reporter:  haruki.zae...@…  |   Owner:  lsansone...@…  
   
 Type:  enhancement  |  Status:  new
   
 Priority:  minor|   Milestone: 
   
Component:  MacRuby  |Keywords:  tail call elimination 
optimisation tco
-+--

Comment(by lsansone...@…):

 We should be able to do much more sophisticated tall call elimination with
 the new VM changes I'm working on (which allow method inlining). I will
 investigate that, for 0.6.

-- 
Ticket URL: 
MacRuby 

___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] [MacRuby] #535: hotcocoa, and NoMethodError with a prelude of error messages.

2010-01-04 Thread MacRuby
#535: hotcocoa, and NoMethodError with a prelude of error messages.
-+--
 Reporter:  r...@…|Owner:  lsansone...@…
 Type:  defect   |   Status:  closed   
 Priority:  blocker  |Milestone:  MacRuby 0.5  
Component:  MacRuby  |   Resolution:  duplicate
 Keywords:  hotcocoa |  
-+--
Changes (by lsansone...@…):

  * status:  new => closed
  * resolution:  => duplicate


Comment:

 Dup of #443

-- 
Ticket URL: 
MacRuby 

___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] [MacRuby] #443: included method in an included module don't get defined in the extended object

2010-01-04 Thread MacRuby
#443: included method in an included module don't get defined in the extended
object
-+--
 Reporter:  mattaimone...@…  |   Owner:  lsansone...@…
 Type:  defect   |  Status:  new  
 Priority:  blocker  |   Milestone:  MacRuby 0.5  
Component:  MacRuby  |Keywords:   
-+--

Comment(by lsansone...@…):

 Added test_vm test in r3185.

-- 
Ticket URL: 
MacRuby 

___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] [MacRuby] #375: MacRuby 0.5 beta 1 HotCocoa examples seg fault

2010-01-04 Thread MacRuby
#375: MacRuby 0.5 beta 1 HotCocoa examples seg fault
-+--
 Reporter:  macr...@…|   Owner:  lsansone...@…
 Type:  defect   |  Status:  new  
 Priority:  blocker  |   Milestone:   
Component:  MacRuby  |Keywords:   
-+--

Comment(by lsansone...@…):

 HotCocoa's Calculator.app, although returning 1 for all operations (hehe)
 does not crash for me.

-- 
Ticket URL: 
MacRuby 

___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] [MacRuby] #443: included method in an included module don't get defined in the extended object

2010-01-04 Thread MacRuby
#443: included method in an included module don't get defined in the extended
object
-+--
 Reporter:  mattaimone...@…  |Owner:  lsansone...@…
 Type:  defect   |   Status:  closed   
 Priority:  blocker  |Milestone:  MacRuby 0.5  
Component:  MacRuby  |   Resolution:  fixed
 Keywords:   |  
-+--
Changes (by lsansone...@…):

  * status:  new => closed
  * resolution:  => fixed


Comment:

 Should be fixed by r3186.

-- 
Ticket URL: 
MacRuby 

___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] [MacRuby] #247: Hotcocoa Graphics tests don't run

2010-01-04 Thread MacRuby
#247: Hotcocoa Graphics tests don't run
+---
 Reporter:  dave.bald...@…  |Owner:  lsansone...@…
 Type:  defect  |   Status:  closed   
 Priority:  major   |Milestone:  MacRuby 0.5  
Component:  MacRuby |   Resolution:  fixed
 Keywords:  Hotcocoa Graphics   |  
+---
Changes (by lsansone...@…):

  * status:  new => closed
  * resolution:  => fixed
  * milestone:  => MacRuby 0.5


Comment:

 HotCocoa/graphics/demo.rb as of r3180 works as expected. I suspect this
 bug was fixed a long time ago, so I'm closing this entry. Let us know if
 it's still broken for you.

-- 
Ticket URL: 
MacRuby 

___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] [MacRuby] #366: Hotcocoa 'demo' crashes

2010-01-04 Thread MacRuby
#366: Hotcocoa 'demo' crashes
+---
 Reporter:  dave.bald...@…  |Owner:  lsansone...@…
 Type:  defect  |   Status:  closed   
 Priority:  blocker |Milestone:   
Component:  MacRuby |   Resolution:  worksforme   
 Keywords:  |  
+---
Changes (by lsansone...@…):

  * status:  new => closed
  * resolution:  => worksforme


Comment:

 It works as of r3180, however I get the following in the terminal once I
 try switching tabs

 {{{
 2010-01-04 14:43:34.190 miniruby[1864:903] *** -[NSArray objectAtIndex:]:
 index (0) beyond bounds (0)
 2010-01-04 14:43:35.769 miniruby[1864:903]
 # is not a subview of
 # and cannot be removed.
 2010-01-04 14:43:38.265 miniruby[1864:903]
 # is not a subview of
 # and cannot be removed.
 2010-01-04 14:43:42.936 miniruby[1864:903]
 # is not a subview of
 # and cannot be removed.
 2010-01-04 14:43:43.290 miniruby[1864:903]
 # is not a subview of
 # and cannot be removed.
 }}}

 I suspect these are not MacRuby bugs but bugs in HotCocoa. So I'm closing
 this entry.

-- 
Ticket URL: 
MacRuby 

___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] [MacRuby] #528: Improve Tail Call Elimination

2010-01-04 Thread MacRuby
#528: Improve Tail Call Elimination
-+--
 Reporter:  haruki.zae...@…  |   Owner:  lsansone...@…  
   
 Type:  enhancement  |  Status:  new
   
 Priority:  minor|   Milestone: 
   
Component:  MacRuby  |Keywords:  tail call elimination 
optimisation tco
-+--

Comment(by haruki.zae...@…):

 Replying to [comment:13 lsansone...@…]:
 > We should be able to do much more sophisticated tall call elimination
 with the new VM changes I'm working on (which allow method inlining). I
 will investigate that, for 0.6.

 Sounds great. My C++ is 15 years old so I suspect I'm of no help. Thanks
 for listening anyway :)

-- 
Ticket URL: 
MacRuby 

___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] [MacRuby] #528: Improve Tail Call Elimination

2010-01-04 Thread Jeremy Voorhis
So, can the TCO elimination pass actually perform TCO for mutually recursive
methods and the compiler just isn't phrasing method invocations in a
compatible way? Also, better method inlining support is awesome, but my
intuition tells me that there isn't a lot of overlap between implementing
TCO and inlining. Laurent, is there something I can learn from this? :)

Best,

Jeremy

On Mon, Jan 4, 2010 at 2:50 PM, MacRuby  wrote:

> #528: Improve Tail Call Elimination
>
> -+--
>  Reporter:  haruki.zae...@…  |   Owner:  lsansone...@…
> Type:  enhancement  |  Status:  new
>  Priority:  minor|   Milestone:
> Component:  MacRuby  |Keywords:  tail call elimination
> optimisation tco
>
> -+--
>
> Comment(by haruki.zae...@…):
>
>  Replying to [comment:13 lsansone...@…]:
>  > We should be able to do much more sophisticated tall call elimination
>  with the new VM changes I'm working on (which allow method inlining). I
>  will investigate that, for 0.6.
>
>  Sounds great. My C++ is 15 years old so I suspect I'm of no help. Thanks
>  for listening anyway :)
>
> --
> Ticket URL: 
> MacRuby 
>
>
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] [MacRuby] #375: MacRuby 0.5 beta 1 HotCocoa examples seg fault

2010-01-04 Thread MacRuby
#375: MacRuby 0.5 beta 1 HotCocoa examples seg fault
-+--
 Reporter:  macr...@…|Owner:  lsansone...@…
 Type:  defect   |   Status:  closed   
 Priority:  blocker  |Milestone:  MacRuby 0.5  
Component:  MacRuby  |   Resolution:  fixed
 Keywords:   |  
-+--
Changes (by lsansone...@…):

  * status:  new => closed
  * resolution:  => fixed
  * milestone:  => MacRuby 0.5


Comment:

 Result fixed as r3187, closing this bug.

-- 
Ticket URL: 
MacRuby 

___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] [MacRuby] #94: Bug with non-ASCII in the regular expressions

2010-01-04 Thread MacRuby
#94: Bug with non-ASCII in the regular expressions
+---
 Reporter:  vincent.isamb...@…  |   Owner:  lsansone...@…
 Type:  defect  |  Status:  new  
 Priority:  blocker |   Milestone:  MacRuby 0.5  
Component:  MacRuby |Keywords:   
+---
Changes (by lsansone...@…):

  * milestone:  MacRuby 0.4 => MacRuby 0.5


-- 
Ticket URL: 
MacRuby 

___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] [MacRuby] #474: Sinatra's get method not being registered

2010-01-04 Thread MacRuby
#474: Sinatra's get method not being registered
+---
 Reporter:  c...@…   |Owner:  lsansone...@…
 Type:  defect  |   Status:  closed   
 Priority:  trivial |Milestone:   
Component:  MacRuby |   Resolution:  invalid  
 Keywords:  |  
+---

Comment(by russm-trac-macports-...@…):

 FYI: this is not a sinatra bug, but a problem with calling your test case
 {{{sinatra.rb}}}

 the load path by default includes {{{.}}} (the current directory) before
 the gem directory, so when you "{{{require 'sinatra'}}}" ruby (either MRI
 or MacRuby) just re-loads your test file and the actual sinatra framework
 in never loaded. try changing the name of your test case.

-- 
Ticket URL: 
MacRuby 

___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] [MacRuby] #94: Bug with non-ASCII in the regular expressions

2010-01-04 Thread MacRuby
#94: Bug with non-ASCII in the regular expressions
+---
 Reporter:  vincent.isamb...@…  |Owner:  lsansone...@…
 Type:  defect  |   Status:  closed   
 Priority:  blocker |Milestone:  MacRuby 0.5  
Component:  MacRuby |   Resolution:  fixed
 Keywords:  |  
+---
Changes (by lsansone...@…):

  * status:  new => closed
  * resolution:  => fixed


Comment:

 Fixed in r3189.

 {{{
 $ cat t.rb
 # encoding: utf-8
 p 'あ'.match(/あ/)
 p 'あいあいあいあいあ'.scan(/あ/)
 $ ./miniruby t.rb
 #
 ["あ", "あ", "あ", "あ", "あ"]
 }}}

-- 
Ticket URL: 
MacRuby 

___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] [MacRuby] #540: segfault with NSURLDownload with GC on

2010-01-04 Thread MacRuby
#540: segfault with NSURLDownload with GC on
-+--
 Reporter:  mattaimone...@…  |   Owner:  lsansone...@…
 Type:  defect   |  Status:  new  
 Priority:  major|   Milestone:  MacRuby 0.5  
Component:  MacRuby  |Keywords:  NSURLDownload, Cocoa 
-+--
Changes (by mattaimone...@…):

  * keywords:  => NSURLDownload, Cocoa
  * owner:  mattaimone...@… => lsansone...@…


Old description:

> Script:
> https://gist.github.com/96954a4e59f1293977c0
>
> Backtrace:
> {{{
> Application Specific Information:
> objc_msgSend() selector name: _downloadActive
> objc[74889]: garbage collection is ON
>
> Thread 0 Crashed:  Dispatch queue: com.apple.main-thread
> 0   libobjc.A.dylib 0x7fff8821011c objc_msgSend +
> 40
> 1   com.apple.Foundation0x7fff84db156d
> _NSURLDownloadDidReceiveData + 45
> 2   com.apple.CFNetwork 0x7fff8143b50f
> URLDownload::sendClientDidReceiveData(long, long, long) + 83
> 3   com.apple.CFNetwork 0x7fff8143cd9c
> ___asyncWrite_block_invoke_4 + 121
> 4   com.apple.CoreFoundation0x7fff8060c1b9
> __CFRunLoopDoBlocks + 297
> 5   com.apple.CoreFoundation0x7fff805cece6 __CFRunLoopRun
> + 3046
> 6   com.apple.CoreFoundation0x7fff805cdc2f
> CFRunLoopRunSpecific + 575
> 7   com.apple.Foundation0x7fff84c94a24
> -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 270
> 8   com.apple.Foundation0x7fff84ce048a
> -[NSRunLoop(NSRunLoop) runUntilDate:] + 78
> 9   ??? 0x0001011005fc 0 + 4312794620
>
> Thread 1:  Dispatch queue: com.apple.libdispatch-manager
> 0   libSystem.B.dylib   0x7fff8650cbba kevent + 10
> 1   libSystem.B.dylib   0x7fff8650ea85
> _dispatch_mgr_invoke + 154
> 2   libSystem.B.dylib   0x7fff8650e75c
> _dispatch_queue_invoke + 185
> 3   libSystem.B.dylib   0x7fff8650e286
> _dispatch_worker_thread2 + 244
> 4   libSystem.B.dylib   0x7fff8650dbb8
> _pthread_wqthread + 353
> 5   libSystem.B.dylib   0x7fff8650da55 start_wqthread
> + 13
>
> Thread 2:
> 0   libSystem.B.dylib   0x7fff8650d9da
> __workq_kernreturn + 10
> 1   libSystem.B.dylib   0x7fff8650ddec
> _pthread_wqthread + 917
> 2   libSystem.B.dylib   0x7fff8650da55 start_wqthread
> + 13
>
> Thread 3:
> 0   libSystem.B.dylib   0x7fff8650d9da
> __workq_kernreturn + 10
> 1   libSystem.B.dylib   0x7fff8650ddec
> _pthread_wqthread + 917
> 2   libSystem.B.dylib   0x7fff8650da55 start_wqthread
> + 13
>
> Thread 4:
> 0   libSystem.B.dylib   0x7fff864f3e3a mach_msg_trap
> + 10
> 1   libSystem.B.dylib   0x7fff864f44ad mach_msg + 59
> 2   com.apple.CoreFoundation0x7fff805ce7a2 __CFRunLoopRun
> + 1698
> 3   com.apple.CoreFoundation0x7fff805cdc2f
> CFRunLoopRunSpecific + 575
> 4   com.apple.Foundation0x7fff84cd94cf
> +[NSURLConnection(NSURLConnectionReallyInternal) _resourceLoadLoop:] +
> 297
> 5   com.apple.Foundation0x7fff84c59e99
> __NSThread__main__ + 1429
> 6   libSystem.B.dylib   0x7fff8652cf8e _pthread_start
> + 331
> 7   libSystem.B.dylib   0x7fff8652ce41 thread_start +
> 13
>
> Thread 5:
> 0   libSystem.B.dylib   0x7fff8650d9da
> __workq_kernreturn + 10
> 1   libSystem.B.dylib   0x7fff8650ddec
> _pthread_wqthread + 917
> 2   libSystem.B.dylib   0x7fff8650da55 start_wqthread
> + 13
>
> Thread 6:
> 0   libSystem.B.dylib   0x7fff865379e2
> select$DARWIN_EXTSN + 10
> 1   com.apple.CoreFoundation0x7fff805f0242
> __CFSocketManager + 818
> 2   libSystem.B.dylib   0x7fff8652cf8e _pthread_start
> + 331
> 3   libSystem.B.dylib   0x7fff8652ce41 thread_start +
> 13
> }}}
>
> works fine with GC_DISABLE=1
>
> ---
>
> TODO: Rewrite the script in pure objc, compile with -fobjc-gc and see if
> it's a MacRuby bug or a Cocoa bug.

New description:

 Script:
 https://gist.github.com/96954a4e59f1293977c0

 Backtrace:
 {{{
 Application Specific Information:
 objc_msgSend() selector name: _downloadActive
 objc[74889]: garbage collection is ON

 Thread 0 Crashed:  Dispatch queue: com.apple.main-thread
 0   libobjc.A.dylib 0x7fff8821011c objc_msgSend +
 40
 1   com.apple.Foundation0x7fff84db156d
 _NSURLDownloadDidReceiveData + 45
 2   com.apple.CFNetwork 0x7f

Re: [MacRuby-devel] [MacRuby] #540: segfault with NSURLDownload with GC on

2010-01-04 Thread MacRuby
#540: segfault with NSURLDownload with GC on
-+--
 Reporter:  mattaimone...@…  |   Owner:  lsansone...@…
 Type:  defect   |  Status:  new  
 Priority:  major|   Milestone:  MacRuby 0.5  
Component:  MacRuby  |Keywords:  NSURLDownload, Cocoa 
-+--

Comment(by cha...@…):

 One potential issue with the macruby example code is passing 'self' as the
 delegate to the NSURLDownload instance.  Maybe it's supposed to work, but
 since the delegate methods are defined in the top level namespace, I
 wasn't sure what the self instance actually refers to (?):

 {{{
 $ macruby -e 'p self' # => main
 $ macruby -e 'p self.class' #=> TopLevel
 }}}

 I modified the gist example code to move the delegate methods inside of a
 Test class and then passed an instance of that class as the delegate to
 NSURLDownload.  The new version no longer crashes during download:

 https://gist.github.com/d5d8f8a5208fa4a4d94c

-- 
Ticket URL: 
MacRuby 

___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel