Martin Kleberma? wrote:
i have bought a new MacBook and i would look forward for PolyML on Intel based Macs.
As i heard from Prof. Nipkow there are some problems with signaling or so on the intel based macs, so that it doesnt compile.
Back in March Tobias had an Intel Mac on loan for a short while and I tried to get Poly/ML running on it. There were a few minor problems and one major one. The minor problems were to do with a few operating system dependencies and also that OS X on the i386 seemed to require the stack pointer to be aligned on a 16-byte boundary, requiring a tweaks to the IO_CALL macros in the assembly code segment.
The major problem had to do with the way Poly/ML checks for heap overflow on the i386 (and also stack overflow, but that's less of an issue). Whenever an object (e.g. a tuple or list cell) is created on the heap the heap pointer is adjusted and a check needs to be made that the heap isn't full. The i386 code generator uses the i386 BOUND instruction for this. This instruction was presumably introduced to check a value against array bounds before indexing into an array. It checks a register contents against two limits and generates a trap if it is outside the range. On all the other Unix systems, Linux, FreeBSD etc this results in a signal, either SIGSEGV or SIGFPE, and on Windows it results in an exception. These can be caught and handled and so Poly/ML uses this as a way of indicating that there is a need to garbage collect. When I tested this on Mac OS X it didn't seem to work. The Mach kernel appeared to get the trap but didn't pass this on as a signal and the application would just hang. This is really a bug in Mac OS X but I think the only option is to change the code-generator to replace the BOUND instruction with a test, branch and explicit call into the run-time system.
I expect to be working on the run-time system and the code-generator over the summer as part of a project to get Poly/ML on the AMD 64-bit machine. The Intel Mac isn't explicitly part of this but I may have a chance to look into it. In the meantime you can either make the changes yourself or use the portable interpreted version. That version will also need a few operating system dependent changes but those are quite minor.
David.