I did some crazy research in the Unity game engine, particularly the sound engine of the iphone port.
My result so far is that there is about 0 - 80 milliseconds unpredictable delay for the sound engine, which makes it less suitable for real time audio applications.
However, I did find the engine extremely polished in every other aspect, the component approach (similar to mix-ins in Ruby) is so powerful. When I was using the engine, I kept thinking what if this is done in Haskell, and so far most of my answers are that there has to be a break through in Haskell tool chain in order to do what Unity can possibly do now.
Some background of Unity:
scriptable part of the engine runs on top of Mono's runtime
multiple languages (C#, Javascript, Boo)
static typing, with optional dynamic typing
type inference !!!!
component based OO approach
very very powerful runtime manipulation
very high performance
ahead of time compilation for iPhone, extra speed
unbelievably polished workflow
extremely friendly community
The Unity developers really know what they are doing!
I just updated both Icy Wiki and Icy WoWWiki. With this update, they are simply the fastest wiki viewer in the world.
Technically, what I feel right is that both viewers are using the same engine underneath, they differ only in resource bundles and a configuration file. All the models, controllers and helpers are the same.
What's unusual is that the data structure for configuration is a record made of a group of pure functions. This kind of thing is possible but very difficult to do with Objective-C and C, Haskell's functional nature and flexible type system really helped me here.
现在 Icy Wiki 唯一的优势就是前三个字的本地检索,这是其它 Wiki 软件在速度上赶不上的。但是毕竟是第一版,很多功能都不全,也没有本地储存和其它人性化的功能。可能是由于圣诞都促销的原因,虽然 Icy Wiki 比以前的软件有更多的曝光率,但是销量还不如以前没有曝光的软件。Wiki 这里的竞争太激烈,有那么多免费软件,不会有人考虑付费版本的。
下一版已经做的差不多了,打算过节后传上去看看。市场定位是不和 Wikipanian、Handy Wiki 从功能上争,而是从速度和简洁上取胜,其实这也是一开始的定位,没有自己的特色不会有人理的。
before start, briefly go through the documentation in the package (pdf)
prepare to hack:
Everything that follows applies to both iphone and iphone simulator. I recommend prepare 2 directories to compile for iphone and iphone simulator respectively, a simple make clean might not be enough from my experience:
compilation details
OK, here's what need to be changed,
config-iphone.sh (point every /Developer path to the current SDK)
download required stock packages (HTTP, etc, refer to documentation) into the proper location, that is, the actually GHC source dir, where you would find README, configure etc
start to compile. Note: compiling will fail, in particular, I had to use undefine on almost every functions from : 1. network, 2.system.direcotry. Expect to do the same.
After compilation, follow documentation to install.
after install
unix package is not present on my system.
network is not usable, but it's not a big deal, NSConnection can get the job done.
since unix is missing, it's not possible to use functions like directoryExist, fileExist and such, those abilities could be imported from Core Foundation.
dev hints
try to see the 2 examples bundled in GHC-iPhone package, they provide valuable information to get you started. They might not compile though.
read on haskell FFI if not already familiar, it's the primary tool to talk to the iPhone
conclude
I compiled GHC 5 times in a day on a laptop to get it working, it's not as simple as it sounds. But once it's compiled, many things work unexpectedly well, even Controll.Concurrent is working without a hassle, not to mention endless packages on Hackage.