
31 Jul
2010
31 Jul
'10
8:52 p.m.
And note that we wouldn't need unsafePerformIO for the FFI if all programs were made in Haskell ;).
Perhaps that's true, though entirely unrealistic, in the application world. In the OS world you need access to machine registers and special instructions (CR3 anyone? CP15?) which isn't built into any language save assembly - for these FFI will always come in handy. Also, Haskell continues to have an unfortunate lack of primitives suitable for casting types (ex: zero copy form a bytestring like entity to Word32s). In this realm FFI can outperform cleaner looking code that must rely on individual byte reads. Cheers, Thomas