[plt-scheme] two questions about extensions and 3m under 372

From: Eric Kidd (eric.kidd at iml.dartmouth.edu)
Date: Sat May 3 12:00:02 EDT 2008

On Fri, May 2, 2008 at 10:45 PM, Neil Van Dyke <neil at neilvandyke.org> wrote:
> 1. What experiences have people had moving their existing MzScheme
> extensions from CGC to 3m?

We were emebedding mzscheme CGC in our C++ application, and converted
manually to 3m. We saw performance improvements of around 50-200%.

We were unable to use the MZ_GC_REG macros, because they're not
compatible with C++ exceptions. So we build a limited C++ framework
for managing the GC stack.

Our recommendation: Don't try to insert MZ_GC_REG manually. Our C++
API is a bit easier to use than standard MZ_GC_REG, and it was still a
non-trivial amount of work to convert 1700 lines of code. (And we
suspect that we introduced at least one rare crashing bug that we're
still tracking down.) The 'mzc --xform' tool looks much easier to use.

> (Perhaps it's
> easier to write for 3m from the start, rather than have a different
> programmer convert after the fact.)

Honestly, I think that the 3m API is extremely difficult to use
safely, whether you use it from day, or convert later.

However, if you can incorporate 'mzc --xform' into your build process,
I suspect that you'll have reasonable results. The 'mzc --xform' tool
is used for the mzscheme interpreter itself without any apparent



Posted on the users mailing list.