From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nala Ginrut Newsgroups: gmane.lisp.guile.devel,gmane.lisp.guile.user Subject: [Potluck] a lightweight web framework Date: Sun, 17 Feb 2013 13:03:15 +0800 Organization: HFG Message-ID: <1361077395.2535.39.camel@Renee-desktop.suse> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1361077406 14772 80.91.229.3 (17 Feb 2013 05:03:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 17 Feb 2013 05:03:26 +0000 (UTC) Cc: guile-user To: guile-devel Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sun Feb 17 06:03:48 2013 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1U6wPj-0007Ur-E2 for guile-devel@m.gmane.org; Sun, 17 Feb 2013 06:03:47 +0100 Original-Received: from localhost ([::1]:40797 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U6wPP-0002Cm-GY for guile-devel@m.gmane.org; Sun, 17 Feb 2013 00:03:27 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:46757) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U6wPL-0002Ca-WC for guile-devel@gnu.org; Sun, 17 Feb 2013 00:03:26 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U6wPK-0000i2-J1 for guile-devel@gnu.org; Sun, 17 Feb 2013 00:03:23 -0500 Original-Received: from mail-pb0-f49.google.com ([209.85.160.49]:36491) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U6wPK-0000hb-CY; Sun, 17 Feb 2013 00:03:22 -0500 Original-Received: by mail-pb0-f49.google.com with SMTP id xa12so1169600pbc.36 for ; Sat, 16 Feb 2013 21:03:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:subject:from:to:cc:date:organization :content-type:x-mailer:mime-version:content-transfer-encoding; bh=AO03eGLPzlErhopggCoc0qdErzvnVDmjeV1yElEvGAY=; b=BhN1T3JB3CMSjvIaTjCxBiDK9JXpaj2M0iVYfBAn6Yb/66Uy1dmpSTPT/LrvpvPeV9 qFJ26GWjAe5Sq4rwJp3UOZWFi9y1gQUwmj5pyuusIw/3QF/Gqetm69bvTXKO7RhGpgsP qQ3ht/TfVjoey9ElAI9PhLvPH/Ac2gOMzrILRi5ukjy/xuSSfAjBn+gEG477k2E6GJ3F Vn2KnUTCy1zlpvKrfV3wCqaM4WcguwIah9GUTunnAfkZTJSK8yNrzt79THp2Cqhxs/QY 79KM5d5GeZ4DHS7vPFKTD7o0CR/OJp4dePh1Kof803LjbrPzMR+BPJFCECVIETqj5/B8 8pXg== X-Received: by 10.68.115.173 with SMTP id jp13mr19249382pbb.95.1361077400320; Sat, 16 Feb 2013 21:03:20 -0800 (PST) Original-Received: from [147.2.147.112] ([61.14.130.226]) by mx.google.com with ESMTPS id gg7sm10020288pbc.45.2013.02.16.21.03.16 (version=SSLv3 cipher=RC4-SHA bits=128/128); Sat, 16 Feb 2013 21:03:19 -0800 (PST) X-Mailer: Evolution 3.4.4 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 209.85.160.49 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:15755 gmane.lisp.guile.user:10109 Archived-At: Sorry for the late guys! I planed to give you a lightweight web-framework, and you may use it to build your own site with Guile easily. Besides, with Guile's inner web-server, you could have 10K concurrency performance. But life is no so perfect, I was sick for few days, so I'm late for the potluck. When I tried to polish it more beautiful, I found a bug in web module (anyway it's a nice discover for a hacker). Seems that I have to release it as a half-baked one :-( But good news is that I'll continue to polish it. I put here: https://gitorious.org/glow/artanis Let me introduce it: * very lightweight: the core artanis.scm almost 300 lines, easy to hack and learn for newbies. * a relative complete web-server implementation, include error page throw and all the HTTP method(you have to specify your own handler) * 10K concurrent performance for the server, takes advantage of the Guile inner server. IIRC, andy once said it's 9K+ for static pages. It's enough for you own site/blog. * sinatra like style route, that's why it names "artanis" ;-) * Database support(now use guile-dbi), mysql/sqlite/postgresql. But it's easy to port to other database binding. (but I like dbi) * session support (thanks for andy's advice) * HTML template of SXML (very easy to use for Lisper) I have no time to write a tutorial for it before I release, but there'll be one soon. And you may read test.scm/blog.scm to get to know how it works. https://gitorious.org/glow/artanis/blobs/master/test.scm https://gitorious.org/glow/artanis/blobs/master/blog.scm (for blog.scm, you may need blogdb.mysql script to build your database quickly) You may write a blog in ten minutes if you're familiar with web develop and SQL. PS: and I have to mention that bug, I believe it's a bug. When the server-handler get the request, I found the uri in request have no 'host', it's #f. It causes trouble for me to implement url redirect mechanism, which used to implement admin authentication. I do think uri should keep 'host' value because it's useful for later. And it's OK for 'read-request-line', it'll parse and store 'host' correctly. I think there's some link in the inner server module, which dropped 'host' value or created a new uri and throw the old-correct one. Any comments? Sorry again for the half-baked work, it looks no cool. But I've ever planed a perfect one... :-(