[MacRuby-devel] experimental branch: status update
Laurent Sansonetti
lsansonetti at apple.com
Fri May 29 13:45:14 PDT 2009
Hi all,
The last status was sent the 4th May, so this one is a bit lengthy. I
am sorry about that and I will try to do status updates more often.
Before listing the changes, 2 important things happened since and I
think they need to be mentioned!
- The very first RubyOnOSX conference was held in Amsterdam,
Netherlands. I had the pleasure to attend it and it was awesome. There
were about 7 presentations on Ruby on Mac OS X, most of them related
to MacRuby, and I think that all of them were filmed. Hat tips to
Fingertips (Eloy, Manfred and Thijs) for the organization. I heard
they are processing the videos right now, if you are using Twitter you
can follow http://twitter.com/fngtps for more info.
- Patrick Thompson, our intern, started working full-time from the
Cupertino offices for 3 months! He will certainly be able to push more
excellent work during this period.
And now the list of changes.
- The format string APIs were re-implemented on top of a LLVM ->
CFStringCreateWithFormat() stub.
- libffi was removed from the project build, because it's not used
anymore!
- Implemented assignment to global values in a multiple assignment
expression.
- The MacRuby Objective-C class was re-implemented.
- Finished the save of locals when a block transformed into a Proc
leaves the scope of the function where it was created.
- Implemented assignment to constants in a multiple assignment
expression.
- A HACKING file was added, for those interested into hacking MacRuby.
(It's still very preliminary).
- Implemented yield of splat arguments.
- Some work for 10.6 support. 10.6 support is almost as stable as
10.5, but it has a few caveats and it's still not ready for everyone.
- Re-implemented the way we push blocks in the VM so that it works
with some strange Ruby behavior (such as `def foo(p=Proc.new); p.call;
end; foo {}`) and also fixed numerous blocks-related bugs.
- Make sure primitive classes can be subclassed again, fixed
immutability check.
- Improved String#<< and str_modifiable() check.
- Fixed a bug when using negative indexes to Array#[] (in the
optimized primitive).
- Implemented $! as well as the way we save current exceptions in the
VM. Also fixed a few exceptions-related bugs.
- Fixed bugs in the Method class (principally making sure it's
statically linked to the method implementation) and also implemented
Method#to_proc.
- Fixed Hash.new with a block.
- IO work: some ARGF functionality, Kernel#readlines, Kernel#readline,
IO#pos, IO#read (bugfix), IO#pipe, IO#foreach, IO#sysopen, IO#bytes,
IO#lines, IO#chars, IO#stat, IO#write (bugfix), Kernel#syscall,
- Implemented a very basic AOT compiler, which is available via the --
compile command-line option of the miniruby/macruby executable. It
compiles the given Ruby expression or file into a binary, by
translating the LLVM IR into machine code, statically. The resulted
binary does not parse/compile anything anymore. This is a proof of
concept and it only supports a limited set of the Ruby language for
now, but it will be extended later.
- The big roxor.cpp source file (> 11K lines) was split into several
small files: vm.{cpp|h}, compiler.{cpp|h}, bridgesupport.{cpp|h}. The
codebase is now easier to maintain and also faster to build during
development.
- Added support for calling pure Ruby method starting with a regular
argument then an optional Hash argument.
- Fixed the internal str_new() function to not create unnecessary
Bytestring objects.
- Fixed a lazy JIT bug when dealing with modules included in modules
then included in classes.
- Fixed a bug when copying Objective-C methods upon module inclusion
that have not been resolved (non-JIT'ed) yet into subclasses.
- Fixed the overwriting of Objective-C methods accepting an argument
whose size is larger than 128-bit (ABI conformance).
- Implemented informal protocol method definition.
- Fixed several misc bugs in the compiler when compiling Objective-C
stubs.
- Ported the math.c and random.c files to the new runtime APIs.
- Ruby exceptions can now be caught by Objective-C (64-bit only).
- Define -allocWithZone: and not -alloc on every new NSObject pure
Ruby subclass (IB/nib support).
- Allow true/false to be passed as numeric C types.
As you can see lots of things changed since the last status update,
and the more relevant thing is that the project is now installable
again. You can do rake and rake install. We passed several "internal"
milestones in order to reach this point.
Also, some Cocoa support work was done and several sample code
applications work again. Some don't, but we are working on that.
The experimental branch is not ready yet to replace trunk, but I think
we are progressing well, slowly but surely.
If you are interested into installing the experimental branch, keep in
mind that:
1) It's not as stable as trunk yet, and the installation will override
your previously installed version of MacRuby. It is possible to
install experimental then switch to 0.4 by toggling the Current
symbolic link within the MacRuby.framework bundle.
2) I do not recommend doing `sudo rake install` because the branch
could have some IO regressions and nuke your environment. I recommend
doing the following to install the branch:
$ DESTDIR=/tmp/XXX rake install
$ sudo ditto /tmp/XXX /
(This way, the branch is installed into a temporary directory and the
install script is not run as root, but the temporary directory is then
merged into the system as root.)
Our next goal is to make sure we run all the samples and that we fully
work on 10.6, the upcoming Mac OS X release. Stay tuned!
Laurent
More information about the MacRuby-devel
mailing list