I think ABCL would make an excellent Ajax server. As such, it would have to support json-rpc. Any suggestions as to how to make this happen?
The first part is obviously the server, where the two choices that I can see are Hunchentoot and a servlet container such as Tomcat. In the latter case, I would expect to use a technique like abcl-web (which seems a little bit complicated, but doable).
The second part is the JSON parsing. How would I do that? Via CL-JSON? Via Yason? Via a Java library?
Sorry for these newbie questions. I’m just getting started with Common Lisp and ABCL.
Thanks,
Axel
On Mon, Dec 28, 2009 at 12:36 PM, Axel Rauschmayer axel@rauschma.de wrote:
I think ABCL would make an excellent Ajax server. As such, it would have to support json-rpc. Any suggestions as to how to make this happen?
I think I can give you some suggestions, but keep in mind that I have never used abcl in a web context, so other people might know better.
The first part is obviously the server, where the two choices that I can see are Hunchentoot and a servlet container such as Tomcat. In the latter case, I would expect to use a technique like abcl-web (which seems a little bit complicated, but doable).
I believe Hunchentoot does not currently work on abcl, since it depends on flexi-streams which depends on trivial-gray-streams which iirc doesn't support abcl. So the other option seems the most viable at the moment. Why is it complicated? Just write a dummy servlet that dispatches every request to a Lisp function. You can dispatch different URLs to different functions using the servlet container (i.e. mapping the same servlet class to different URL patterns), or if you want more flexibility do the dispatch in Lisp, but in that case you'll need to write the dispatch code yourself, or maybe adapt it from Hunchentoot. You might also want to write some glue code to access the request, response, and session objects in a more Lispy way.
The second part is the JSON parsing. How would I do that? Via CL-JSON? Via Yason? Via a Java library?
I can't recommend a JSON library, but if there are mature CL libraries, it's probably better to use one of them instead of a Java library.
Sorry for these newbie questions. I’m just getting started with Common Lisp and ABCL.
No reason to be sorry, those aren't really newbie questions, and anyway, new users are welcome :)
hth, Alessio Stalla
On 12/28/09 7:43 AM, Alessio Stalla wrote: […]
I believe Hunchentoot does not currently work on abcl, since it depends on flexi-streams which depends on trivial-gray-streams which iirc doesn't support abcl.
[…]
Actually, I believe that a Hunchentoot working with ABCL is not that difficult to achieve. This is a project that I have long worked on in a piecemeal fashion.
Fixing trivial-gray-streams to work with ABCL is pretty easy, and I have patches for this that I think work with the latest incarnation of ABCL's Gray streams (we moved some symbols around somewhere in 2009). More problematic is getting FLEXI-STREAMS working correctly as it fails a bunch of tests in Microsoft Windows Cyrillic code-planes whose cause has never really been that clear to me.
I even got Hunchentoot working at one point by writing the necessary multi-threaded hook. But I wasn't satisfied with some aspect of my port (maybe it was the FLEXI-STREAMS problems), so I left the code for the proverbial next day which never came.
Now that we have a shot to use the [JNA-based CFFI port by Luís Oliveria ][1] to get Hunchentoot's SSL stuff working, it makes more sense to try to push my work through to the end.
Its going to take a few days for me to look through my code, see what still works, and publish the necessary patches with a decent writeup so maybe I can get some help with the FLEXI-STREAMS problems. Unfortunately, I am traveling back to Europe tomorrow, so time is a bit short. Maybe I'll have some to show around the New Year.
Mark
[1]: http://trac.common-lisp.net/armedbear/ticket/14#comment:3
Cool. Sounds like all of the platform would benefit from this(?)
I will start my experiments with servlets, but might come back to Hunchentoot later.
What is the preferred way of installing libraries with ABCL? asdf- install does not seem to work. How about Lispy [1]?
Axel
[1] http://common-lisp.net/project/lispy/
On Dec 28, 2009, at 15:04 , Mark Evenson wrote:
On 12/28/09 7:43 AM, Alessio Stalla wrote: […]
I believe Hunchentoot does not currently work on abcl, since it depends on flexi-streams which depends on trivial-gray-streams which iirc doesn't support abcl.
[…]
Actually, I believe that a Hunchentoot working with ABCL is not that difficult to achieve. This is a project that I have long worked on in a piecemeal fashion.
Fixing trivial-gray-streams to work with ABCL is pretty easy, and I have patches for this that I think work with the latest incarnation of ABCL's Gray streams (we moved some symbols around somewhere in 2009). More problematic is getting FLEXI-STREAMS working correctly as it fails a bunch of tests in Microsoft Windows Cyrillic code-planes whose cause has never really been that clear to me.
I even got Hunchentoot working at one point by writing the necessary multi-threaded hook. But I wasn't satisfied with some aspect of my port (maybe it was the FLEXI-STREAMS problems), so I left the code for the proverbial next day which never came.
Now that we have a shot to use the [JNA-based CFFI port by Luís Oliveria ][1] to get Hunchentoot's SSL stuff working, it makes more sense to try to push my work through to the end.
Its going to take a few days for me to look through my code, see what still works, and publish the necessary patches with a decent writeup so maybe I can get some help with the FLEXI-STREAMS problems. Unfortunately, I am traveling back to Europe tomorrow, so time is a bit short. Maybe I'll have some to show around the New Year.
Mark
-- "A screaming comes across the sky. It has happened before, but there is nothing to compare to it now."
armedbear-devel mailing list armedbear-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/armedbear-devel
On 12/28/09 9:59 AM, Axel Rauschmayer wrote:
Cool. Sounds like all of the platform would benefit from this(?)
I will start my experiments with servlets, but might come back to Hunchentoot later.
What is the preferred way of installing libraries with ABCL? asdf-install does not seem to work. How about Lispy [1]?
[…]
I use SBCL's built-in ASDF-INSTALL including
(require 'asdf) (pushnew '(merge-pathnames ".sbcl/systems/" (user-homedir-pathname)) asdf:*central-registry*)
in my "~/.abclrc". Since I usually want to check the system works with SBCL before trying it in ABCL anyways, its handy to have both sharing the same ASDF location.
I have no experience with Lispy.
On 12/28/09 10:06 AM, Mark Evenson wrote: […]
I have no experience with Lispy.
Although after looking briefly through the Lispy documentation, I would think this is a good thing for ABCL to manage ASDF dependencies, especially if I could somehow shoehorn ABCL specific pathes overlaid on others' distributions. I'll take a look at getting Lispy working with ABCL when I get a chance.
On 12/28/09 3:04 PM, Mark Evenson wrote:
Actually, I believe that a Hunchentoot working with ABCL is not that difficult to achieve. This is a project that I have long worked on in a piecemeal fashion.
The "port" of Hunchentoot turned out to be rather simple, mostly about gently nudging the relevant ASDF packages to point at ABCL's namespace for its GRAY-STREAMS implementations. FLEXI-STREAMS still fails tests, but I believe it points to an error in ABCL's notion of CLOS inheritance.
Since newcomers to ABCL usually go looking for a web server to play around with, I think this effort deserves a [web page to collect the assorted information necessary to get such a seemingly simple task done][1]. Actually getting ABCL working with Tomcat and/or GAE is probably the better way to go for a production instance but Hunchentoot forms an important enough CL effort that we should at least help people to use it where possible less they write off ABCL for SBCL or Clojure (although you ain't running Hunchentoot on Clojure anytime soon). I found some time to package my patches as well as write a shell script to install and patch Hunchentoot with its dependencies. I've misjudged the time it takes to write the whole effort up so the result available today should by no means taken as final, but I at least wanted to publish something for my efforts today.
Feedback welcome.
[1]: http://slack.net/~evenson/abcl/hunchentoot
BTW: it is really easy to implement JSON-RPC with Hunchentoot and CL-JSON (which, alas, currently does not always work on ABCL). That makes CL a nice counterpart to Ajax frameworks such as Dojo. I still have to try out Parenscript, but if it works like I imagine (hopefully similar to GWT) then ABCL could become a really compelling Ajax development platform.
If you are after newbies, then installing packages must be easy. I'm really happy with the work-around shown on this mailing list, where one uses SBCL to install packages for ABCL. In the long run, ABCL obviously needs some kind of installation management.
Greetings,
Axel
On Jan 4, 2010, at 17:13 , Mark Evenson wrote:
On 12/28/09 3:04 PM, Mark Evenson wrote:
Actually, I believe that a Hunchentoot working with ABCL is not that difficult to achieve. This is a project that I have long worked on in a piecemeal fashion.
The "port" of Hunchentoot turned out to be rather simple, mostly about gently nudging the relevant ASDF packages to point at ABCL's namespace for its GRAY-STREAMS implementations. FLEXI-STREAMS still fails tests, but I believe it points to an error in ABCL's notion of CLOS inheritance.
Since newcomers to ABCL usually go looking for a web server to play around with, I think this effort deserves a [web page to collect the assorted information necessary to get such a seemingly simple task done][1]. Actually getting ABCL working with Tomcat and/or GAE is probably the better way to go for a production instance but Hunchentoot forms an important enough CL effort that we should at least help people to use it where possible less they write off ABCL for SBCL or Clojure (although you ain't running Hunchentoot on Clojure anytime soon). I found some time to package my patches as well as write a shell script to install and patch Hunchentoot with its dependencies. I've misjudged the time it takes to write the whole effort up so the result available today should by no means taken as final, but I at least wanted to publish something for my efforts today.
Feedback welcome.
-- "A screaming comes across the sky. It has happened before, but there is nothing to compare to it now."
armedbear-devel mailing list armedbear-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/armedbear-devel
On 1/4/10 5:30 PM, Axel Rauschmayer wrote: […]
If you are after newbies, then installing packages must be easy. I'm really happy with the work-around shown on this mailing list, where one uses SBCL to install packages for ABCL. In the long run, ABCL obviously needs some kind of installation management.
Actually looking through ASDF-INSTALL today didn't leave the impression that there would be too much to do to get it to work with ABCL's ASDF. I had feared that being stuck on an ancient ASDF until we [implement the long form of DEFINE-METHOD-COMBINATION][1] but now I think it is more a matter of hooking up the socket interfaces correctly.
I've filed a [ticket for this targeting the abcl-0.19 release][2].
[1]: http://trac.common-lisp.net/armedbear/ticket/66 [2]: http://trac.common-lisp.net/armedbear/ticket/78
Since we're talking about web servers, can't resist sharing my minimal http server for ABCL. http://svn.mumble.net:8080/svn/lsw/trunk/util/server.lisp
-Alan
On Mon, Jan 4, 2010 at 1:26 PM, Mark Evenson evenson@panix.com wrote:
On 1/4/10 5:30 PM, Axel Rauschmayer wrote: […]
If you are after newbies, then installing packages must be easy. I'm really happy with the work-around shown on this mailing list, where one uses SBCL to install packages for ABCL. In the long run, ABCL obviously needs some kind of installation management.
Actually looking through ASDF-INSTALL today didn't leave the impression that there would be too much to do to get it to work with ABCL's ASDF. I had feared that being stuck on an ancient ASDF until we [implement the long form of DEFINE-METHOD-COMBINATION][1] but now I think it is more a matter of hooking up the socket interfaces correctly.
I've filed a [ticket for this targeting the abcl-0.19 release][2].
-- "A screaming comes across the sky. It has happened before, but there is nothing to compare to it now."
armedbear-devel mailing list armedbear-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/armedbear-devel
On 1/4/10 5:13 PM, Mark Evenson wrote:
On 12/28/09 3:04 PM, Mark Evenson wrote:
Actually, I believe that a Hunchentoot working with ABCL is not that difficult to achieve. This is a project that I have long worked on in a piecemeal fashion.
[…]
Since newcomers to ABCL usually go looking for a web server to play around with, I think this effort deserves a [web page to collect the assorted information necessary to get such a seemingly simple task done][1].
[…]
Hunchentoot is now working again with ABCL, with the installation instructions adjusted to use Quicklisp. A fair number of previous patches have been incorporated upstream.
As it stands now, one needs to build ABCL from [trunk past r13272][1], and then patch [usocket][2], [bordeaux-threads][3], and [Hunchentoot][4] itself.
I'll work on getting the necessary patches into the necessary repositories.
Bug reports solicited.
[1]: http://trac.common-lisp.net/armedbear/changeset/13272 [2]:http://slack.net/~evenson/abcl/hunchentoot/quicklisp-usocket-abcl-20110427a.... [3]: http://slack.net/~evenson/abcl/hunchentoot/quicklisp-bordeaux-threads-abcl-2... [4]: http://slack.net/~evenson/abcl/hunchentoot/quicklisp-hunchentoot-abcl-201104...
armedbear-devel@common-lisp.net