From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nala Ginrut Newsgroups: gmane.lisp.guile.user,gmane.lisp.guile.devel Subject: [Code for fun] Announce my generic server Ragnarok Date: Tue, 3 Apr 2012 00:23:23 +0800 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=14dae9ccd4ecf2548104bcb49b49 X-Trace: dough.gmane.org 1333383826 14908 80.91.229.3 (2 Apr 2012 16:23:46 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 2 Apr 2012 16:23:46 +0000 (UTC) To: guile-devel , Guile User Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Mon Apr 02 18:23:44 2012 Return-path: Envelope-to: guile-user@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 1SEk2f-0006Np-3w for guile-user@m.gmane.org; Mon, 02 Apr 2012 18:23:41 +0200 Original-Received: from localhost ([::1]:34943 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SEk2e-0001mD-DW for guile-user@m.gmane.org; Mon, 02 Apr 2012 12:23:40 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:37804) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SEk2X-0001m2-Rz for guile-user@gnu.org; Mon, 02 Apr 2012 12:23:36 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SEk2R-0005uK-5L for guile-user@gnu.org; Mon, 02 Apr 2012 12:23:33 -0400 Original-Received: from mail-vb0-f41.google.com ([209.85.212.41]:44025) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SEk2Q-0005tz-SL; Mon, 02 Apr 2012 12:23:27 -0400 Original-Received: by vbbey12 with SMTP id ey12so2264242vbb.0 for ; Mon, 02 Apr 2012 09:23:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=VsK7/Vc40r136R3br6Y1y2zb9qx2yNdVpjxtncOH9CI=; b=FbTOY04RkHsWMHP/NOQqgcaEl/Wi8P0R2ORRHozhDd2n6sWniaY573jAbsjKGTBarI SnvFMLR1yf56bp4gA5P5h0v6Mi0iuP5y9wK0cygq3LylnrQtOEiJUdeTMihhkSHGsLUs zjf2fMgb5avo+aHjnWdsZqXsMGk77fHF3mX9KZGXBcBVCZwwHjiJ9hx905Y+6aFlA4Zr NOJReWqBPrtrHE6nGTbAS3XNqoB+HOgxXl3DGnZNZ0PAWjePPee45erRZT53j3wRcwb7 o6nZXlyPWOGoEyy1k5y2eYh5zC7pgh9CMClPStlXiJAmUhJN4QIZpvF1CC8jEC3f0SVQ Xfgg== Original-Received: by 10.220.232.10 with SMTP id js10mr4241825vcb.53.1333383803327; Mon, 02 Apr 2012 09:23:23 -0700 (PDT) Original-Received: by 10.52.158.138 with HTTP; Mon, 2 Apr 2012 09:23:23 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.212.41 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:9361 gmane.lisp.guile.devel:14201 Archived-At: --14dae9ccd4ecf2548104bcb49b49 Content-Type: text/plain; charset=UTF-8 hi falks! Many guys believe Guile-2.0 is powerful, me too. But we need more and more guile projects to prove that. Here's a toy of my coding game. A generic server named "Ragnarok". The keyword "generic" implied it's not only a http-server, but easy to add new protocols without considering the common features for a server such as config/logger/concurrent... If you checkout its code, you may find that it may didn't use web API you thought in Guile lib, and it's bother to implement epoll though Andy is making effort to writing nio/ethread now. Well, the reason is simple, because that API/epoll did exist or not stable at the time I wrote Ragnarok. I think it's easy to port it to our future nio/ethread for a higher concurrency. It's here: git://gitorious.org/glow/ragnarok.git I'll make a main page for it if I find a proper web hosting. Features: * GPLv3 (of course) * Object oriented (yes, I'm the minority in Guile community who try to program with GOOPS, though FP features may cancel out most of OO features) * HTTP/1.1 * Multi-protocols * Multi-languages (Guile is actually a dynamic compiler collection against the GCC who's the static one according to Andy's free speech. So multi-language must be the most fascinating feature.) * Guile/Scheme Template * Configurable * MIME * Unified epoll/select/kqueue interface * Logger * Standard CGI * Static page and binary downloading service (of course) These days I'm on my vacation and gave a free speech to Chengdu Linux User Group for a topic about Guile. Many guys are interested in using Scheme for web framework. But they thought it's very clumsy to write Scheme in web development, they love PHP more. For such a misunderstanding, I showed them one of the features in Ragnarok, the Guile template: ---------------------------------cut---------------------------------- <% (if (= 1 1) (begin %>

asdf: <%= (+ 1 1) %>

<% )) %> <% (let ((test-me (expt 3 8))) %>

<%= test-me %>

<% ) %> ----------------------------------end------------------------------- If you get this dynamic page from Ragnarok server, the result will be: =================

asdf: 2

6561

================= Or open it from any web-browser you like. Well, it's an interesting feature and easy to implement for most guys in Lisp world. The point is, I'm telling them the template is not a big deal for Guile. We have it. After the free talking, an audience ask me: why not release it? I must confess it's just a toy of my coding game. I didn't know if people will be interested in it. And many guys here know much than me, so I'm hesitating. But the sentence on Geiser[1] site struck me: "No hacker is an island". Then I believe I must share it to the world and get more help. Anyway, it's buggy but it really works! If you're in trouble with running it directly, you may try to use it's class for debugging or working with it: --------------------------------------------cut----------------------------------- (use-modules (ragnarok server)) (server:run (make #:name "first-http")) --------------------------------------------end---------------------------------- Then you get a http server listen in 8080 in default. Happy hacking! [1] http://www.nongnu.org/geiser/ --14dae9ccd4ecf2548104bcb49b49 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable hi falks!
Many guys believe Guile-2.0 is powerful, me too. But we need = more and more guile projects to prove that.
Here's a toy of m= y coding game. A generic server named "Ragnarok". The keyword &qu= ot;generic" implied it's not only a http-server, but easy
to add new protocols without considering the common features for a ser= ver such as config/logger/concurrent... =C2=A0
If you checkout it= s code, you may find that it may didn't use web API you thought in Guil= e lib, and it's bother to implement epoll though Andy is=C2=A0
making effort to writing nio/ethread now. Well, the reason is simple, = because that API/epoll did exist or not stable at the time I wrote Ragnarok= . I think it's easy to port it to our future nio/ethread for a higher c= oncurrency.=C2=A0
It's here:=C2=A0git://gitorious.org/glow/ragnarok.git
I'll make a main p= age for it if I find a proper web hosting.

Feature= s:
* GPLv3 (of course)
* Object oriented=C2=A0
=C2=A0= (yes, I'm the=C2=A0minority in Guile community who try to program with = GOOPS, though FP features may cancel out most of OO features)
* = =C2=A0HTTP/1.1
* =C2=A0Multi-protocols
* =C2=A0Multi-languages
= =C2=A0(Guile is actually a dynamic compiler collection against the GCC who&= #39;s the static one according to Andy's free speech. So multi-language=
must be the most=C2=A0fascinating=C2=A0feature.)
* =C2=A0Guile/Scheme Template
* =C2=A0Configurable
* =C2=A0MIME
* =C2=A0Unified epoll/select/kqueue interface
=
* =C2=A0Logger
* =C2=A0Standard CGI
* =C2=A0Static= page and binary downloading service (of course) =C2=A0

These days I'm on my vacation and gave a free speec= h to Chengdu Linux User Group for a topic about Guile. Many guys are intere= sted in
using Scheme for web framework. But they thought it's= very clumsy to write Scheme in web development, they love PHP more.=C2=A0<= /div>
For such a misunderstanding, I showed them one of the features in Ragn= arok, the Guile template:
---------------------------------cut---= -------------------------------
<html>
<%= (if (=3D 1 1) (begin %>
<p>asdf: <%=3D (+ 1 1) %></p>
<% )) %&g= t;

<% (let ((test-me (expt 3 8))) %>
<p><%=3D test-me %></p>
<% ) %>
<= div> </html>
----------------------------------end--------= -----------------------

If you get this dynamic pa= ge from Ragnarok server, the result will be:
=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
<html>
<p>asdf: 2</p>
<p>6= 561</p>
</html>
=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
Or open it from any web-browser yo= u like.

Well, it's an interesting feature and easy to implement for most guys i= n Lisp world.=C2=A0
The point is, I'm telling them the templa= te is not a big deal for Guile. We have it.

After = the free talking, an audience ask me: why not release it?
I must confess it's just a toy of my coding game. I didn't kno= w if people will be interested in it.
And many guys here know muc= h than me, so I'm=C2=A0hesitating.=C2=A0
But the sentence on = Geiser[1] site struck me: "No hacker is an island". Then I believ= e I must share it to the world and get more help.
Anyway, it's buggy but it really works!
If you're in= trouble with running it directly, you may try to use it's <server&g= t; class for debugging or working with it:
----------------------= ----------------------cut-----------------------------------
(use-modules (ragnarok server))
(server:run (make <server= > #:name "first-http"))
----------------------------= ----------------end----------------------------------
Then you ge= t a http server listen in 8080 in default.=C2=A0
Happy hacking!


=

--14dae9ccd4ecf2548104bcb49b49--