
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Neil Mitchell wrote:
Hi Isaac,
Me and Andrew have spent some time playing, and our buildbot for Yhc with Mac OS X PPC gets to the end, and passes almost all of the tests (one failing, which we're still tracking down).
Could you have another go at compiling, and let us know if you are successful?
These things don't look quite right (patch) * Assume that if we're on ppc we're running under OS X. (gcc argument) - -DPOWERPC_DARWIN But I got the same errors when I specifically didn't include the suspiciously-named patches (hooray for darcs' flexibility) : gcc -o inst/bin/yhi src/runtime/BCKernel/external.o src/runtime/BCKernel/hashtable.o src/runtime/BCKernel/heap.o src/runtime/BCKernel/hsffi.o src/runtime/BCKernel/info.o src/runtime/BCKernel/integer.o src/runtime/BCKernel/iofuncs.o src/runtime/BCKernel/jonkers.o src/runtime/BCKernel/main.o src/runtime/BCKernel/make.o src/runtime/BCKernel/mark.o src/runtime/BCKernel/module.o src/runtime/BCKernel/mutator.o src/runtime/BCKernel/pretty.o src/runtime/BCKernel/primitive.o src/runtime/BCKernel/sanity.o src/runtime/BCKernel/stopcopy.o src/runtime/BCKernel/profile.o src/runtime/BCKernel/foreign.o src/runtime/BCKernel/process.o src/runtime/BCKernel/thread.o src/runtime/BCKernel/stable.o src/runtime/BCKernel/builtin/Concurrent.o src/runtime/BCKernel/builtin/Array.o src/runtime/BCKernel/builtin/FFI.o src/runtime/BCKernel/builtin/IO.o src/runtime/BCKernel/builtin/Prelude.o src/runtime/BCKernel/builtin/PackedString.o src/runtime/BCKernel/builtin/RuntimeAPI.o src/runtime/BCKernel/builtin/System.o depends/ctypes/libffi/src/prep_cif.o depends/ctypes/libffi/src/cfield.o depends/ctypes/libffi/src/powerpc/ffi_darwin.o depends/ctypes/libffi/src/powerpc/darwin.o depends/ctypes/libffi/src/powerpc/darwin_closure.o -lgmp src/runtime/BCKernel/external.o: In function `dll_open': external.c:(.text+0x31c): undefined reference to `dlopen' src/runtime/BCKernel/external.o: In function `dll_sym': external.c:(.text+0x364): undefined reference to `dlsym' src/runtime/BCKernel/external.o: In function `dll_error': external.c:(.text+0x39c): undefined reference to `dlerror' src/runtime/BCKernel/hsffi.o: In function `hsffi_call': hsffi.c:(.text+0x5b4): undefined reference to `ffi_call' src/runtime/BCKernel/hsffi.o: In function `hsffi_evalContext': hsffi.c:(.text+0x67c): undefined reference to `ffi_call' src/runtime/BCKernel/thread.o: In function `osthread_create': thread.c:(.text+0x2b0): undefined reference to `pthread_create' src/runtime/BCKernel/thread.o: In function `yhi_semaphore_create': thread.c:(.text+0x4a4): undefined reference to `sem_init' thread.c:(.text+0x51c): undefined reference to `sem_open' thread.c:(.text+0x530): undefined reference to `sem_unlink' src/runtime/BCKernel/thread.o: In function `yhi_semaphore_signal': thread.c:(.text+0x5c8): undefined reference to `sem_post' src/runtime/BCKernel/thread.o: In function `yhi_semaphore_wait': thread.c:(.text+0x634): undefined reference to `sem_wait' src/runtime/BCKernel/thread.o: In function `yhi_semaphore_zero': thread.c:(.text+0x6a0): undefined reference to `sem_trywait' src/runtime/BCKernel/thread.o: In function `yhi_semaphore_destroy': thread.c:(.text+0x6f4): undefined reference to `sem_destroy' thread.c:(.text+0x710): undefined reference to `sem_close' src/runtime/BCKernel/builtin/Prelude.o: In function `_primFloatExp': Prelude.c:(.text+0x308): undefined reference to `exp' src/runtime/BCKernel/builtin/Prelude.o: In function `_primFloatLog': Prelude.c:(.text+0x390): undefined reference to `log' src/runtime/BCKernel/builtin/Prelude.o: In function `_primFloatSqrt': Prelude.c:(.text+0x418): undefined reference to `sqrt' src/runtime/BCKernel/builtin/Prelude.o: In function `_primFloatSin': Prelude.c:(.text+0x4a0): undefined reference to `sin' src/runtime/BCKernel/builtin/Prelude.o: In function `_primFloatCos': Prelude.c:(.text+0x528): undefined reference to `cos' src/runtime/BCKernel/builtin/Prelude.o: In function `_primFloatTan': Prelude.c:(.text+0x5b0): undefined reference to `tan' src/runtime/BCKernel/builtin/Prelude.o: In function `_primFloatASin': Prelude.c:(.text+0x638): undefined reference to `asin' src/runtime/BCKernel/builtin/Prelude.o: In function `_primFloatACos': Prelude.c:(.text+0x6c0): undefined reference to `acos' src/runtime/BCKernel/builtin/Prelude.o: In function `_primFloatATan': Prelude.c:(.text+0x748): undefined reference to `atan' src/runtime/BCKernel/builtin/Prelude.o: In function `_primFloatPow': Prelude.c:(.text+0x810): undefined reference to `pow' src/runtime/BCKernel/builtin/Prelude.o: In function `_primDoubleExp': Prelude.c:(.text+0xcc8): undefined reference to `exp' src/runtime/BCKernel/builtin/Prelude.o: In function `_primDoubleLog': Prelude.c:(.text+0xd4c): undefined reference to `log' src/runtime/BCKernel/builtin/Prelude.o: In function `_primDoubleSqrt': Prelude.c:(.text+0xdd0): undefined reference to `sqrt' src/runtime/BCKernel/builtin/Prelude.o: In function `_primDoubleSin': Prelude.c:(.text+0xe54): undefined reference to `sin' src/runtime/BCKernel/builtin/Prelude.o: In function `_primDoubleCos': Prelude.c:(.text+0xed8): undefined reference to `cos' src/runtime/BCKernel/builtin/Prelude.o: In function `_primDoubleTan': Prelude.c:(.text+0xf5c): undefined reference to `tan' src/runtime/BCKernel/builtin/Prelude.o: In function `_primDoubleASin': Prelude.c:(.text+0xfe0): undefined reference to `asin' src/runtime/BCKernel/builtin/Prelude.o: In function `_primDoubleACos': Prelude.c:(.text+0x1064): undefined reference to `acos' src/runtime/BCKernel/builtin/Prelude.o: In function `_primDoubleATan': Prelude.c:(.text+0x10e8): undefined reference to `atan' src/runtime/BCKernel/builtin/Prelude.o: In function `_primDoublePow': Prelude.c:(.text+0x11a8): undefined reference to `pow' depends/ctypes/libffi/src/prep_cif.o: In function `ffi_prep_cif': prep_cif.c:(.text+0x390): undefined reference to `ffi_prep_cif_machdep' collect2: ld returned 1 exit status scons: *** [inst/bin/yhi] Error 1 scons: building terminated because of errors. Adding "m" and "dl" to the list of libraries made some of the errors go away but I didn't know where the other references are supposed to be defined. Would it be simple to set up a buildbot here? If I find out how, I'll probably do that.
Re: separating out the build, there are some issues with that. The main one is that its simplest if the internal functions are invoked in exactly the same way as the external ones - this results in less special cases and better testing for everything. But this of course means depending on libffi for the internal functions as well. Fortunately libffi is available almost everywhere, at least everywhere Python is available, so isn't a major problem.
Ok, certainly uniform testing everywhere makes sense. And it would obviously add some complexity (and implementation work) to allow to replace all uses of libffi with 'error "Foreign function interface support not compiled in"', or to have it dynamically possible to be available or not, or other "could-be-nice" variations. :)
You also refer to "better memory use" compared to Lua? Given the following graph: http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=lua&lang2=ghc
It seems that GHC has better memory use than Lua in most of the tests, and in general Yhc has better memory use than GHC, so (taking a wild guess), Yhc should be less memory intensive than Lua.
Interesting -- I was assuming that Lua was designed to be good at that sort of thing (its interpreter can be quite small) -- and GHC binaries are infamous for being big, though that will obviously not be the same with Yhc. Perhaps Haskell's laziness makes really low memory-use easy in some cases.... Looking at Lua's worst memory usage compared to GHC (nsieve), it keeps a table for all the numbers up to a maximum! (while the haskell version uses arrays and gives ghc lots of strictness to play with) Possibly garbage collection is harder with habitual use of tables (which go unoptimized -- lua is designed to have a simple implementation. Hopefully it isn't ghc's ability to heavily optimize in a way we may not be able to :). Isaac -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.4 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFE0hx+HgcxvIWYTTURAuVzAJkB/TBob4iPNIvJphOdugwLcDTjkQCfS8zQ 5O6m6oLK3tobrJ3JYCRZVos= =2bBi -----END PGP SIGNATURE-----