1/31/12

Compile Objective C 2.0 (objc 2) on Linux

If you have gcc >4.6 (type 'gcc --version' to check your version), you can use gcc, otherwise use clang(llvm).

On Fedora, install dependencies:
yum install gcc-objc libobjc gnustep-base-devel gnustep-gui-devel
If you want to use llvm, do a "yum install clang"

To compile:
gcc `gnustep-config --objc-flags` `gnustep-config --objc-libs` -lgnustep-base helloworld.m -o helloworld
You have to use clang instead of gcc if you want to use blocks and you have to add '-fblocks' flag.

@property @synthesize works. Blocks also work.

On Ubuntu, install dependencies:
sudo apt-get install gobjc libobjc2 lib32objc2 libgnustep gnustep-base gnustep-devel clang
sudo ln -s /usr/lib/gcc/x86_64-linux-gnu/4.4/include/objc/ /usr/local/include/objc
To compile:
clang `gnustep-config --objc-flags` `gnustep-config --objc-libs` -lgnustep-base helloworld.m -o helloworld
On my machine (running Ubuntu 10.04), because gcc version is 4.4, I have to use clang. I also couldn't get blocks to work.

Not all language features are possible on linux, for example @autoreleasepool {} works on neither Fedora nor Ubuntu.

1/18/12

Programming with Chinese 用中文编程

I just found out that I can now use Chinese in filename and as variable name in Visual studio 2010.



I know in Java and PHP you can do this for a long time. In Haskell, you can also do it. For example:

It will make some interesting programming now that Visual Studio also enables it.

1/17/12

2012 Resolutions and other thoughts

7!
That's the number of blog posts I wrote in the last 2 years! Boy do I need to write more often! I will put "write more blogs" as one of my new year's resolutions. No, wait, it's already there. Although it's a bit late for new year's resolutions now that we are over half month into January, I actually had my resolutions written down earlier, in fact, much earlier - like, 5 years ago.

My 2012 new year's resolutions is the same as ones for 2007. Suffice to say I didn't accomplish any of those in 2007, nor 2008, nor, well, you get the idea.

So I won't publish the resolutions again, but they are usual stuffs like everybody else's: stay fit, learn Korean, learn Haskell, save more, spend less, launch X, launch Y, change the world, etc.