Sunday, June 07, 2009

小龙汤包

我今天吃小龙汤包了。Mmm,好吃啊!让我想到上海的生活(还是我该说《上海的包子》吗?)。反正,我们吃点心的时候讨论小龙汤包是不是对身体好。我说比美国正常的早饭健康很多,但是我有点怕我只在rationalize我吃包子的习惯。=P


Hmm,我的中文现在真好差。好可怜。=( 只能写几岁小孩子的句子。

Wednesday, June 03, 2009

How to Install Erlang on Mac

I just went through the steps of installing Erlang and Emacs (which is the official development environment for Erlang) on my Macbook Pro, and since it was a little convoluted, I thought I'd share it.
-----
This document explains the steps needed to install Erlang with Emacs support on Mac OSX 10.5. I've chosen to install Erlang from source, because the Mac binaries tend to be out of date. For emacs, I've chosen Aquamacs, which is a nice native Mac emacs distribution.

  1. First, I needed to download and install iPhone SDK, in order to get a C compiler (gcc). Could have gotten it from Developer Tools on the Mac OSX install disks, but I wanted the iPhone SDK anyway.
  2. Next, download erlang from source: http://erlang.org/download.html
  3. tar -xvzf otp_src_R13B.tar.gz, cd otp_src_R13B, ./configure, make, sudo make install
  4. Run erl in a terminal to make sure the erlang interpreter starts properly.
  5. Next, download Aquamacs, which is a native Mac emacs distribution. http://aquamacs.org/
  6. Next, setup Aquamacs for erlang: erlang comes with emacs mode in its distribution, it's just a matter of finding it. The standard install has it at /usr/local/lib/erlang/lib/tools-x.y.z/emacs (mine was at tools-2.6.4).
  7. Copy erlang.el and erlang-start.el from the Tools directory to ~/Library/Application Support/Aquamacs Emacs/erlang (need to make the "erlang" subdirectory)
  8. Create site-start.el in the same Aquamacs directory, which just has one line: (require 'erlang-start)
  9. Good to go! Open a .erl file in Aquamacs - it should go into Erlang mode.

For release 13B, eunit is broken, so download the fix (http://erlang.org/download/patches/eunit-2.1.1.tar.gz), untar it, and sudo mv the resultant directory to /usr/local/lib/erlang/lib/.