Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Lisp > ANN: SymbolicWe...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 36 Topic 12420 of 13152
Post > Topic >>

ANN: SymbolicWeb v0.1 (quite alpha) w/ source code this time

by =?ISO-8859-1?Q?Lars_Rune_N=F8stdal?= <larsnostdal@[EMAIL PROTECTED] > May 3, 2008 at 11:08 AM

(..in case my usenet client screws up the post, a copy is here:
http://common-lisp.net/~lnostdal/programming/lisp/symbolicweb/release-0.1-notes.txt
)

   SymbolicWeb; an AJAX/comet framework for Common Lisp.

   Status: v0.1 (quite alpha)


Hi all,
Ok, this thing is still a bumpy ride and there isn't much yet, but I need
to
try this.

So what is this? I'll just post some code and link to some "dead" HTML
snapshots
of the results. After getting things up and running (see mention of
INSTALL
below), start with "Hello World":

   CL-USER> (in-package :sw)

   SW> (add (make-instance 'span :html "Hello World") (root))

==>
http://common-lisp.net/~lnostdal/programming/lisp/symbolicweb/tmp/SymbolicWeb-1.html


...the stuff at the top is just some default header thing. Moving on:

   SW> (children-of (root))
     (#<SPAN {A739F89}>)
   SW> (first (children-of (root)))
     #<SPAN {A739F89}>


...ok great, so we got a tree with a SPAN widget in it. Let's try to
change the
contents of the span widget:

   SW> (defparameter *span* (first (children-of (root)))) ;; so we don't
have to type as much
   SW> (html-of *span*)
     "Hello World"
   SW> (setf (html-of *span*) "Hello Universe")

==>
http://common-lisp.net/~lnostdal/programming/lisp/symbolicweb/tmp/SymbolicWeb-2.html


So we can manipulate and add content at any time, and the page updates in
real-time as we go. This also works in callbacks triggered by client side
events.
CSS also works; try this:

   SW> (setf (background-color-of *span*) "lightblue")

==>
http://common-lisp.net/~lnostdal/programming/lisp/symbolicweb/tmp/SymbolicWeb-3.html


Try adding some callbacks:

   SW> (setf (on-click-of *span*)
             (lambda (&rest args)
               (write-line "Universe said hi!")))


...when the user clicks, this is written to the REPL:

     Universe said hi!


...but I'm lazy, so I want to trigger events from the server side:

   SW> (trigger (on-click-of *span*))
     Universe said hi!


This is great while doing interactive development. I use (REMOVE-ALL
(ROOT))
at the top of a scratch buffer to tear things down, then build my widget
tree
up again with my recent changes.

Let's add a second widget:

   SW> (add (make-instance 'toggle-button
                           :children (list (make-instance 'image :src
"http://www.normal-null.de/img/lisp/glossy120.jpg")))
            (root))

==>
http://common-lisp.net/~lnostdal/programming/lisp/symbolicweb/tmp/SymbolicWeb-4.html


(i'm in a hurry, and couldn't find an image with a transparent background
..)

When the user clicks, it changes color to illustrate its state. It is
either
on or off (T/NIL). You can define how states are to look by supplying
initarg
values for :TRUE-STATE-FN and :FALSE-STATE-FN. See the source code for
TOGGLE-BUTTON, here:

  
http://common-lisp.net/~lnostdal/programming/lisp/symbolicweb/src/widgets/toggle-button.lisp


Server side state change updates the client side visuals instantly:

   (setf (state-of (second (children-of (root)))) t)
   ..or..
   (toggle (second (children-of (root))))


Ok, that's it for now. See an example of a chat application here:

  
http://common-lisp.net/~lnostdal/programming/lisp/symbolicweb/examples/chat.lisp


...an old version (not the same source code) of it runs here:

   http://swchat.nostdal.org/


See the file INSTALL for information about getting up and running:

   http://common-lisp.net/~lnostdal/programming/lisp/symbolicweb/INSTALL


Some notes:

   * SBCL only (must have thread sup****t). I think it is possible to ****t
to
     other Lisps though.

   * Only tested under Linux, but might run on other platforms where
     SBCL runs.

   * I did early tests on IE and Opera, and have confirmed that the client
     side of SW runs there. However, the last couple of weeks I have only
     been testing things on Firefox 2.x.


I will be at the IRC channel #symbolicweb on irc.freenode.org and
try to help anyone interested getting started. Questions can also be
posted here:

   http://groups.google.com/group/symbolicweb


Things I'm not happy with:

   * The Aromyxo library/dependency. It is a huge mess. It is a place
     I've been dumping code from REPL sessions since my early Lisp days.

   * The way sw-jquery is selected as a JS backend using (use-package
:sw-jquery)
     in src/config.lisp. It seems "wrong" somehow. Maybe it isn't.

   * src/widgets/dom-cache.lisp. It is just too complex and messy. I
wanted to
     use MOP. I need more time with AMOP, but I'm running out of time.

   * It badly needs some unit tests. Someone is working on this though.

   * It needs more examples and do***entation.

   * It should be possible to display a single widget (ex. chat output) at
     multiple locations at the same time, I think.

   * It needs IOLib etc. to scale.

   * ..and more.


  --
  Lars Rune Nøstdal
  http://nostdal.org/
 




 36 Posts in Topic:
ANN: SymbolicWeb v0.1 (quite alpha) w/ source code this time
=?ISO-8859-1?Q?Lars_Rune_  2008-05-03 11:08:24 
Re: ANN: SymbolicWeb v0.1 (quite alpha) w/ source code this time
=?ISO-8859-1?Q?Lars_Rune_  2008-05-03 17:05:12 
Re: ANN: SymbolicWeb v0.1 (quite alpha) w/ source code this time
Joost Diepenmaat <joos  2008-05-03 19:17:52 
Re: ANN: SymbolicWeb v0.1 (quite alpha) w/ source code this time
=?UTF-8?B?TGFycyBSdW5lIE7  2008-05-03 19:20:33 
Re: ANN: SymbolicWeb v0.1 (quite alpha) w/ source code this time
Joost Diepenmaat <joos  2008-05-03 19:29:57 
Re: ANN: SymbolicWeb v0.1 (quite alpha) w/ source code this time
=?UTF-8?B?TGFycyBSdW5lIE7  2008-05-03 19:47:16 
Re: ANN: SymbolicWeb v0.1 (quite alpha) w/ source code this time
"Peter Hildebrandt&q  2008-05-03 17:30:14 
Re: ANN: SymbolicWeb v0.1 (quite alpha) w/ source code this time
=?UTF-8?B?TGFycyBSdW5lIE7  2008-05-03 17:42:29 
Re: ANN: SymbolicWeb v0.1 (quite alpha) w/ source code this time
"Frank \"frgo\&  2008-05-03 20:01:53 
Re: ANN: SymbolicWeb v0.1 (quite alpha) w/ source code this time
=?ISO-8859-1?Q?Lars_Rune_  2008-05-03 20:46:08 
Re: ANN: SymbolicWeb v0.1 (quite alpha) w/ source code this time
Ken Tilton <kennytilto  2008-05-04 09:14:01 
Re: ANN: SymbolicWeb v0.1 (quite alpha) w/ source code this time
bjorn@[EMAIL PROTECTED]   2008-05-06 11:42:42 
Re: ANN: SymbolicWeb v0.1 (quite alpha) w/ source code this time
"Peter Hildebrandt&q  2008-05-03 18:31:11 
Re: ANN: SymbolicWeb v0.1 (quite alpha) w/ source code this time
=?UTF-8?B?TGFycyBSdW5lIE7  2008-05-03 19:04:02 
Re: ANN: SymbolicWeb v0.1 (quite alpha) w/ source code this time
"Alex Mizrahi"   2008-05-03 20:48:10 
Re: ANN: SymbolicWeb v0.1 (quite alpha) w/ source code this time
vanekl <vanek@[EMAIL P  2008-05-04 01:41:52 
Re: ANN: SymbolicWeb v0.1 (quite alpha) w/ source code this time
Ken Tilton <kennytilto  2008-05-04 09:31:51 
Competition is not ALWAYS good
Slobodan Blazeski <slo  2008-05-03 13:17:21 
Re: Competition is not ALWAYS good
"Alex Mizrahi"   2008-05-04 00:03:17 
Re: ANN: SymbolicWeb v0.1 (quite alpha) w/ source code this time
vanekl <vanek@[EMAIL P  2008-05-04 02:41:58 
Re: ANN: SymbolicWeb v0.1 (quite alpha) w/ source code this time
=?ISO-8859-1?Q?Lars_Rune_  2008-05-04 07:45:03 
Re: ANN: SymbolicWeb v0.1 (quite alpha) w/ source code this time
=?ISO-8859-1?Q?Lars_Rune_  2008-05-04 13:32:50 
Re: ANN: SymbolicWeb v0.1 (quite alpha) w/ source code this time
vanekl <vanek@[EMAIL P  2008-05-04 14:56:52 
Re: ANN: SymbolicWeb v0.1 (quite alpha) w/ source code this time
=?ISO-8859-1?Q?Lars_Rune_  2008-05-04 17:24:55 
Re: ANN: SymbolicWeb v0.1 (quite alpha) w/ source code this time
vanekl <vanek@[EMAIL P  2008-05-04 16:10:17 
Re: ANN: SymbolicWeb v0.1 (quite alpha) w/ source code this time
Ken Tilton <kennytilto  2008-05-04 13:04:57 
Re: ANN: SymbolicWeb v0.1 (quite alpha) w/ source code this time
=?ISO-8859-1?Q?Lars_Rune_  2008-05-04 20:17:33 
Re: ANN: SymbolicWeb v0.1 (quite alpha) w/ source code this time
Tim X <timx@[EMAIL PRO  2008-05-04 17:40:03 
Re: Competition is not ALWAYS good
Slobodan Blazeski <slo  2008-05-05 01:05:45 
Re: Competition is not ALWAYS good
"Alex Mizrahi"   2008-05-05 13:05:05 
Re: Competition is not ALWAYS good
Slobodan Blazeski <slo  2008-05-05 03:48:31 
Re: Competition is not ALWAYS good
"Alex Mizrahi"   2008-05-05 15:02:19 
Re: ANN: SymbolicWeb v0.1 (quite alpha) w/ source code this time
"Peter Hildebrandt&q  2008-05-06 11:55:50 
Re: Competition is not ALWAYS good
Slobodan Blazeski <slo  2008-05-06 04:32:00 
Re: ANN: SymbolicWeb v0.1 (quite alpha) w/ source code this time
=?ISO-8859-1?Q?Lars_Rune_  2008-05-08 11:13:49 
Re: ANN: SymbolicWeb v0.1 (quite alpha) w/ source code this time
Madhu <enometh@[EMAIL   2008-05-08 17:34:58 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Jul 26 5:18:33 CDT 2008.