Sunday, September 23, 2007

haskell meeting




Last Thursday I went on London HUG meeting. There were two speeches, one about finger trees, and other about games in Haskell. You can see me on both videos. Cheers.

Wednesday, September 12, 2007

haskell on Mac




I have to take my words back in terms of edgy development on Mac, in respect to Haskell. Basically thru macports system it is possible to install Haskell in version 6.6.1 or even development version 6.7 witch is really edgy now. And it is as easy as on Linux:

sudo port install ghc

or ghc-devel for 6.7 version. I was really surprised when I find out that really cool package hoc. It was created for Haskell version 6.1, of course it works perfectly for my needs – you can use it with the newer version but you can only use procedures that existed in version 6.6.1, but it means that sooner or later I will face problems. Any way, be aware that macports will additionally install ncurses-5.6, gmp-4.2.1, perl-5.8.8, readline-5.2, ghc-6.6.1. Do you see what I see Perl, what is this guy doing here. It reminds me this RoR installation - it installs PHP and actually uses it to do configuration tasks; how weird is that? By the way Instant Rails is the most common way to install RoR on windows.

Going back to main topic installation of all GHC dependencies will take a while, so be patient. If you never wrote anything in Haskell be sure to see if GHC is really the thing that you want. Basically majority of programs written for HUGS will not run on GHC and vice versa. It reminds me (again) about scheme, if you use guile your programs will probably not work on MIT/GNU Scheme or DrScheme. You will have to modify your code. Oh, well - life is taft.

But again don't you feel that it is sad. You program in a language that is understood only by a few, and you are unable to share it with all of those who understand it?

Saturday, September 8, 2007

Mac the return




I‘ve been trying to configure Mac for the last few days. I‘m in a middle of the python development and I had to install py-unit on Mac, and then integrate it with Eclipse. There is a darwin port of py-unit so I did a little research to find out what is the difference between fink and darwin. The only think that I can say is that it worked. PyUnit is running fine.

For some time on I was willing to give a git one more shot. Last time when I tried it (1.5 year ago), I did not enjoy it. It just didn't suit my needs. To be honest I did not spent too much time then to read about all the benefits that it brings. Few days ago I finally managed to watch Linus speech at dev days about git. Linus made some strong point, and I totally agree with him there, but also this speech did not answer few questions: why git merge code so well, why does it better than subversion. Also a thought about SHA1 was really interesting, I am not a security guru, I have a very basic knowledge about that, but I enjoy math and I spend a lot of time researching math issues, any way Linus said that SHA1 is the best hash that is available on a market. That's interesting, why is that? I have to do some bigger research on that subject.

I don't think that distributed source code management systems (SCMS) is something that I need now - working on my own projects, or with a few friends, but in the old days (when the Earth was young, and mountains small) it was just a thing that I would needed. I was most curious to find out how branches and merges are implemented in git, how many tools support it (plugins, GUIs and so on). I am using a subversion to run my local projects, I thought that it would be a good idea to use both SCMS systems at this same time, cause it will give me some picture witch one is faster, easier to do simple stuff, and more advanced ones. To install git on Mac:


curl http://kernel.org/pub/software/scm/git/git-1.5.0.5.tar.gz -O
tar -zxf git-1.5.0.5.tar.gz
pushd git-1.5.0.5
make configure
./configure --prefix=/usr/local
make all
sudo make install


Then add to .profile file:


export PATH=${PATH}:/usr/local/bin



Simple, but still I would prefer to use fink or darwin ports, unfortunately I did not find git project in those repositories.

There is a dmg for subversion
. Unfortunately current version of subversion is 1.4.5 and mentioned dmg is for version 1.4.4, but still it is not that bad. In order to run svn you have to add /usr/local/bin to your PATH, just like it was done fore git. In other words if you done it for git you don't have to do anything, but if you are reading this article to configure subversion on your Mac be sure to do this also.

If you are looking for a GUI for subversion to run on Mac be sure to try svnx. It is really simple to create a repository in svn, and to add an existing project to it.


svnadmin create /Users/sagasu/worek/subversion/repositories/myProjectRepository
svn import /Users/sagasu/workspaces/workspace/myProject file:///Users/sagasu/worek/subversion/repositories/myProjectRepository -m "initial import"


to use git is also easy, but I was only able to create a repository in a path above source that I wanted to add. I spent some time trying to figure out if I can create a repository anywhere I want, I did not find this information.


git config --global user.name "Your Name"
git config --global user.email my@email.com

git init
git add .
git commit


And we are ready to rock and roll.

Saturday, September 1, 2007

Some thoughts about Mac




I've been playing with my new Mac for the last few days. I've been really surprised. I thought that it will be much easier to do all this stuff that I do on my Ubuntu. Unfortunately it is not. I've been trying to run pygames cause lately I've been adding an Arabic language support to one of games that runs on that engine. Guess what? By default Mac ships with python version 2.3, this is so old. Now days we have version 2.5. It's getting even worst, I would like to upgrade my python to never version, but there is no package management system that would be up to day. There is fink but it doesn't have a new python also. I was able to find .dmg for python 2.5 and it installed without any problems. Unfortunately to run pygame you need to take care of some dependencies - PIL, SDL, PyObjc and so on, because there is no package manager I had to surf thru the web and find all the packages by hand. Good news is that they worked - installed without and problems. Then you have to compile pygame by hand - it reminds my of GNU/Linux 10 years before, I had to do exactly this same. I've compiled pygame by hand cause I wanted to run on python2.5, there is .dmg for pygame working on python2.4. To compile by hand I had to find source code, find dependencies, and compile just to find out that I've missed some dependencies. Dependencies have dependencies and this cycle never ended. Let's face it this sucks. Not many people use pygame so I thought that I could install eclipse here. So again I've checked the Java version - 1.5.0_07, but I would like to have 1.6 update 2, unfortunately this version is not ready for Mac. What about Jave EE, it's getting even worst, forget about it! There is no way I'm going to play with different frameworks on Mac cause everything here is just a pain in the ass, from the easy development point of view. I understand that it is fun to program on Mac in Haskell, SML or hacking RoR but I just can't see how to develop some java apps on new engines (I mean edgy). Mac has also a good side, I truly enjoy all the gadgets, iLife set - not including iTunes - I prefer Amarok - and again trying to make it work under Mac is painful. I really think that Mac is a good environment for desktop. It has MS Office (the app that I miss on Linux), and all this apps for movie, music and picture gameplay. And everything looks nice, and works out of box (I mean camera, Skype ...).

Conclusion. I'm going to install Ubuntu as my development system and use Mac just to play with my pictures and movies. I hope that in the next 3-5 years Mac will be ready for up to date development (edgy). Well it is ready to up to date development if you like to spend a lot of time trying to compile things, or developing on Windows is a thing that turns you on.

I've played also with dual boot. It is really easy to run Windows on Macbook Pro, but here goes the real problem - overheating. When I started an app that uses plenty of CPU resources on Windows I was scared almost to death. Macbook was so hot and fans were running really fast and really loud but were still unable to cool the darn thing down (temperature over 70° C). I've heard recently on /. about Macbook that catches on fire and burned a house. This is an extreme but it made me thinking how gamers can use Macbook pro, I just can't imagine running WoW for more then 2 hours and still be brave enough to keep it going. Don't get me wrong, the machine will hold it for more then 2 hours I'm just concerned how long will it take till something will really brake down. Macbooks are pretty expensive and I would be really sad if I would overheat my box and had to replace motherboard and CPU for a new one. I would have to think about some system (system of fans or cold water) to dock my Mackbook. This system would have to cool it down. As for now I will try to not overheat it.

Overheating is not a new thing to Apple; do you remember firmware updates last year? I thought that from that time on Apple would be more serious and cool laptops better, but as far as I can judge “it is not like that”. I’ve been interested how hot are apple products developed for a desktop use. Do they get so hot also? I’ve read on blogs that gamers don’t have problems in running games on non laptop machines, but they are not saying if the cover is hot or not. Especially I’ve been interested in the newest product.

To sum things up I would like to say that I truly enjoy hacking this system. It is a fun thing to do when you return to your home after work. Just like in old days, so many things to discover, and so many paths to take. I feel like I’m young again.