Dive into Unity
  • 1-normal.jpg

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!

Wish Haskell can compile to CLR ... :p

小音乐软件

虽然完全没创意 ><

当初上 CS 的时候就是冲着做游戏去的,不过后来课太杂居然把这个正经事给忘了。

虽然第一版奇破无比,不过毕竟是第一个娱乐啊,开心的说。

  • 1.png
人生第一个四星啊

Icy WoWWiki 终于有第一个评论了,是个四星。

现在有点明白为什么淘宝上的店都那么注重评论了。自己的产品真的会很在意的。

四星可能说明做工还是有点粗糙吧,恩,我知道有些 img 的 style 还没调好。有点懒 ><

Wiki viewers with the same engine

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.

I'm never good enough for C, I know it ...

国内的 iPhone 开发

刚看 cocoachina 的时候还是挺震惊的,看到这么多很牛的游戏和软件都是大陆开发者(好多还是北京的)做的,确实很出乎意料。

现在 Icy Wiki 唯一的优势就是前三个字的本地检索,这是其它 Wiki 软件在速度上赶不上的。但是毕竟是第一版,很多功能都不全,也没有本地储存和其它人性化的功能。可能是由于圣诞都促销的原因,虽然 Icy Wiki 比以前的软件有更多的曝光率,但是销量还不如以前没有曝光的软件。Wiki 这里的竞争太激烈,有那么多免费软件,不会有人考虑付费版本的。

下一版已经做的差不多了,打算过节后传上去看看。市场定位是不和 WikipanianHandy Wiki 从功能上争,而是从速度和简洁上取胜,其实这也是一开始的定位,没有自己的特色不会有人理的。

A few notes on compiling GHC iPhone against latest SDK

Note: This post is outdated, please refer to Cross-compiling Haskell to OMAP3 and iPhone platforms

Since I did the compilation a month ago, there could be missing pieces.

steps

  • I'm using Snow Leopard (Leopard might work, not tested)
  • install GHC 6.10.2 (using other version caused problem for me)
  • do the Mac trick for 32bit libs
  • download GHC iPhone, need the source package
  • 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.