Sunday, March 29, 2009

Meet Mr Clbuild

I leaved Mr ASDF-INSTALL after a long time work with he and come to meet Mr Clbuild.

I follow instructions of its website, download by darcs

$ darcs get http://common-lisp.net/project/clbuild/clbuild
make the shell script executable:
$ cd clbuild
clbuild$ chmod +x clbuild
Try check to make sure all its helper friend are here
clbuild$ ./clbuild check

It report I have not 'which', what is which? I log in mystic server in which another Mr Clbuild stays and see which. which produce the path of it parameter. oh! whereis also do this work, I make a link from whereis to imitate which. Unfortunately whereis produce the path of all binary, library, manual files, even whose its parameter is print first so whereis -b also is wrong.

I have to install which command. Good luck, which command is also which package in Arch Linux.

Go on!

clbuild$ ./clbuild install cl-ppcre
No problem! then
clbuild$ ./clbuild slime-configuration

I love emacs and live in it for a long time, so I can not give up slime. I do not want to tousle my .emacs, so I use slime-configuration instead of slime. It prints a .emacs excerpt. I'm very careful and check it before copy&paste it into my .emacs: It try to load slime which I do not install by clbuild.

clbuild$ ./clbuild install slime

so after some greeting words with Mr clbuild, what is my purpose to meet clbuild? Let he invite Mr Weblocks as my friend, :).

Mr weblocks is in the list of

clbuild$ ./clbuild projects
clbuild$ ./clbuild install weblocks

Mr Weblocks has lots of friend and my slow and GFWed1 ISP interrupt the party, Mr Clbuild tell me to run

clbuild$ ./clbuild update --resume

I regard it as a ordinary problem, but it is not! Why I always be out of luck, :(

(require :weblocks)
....
Symbol "DEFINE-FOREIGN-LIBRARY" not found in the CFFI package.

I grep "define-foreign-library" in cffi source directory, there is not. I check its version, it is 0.1.0, but my ASDF-INSTALLed cffi is 0.10.3.oh no! After struggle for some time in switch between Mr ASDF-INSALL and Mr Clbuild (It seems clbuild is not compatible with ASDF-INSTALL), I finally resolve it by reinstall cffi by clbuild.

These are my first meeting with Mr clbuild, I hope he will be a good friend of mine, :)


1. Great FireWall

Wednesday, March 25, 2009

I can not stop weblocks

I found it very early and I judge it is becuase hunchentoot1 made a big step: from 0.15.8 to 1.0.12, it uses a new class acceptor which I do not comprehensive it very much. So I skip this problem for I can say sayonara to slime. I think it just waste my time: it takes time to run slime.

However Murphy's law came, I found my data was mixed when I modify data in the course of exiting and entering slime. I first suspect the algorithm of modification, sigh, it is waste of time again, It is just due to close-store is not called. I believe this work could be done in stop-weblocks which I ignore. I have to debug stop-weblocks and discover it enter a endless loop when to shutdown a one-thread-per-connection-taskmaster object, I do not know why but I redefine the shutdown method, not to waiting the process natural dies but kill it by sb-thread:terminate-thread.

It works and It is obvious I need check this problem after the state of hunchentoot and Weblocks development are stable.3


1. Weblocks is based on hunchentoot.

2. It is very pity hunchentoot 1.0 does not support \*catch-error-p\*, it is said it just absent for a little time.

3. Maybe it is my configuration' wrong, but it does not make sense now.

Monday, March 23, 2009

The render mechanism in Weblocks

Now I'm working on a simple wiki application for weblocks.I create a wiki widget, it show pages in a single place,(Maybe pages should be linked from each other, but it is a simplewiki now, :)). User can click the page, modify its content and submitit.

I used a widget which inherit dataform to reflect page,because dataform has two state, one show content, one is a form which you can modifycontent and submit. I tried it and met a problem, when user click "Modify" link of dataform widget, its state is changed but not its appearance. I think it is beacuse thewiki widget is not rendered. The page widget is stored in the slot of wiki widget,the wiki widget does not konw whether it need be render. so if I put page widgetinto the children of wiki widget?

I keey trying, but it does not work :(. I just got a advantage that parent widgetcan render children widget automatically.

I know I must mark-dirty a widget to let it being render. It is a pity thereis not a hook function in the modify link of dataform widget. I have to modifythe render function of page widget in order to use a accustomed link to replacethe modify link.

It is my surface impression of The render mechanism in Weblocks, :). oh, anotherthing, It seems children widget's render-widget does not call its parents functionautomatically, I need use call-next-method mannully.

The annoyance of ASDF-INSTALL

When I enter the LISP world, someone tell me ASDF is likeMakefile world but it is written in LISP. yes,the philosophyof LISP world is do everything in LISP for it can do everything.It is great!

Then it go further, ASDF-INSTALL is taken to manage LISP packages,we do not need APT or RPM package system provided by OS at all, wejust finish it in our world. However it is not great!

ASDF-INSTALL uses PGP signatures to verify the provenance ofthe downloaded code, it seems OK but there are so many packages andevery package developer has his/her own PGP key. I need add themto package supplier list one by one and trust them one by one. Unfortunately,ASDF-INSTALL does not provide a restart to make a PGP trust relationship.Maybe we should use a signatures mechanism written by LISP.

I think even thought we have a central-control site Cliki to getall ASDF package, we trust it, why does not it provide a trust bridgebetween us and the developers. More trust, Better world!

It is good that ASDF-INSTALL deal with package dependancy but not packageversion. you need check it manually: discover it from lots of BIG (I was not used tosee every character is captical, I'm not a native english speaker)sentencs of Backtrace, and skip all uselessrestart (I tried it but it recurs in next time, besides they may cause anotherproblem, who knows!) The worse situation is you get it from your code.

I wrote this post not for hating it but record my experience for it costed melost of time to struggle: I met a problem, in order to resolve it I need resolveanother problem like GPG warns and GnuPG installation, package version dependancyand BIG Backtrace. This experience maybe upset but it is useful for my post, :).

Sunday, March 22, 2009

Why I open this BLOG

To share my experience in Lisp world to help other people?No! I need help first! Of course if my post can help others,I will be very very happy!

After I came into the LISP world, I met lots of problems, thefirst reaction is should I ask it and get a quick answer? Itseems simple, however whether or how to ask question itself is a problemif you know little about the problem, you don't know how to ask it precisely.moreove, I'm not a native english speaker, sometimes I do notfind a proper word or sentence to express my meaning. Even worse is whenI keep ask frequently, other people will be annoyed and so do I,I will be lost for unsureless.

But if I do not get help from expert, I must waste times in many trivialproblem. So I think the BLOG maybe good for me, I tried my best toexpress my problem or experence in detail, and if you feel it is agood discuss point, please comment it and if it is not, just skip it.I hope it is a convient communication way.

Beyond it, BLOG should give me some good: When I can not solvethe problem, I feel sad and do not want to touch it for a periodof time. now I can try to describe it clearly, it is also a success whichcan boost me.

In the end, Specially thanks Leslie P. Polzer, He gave me many help when Istruggle in the LISP world, I'm very sorry I'm not very vigorous before,I should do better.

PS: If the grammar or semantic of my posts has wrong, I will appreciate yourtaking the time to point it, It is a good way for I practise my english, :).