I didn't figure I'd even get that far...

It's mostly just for toying with the static backend, without the JIT.

On Wed, Mar 4, 2015 at 11:02 PM, Armin Rigo <arigo@tunes.org> wrote:
Hi Ryan,

On 4 March 2015 at 19:48, Ryan Gonzalez <rymg19@gmail.com> wrote:
> Not necessarily. I figured that a C++ target might look a tad nicer because
> it has built-in objects and exception handling.

Yes, this might be true for the static backend.  However, the JIT
integration would be extremely painful.  To handle, let's say, the
exceptions you get from C++, you'd need to write custom assembler that
depends on the C++ compiler you used, full of non-standard binary data
like the "eh" sections produced by gcc.  Similarly, there is no
standard way at all (as far as I know) to learn how to build a new
object from scratch (like get its vtable pointer and know where it
must be stored).  You might start by learning how they manage to do
that in other VMs (like the various JVM), but my guess is that
although they are using C++ to write the VM, all Java-level objects
are implemented by controlling the exact layout of memory, not as C++
objects at all.


A bientôt,

Armin.



--
Ryan
If anybody ever asks me why I prefer C++ to C, my answer will be simple: "It's becauseslejfp23(@#Q*(E*EIdc-SEGFAULT. Wait, I don't think that was nul-terminated."
Personal reality distortion fields are immune to contradictory evidence. - srean
Check out my website: http://kirbyfan64.github.io/