unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* [Code for fun] Announce my generic server Ragnarok
@ 2012-04-02 16:23 Nala Ginrut
  2012-04-04  2:41 ` Noah Lavine
  0 siblings, 1 reply; 9+ messages in thread
From: Nala Ginrut @ 2012-04-02 16:23 UTC (permalink / raw)
  To: guile-devel, Guile User

[-- Attachment #1: Type: text/plain, Size: 3289 bytes --]

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----------------------------------
<html>
<% (if (= 1 1) (begin %>
<p>asdf: <%= (+ 1 1) %></p>
<% )) %>

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

If you get this dynamic page from Ragnarok server, the result will be:
=================
<html>
<p>asdf: 2</p>
<p>6561</p>
</html>
=================
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
<server> class for debugging or working with it:
--------------------------------------------cut-----------------------------------
(use-modules (ragnarok server))
(server:run (make <server> #:name "first-http"))
--------------------------------------------end----------------------------------
Then you get a http server listen in 8080 in default.
Happy hacking!


[1] http://www.nongnu.org/geiser/

[-- Attachment #2: Type: text/html, Size: 4436 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2012-04-07 12:41 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-02 16:23 [Code for fun] Announce my generic server Ragnarok Nala Ginrut
2012-04-04  2:41 ` Noah Lavine
2012-04-04  2:42   ` Noah Lavine
2012-04-04  3:09     ` Nala Ginrut
2012-04-04 21:42     ` Ludovic Courtès
2012-04-06  1:05       ` Noah Lavine
2012-04-06  9:12         ` Ludovic Courtès
2012-04-06 11:47           ` Noah Lavine
2012-04-07 12:41             ` Nala Ginrut

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).