Lisp HUG Maillist Archive

Lisp Movies: Episode 2: (Re)writing Reddit in Lisp is 20 minutes and 100 lines

My first Lisp Movie wasn't called 'Episode 1' for nothing...

The second Lisp Movie (Screencast) is a tutorial on building web  
applications using KPAX, implementing a prototype clone of Reddit,  
sort of anyway.

We show how to use the KPAX Common Lisp Web Application Framework to  
implement an example that is quite similar to Reddit: a collection of  
links is presented, sorted by points and sorted chronologically, a  
form allows for new links to be submitted and links can be voted up  
or down. We show how to interactively debug web applications. Finally  
we add a stylesheet to give our little application a better look  
(thanks to Nicky Peeters). Furthermore we show how Common Lisp allows  
you to write elegant code, elegantly: flexibly re-using similar code  
fragments, as well as developing and testing incrementally.

If you're interested, check out the following page for details:

   http://homepage.mac.com/svc/LispMovies/index.html

Enjoy,

Sven

--
Sven Van Caekenberghe - http://homepage.mac.com/svc
Beta Nine - software engineering - http://www.beta9.be

"Lisp isn't a language, it's a building material." - Alan Kay


Re: Lisp Movies: Episode 2: (Re)writing Reddit in Lisp is 20 minutes and 100 lines


On Dec 21, 2005, at 5:41 AM, Sven Van Caekenberghe wrote:

> My first Lisp Movie wasn't called 'Episode 1' for nothing...
>
> The second Lisp Movie (Screencast) is a tutorial on building web  
> applications using KPAX, implementing a prototype clone of Reddit,  
> sort of anyway.
>
> We show how to use the KPAX Common Lisp Web Application Framework  
> to implement an example that is quite similar to Reddit: a  
> collection of links is presented, sorted by points and sorted  
> chronologically, a form allows for new links to be submitted and  
> links can be voted up or down. We show how to interactively debug  
> web applications. Finally we add a stylesheet to give our little  
> application a better look (thanks to Nicky Peeters). Furthermore we  
> show how Common Lisp allows you to write elegant code, elegantly:  
> flexibly re-using similar code fragments, as well as developing and  
> testing incrementally.

This is totally mind blowing! What makes it so impressive  is that  
there is no narration, no subtitles, and these aren't needed at all -  
everything is obvious from the code being typed in and the browser  
interaction. This is a testament both to the power of lisp and the  
usefulness of your kpax web-app framework.

Maybe not for lisp ultra-newbies (because it assumes some knowledge  
of common idioms like with-slots, etc.) but for anyone with even a  
few days of lisp under their belt this is a must see.

Well done, and thanks for sharing this.

regards,

Ralph

Raffael Cavallaro, Ph.D.
raffaelcavallaro@mac.com


Re: Lisp Movies: Episode 2: (Re)writing Reddit in Lisp is 20 minutes and 100 lines

Sven,

When I load reddit.lisp I get a warning that redirect-to is  
undefined. I see redirect-to-self in kpax, but no redirect-to (I've  
freshly installed kpax and all its dependencies with asdf-install  
just now so these should be up to date). Any idea what's missing here?

regards,

Ralph

Raffael Cavallaro, Ph.D.
raffaelcavallaro@mac.com


compilation of kpax

Well I'm allways looking for a useable web framework, now I tried my
luck with kpax but what happens while compiling crypto.lisp the GC
starts running an never ends...

Friedrich


kpax compile

Ok it bailed out here:
(defvar *kpax-random-state* (progn
                              (add-entropy-to-dev-random)
                              (mt:make-mt-random-state (get-secure-random-seed 624)))
  "Secure random state for MT random generator seeded from
/dev/random")

Regards
Friedrich


Re: kpax compile

On 9331 day of my life Sven Van Caekenberghe wrote:
> /dev/random does exist on most unix-style platforms, but on Linux is
> doesn't seem to be writeable.

Linux 2.6.13 (don't know about earlier versions) has writable
/dev/random.  Probably, it depends on kernel version.

-- 
Ivan Boldyrev

Violets are red, Roses are blue. //
I'm schizophrenic, And so am I.


Re: kpax compile

Well I posted to Sven in a private mail that I had not trouble
compiling this part on Linux Debian unstable AMD64 2.6.10 with SBCL
0.9.7.x ... 

If it is a general problem it should not have worked with SBCL
also. However it might be that using the 32-bit LW on an AMD64 might
cause the trouble. I don't know...

Regards
Friedrich


Re: kpax compile

Unable to parse email body. Email id is 5068

Re: kpax compile

On 9332 day of my life Sven Van Caekenberghe wrote:
> I never read the part about /dev/random being slow to deliver data
> when there isn't enough randomness - but it is mentioned in the man
> pages.

You may use /dev/urandom: if there is enough entropy, it uses it; if
not, it fallbacks to common RNG.

-- 
Ivan Boldyrev

                        Today is the first day of the rest of your life.


Re: kpax compile

There is this small GC monitor and it just switches to Running and
never come back....

Regards
Friedrich


Re: kpax compile

Unable to parse email body. Email id is 5080

Updated at: 2020-12-10 08:49 UTC