[MacRuby-devel] experimental branch: status update
Laurent Sansonetti
lsansonetti at apple.com
Mon May 4 15:35:18 PDT 2009
Here is the weekly status update of the experimental branch! I'm sure
you were all expecting it and holding your breath!
- Implemented BridgeSupport constants, in a lazy fashion (the symbol
is retrieved and converted at demand).
- The Pointer class was re-implemented. Same behavior as in trunk but
with a new implementation, based on LLVM. Also, a few changes:
- Pointer.new is now an alias to Pointer.new_with_type
- The first argument can be a symbol instead of the Objective-C
runtime encoding type. Symbols currently supported: char, uchar,
short, ushort, int, uint, long, ulong, long_long, ulong_long, float,
double, string, pointer and object (which is @). These are the same
types as used in the FFI API, by the way.
- The second argument (optional) can be used to allocate a C array
style pointer. The default value is 1.
- #[]= was added to set a given Ruby object at the given slot. Note
that it does not check bounds. #assign is a shortcut to #[]= with the
first argument (slot index) as 0.
- #type was added, which returns the Objective-C runtime encoding
type.
- Incoming pointers passed to an underlying C or Objective-C method
will be checked for their type, and a TypeError exception will be
raised if they do not match.
- Blocks:
- Using a block non-recursively should be faster (yay). If used
recursively, some bugs have been fixed.
- Local or dynamic variables in blocks transformed to Proc objects
and leaving the scope of the method where they were created are now
working (re-yay). The implementation does not impact the runtime
performance of methods using blocks that do not leave their scope.
- Ruby methods are now registered into the Objective-C runtime via a
specialized stub that we compile at demand, which takes care of
dealing with Ruby immediate objects or C types. This means all Ruby
methods can now be called from Objective-C and can also overwrite any
Objective-C methods. We can pass more Cocoa examples thanks to that.
- Support for CoreFoundation types (same behavior as in trunk).
- RubySpec was merged from upstream + more Encoding specs work!
At this point Cocoa support is looking great and the next step will be
to work on the project's installation. Once it can install itself, we
can progress and start working on running real MacRuby apps (+
HotCocoa).
Laurent
More information about the MacRuby-devel
mailing list