Re: [CODE4LIB] Anyone using node.js?

2012-05-09 Thread Berry, Rob
You almost certainly should not rewrite an entire codebase from scratch unless 
there's an extremely good reason to do so. JoelOnSoftware did a good piece on 
it - http://www.joelonsoftware.com/articles/fog69.html.

Why has your project manager decided Node.js is the way to go instead of 
something like Python or Perl? Just because it's a shiny new technology? 
Python's got Twisted and Perl has POE if you want to do asynchronous 
programming. They also both have a very large number of excellent quality 
libraries to do innumerable other things.


From: Code for Libraries [CODE4LIB@LISTSERV.ND.EDU] on behalf of Ed Summers 
[e...@pobox.com]
Sent: 09 May 2012 04:26
To: CODE4LIB@LISTSERV.ND.EDU
Subject: Re: [CODE4LIB] Anyone using node.js?

I've been using NodeJS in a few side projects lately, and have come to
like it quite a bit for certain types of applications: specifically
applications that need to do a lot of I/O in memory constrained
environments. A recent one is Wikitweets [1] which provides a real
time view of tweets on Twitter that reference Wikipedia. Similarly
Wikistream [2] monitors ~30 Wikimedia IRC channels for information
about Wikipedia articles being edited and publishes them to the Web.

For both these apps the socket.io library for NodeJS provided a really
nice abstraction for streaming data from the server to the client
using a variety of mechanisms: web sockets, flash socket, long
polling, JSONP polling, etc. NodeJS' event driven programming model
made it easy to listen to the Twitter stream, or the ~30 IRC channels,
while simultaneously holding open socket connections to browsers to
push updates to--all from within one process. Doing this sort of thing
in a more typical web application stack like Apache or Tomcat can get
very expensive where each client connection is a new thread or
process--which can lead to lots of memory being used.

If you've done any JavaScript programming in the browser, it will seem
familiar, because of the extensive use of callbacks. This can take
some getting used to, but it can be a real win in some cases,
especially in applications that are more I/O bound than CPU bound.
Ryan Dahl (the creator of NodeJS) gave a presentation [4] to a PHP
group last year which does a really nice job of describing how NodeJS
is different, and why it might be useful for you. If you are new to
event driven programming I wouldn't underestimate how much time you
might spend feeling like you are turning our brain inside out.

In general I was really pleased with the library support in NodeJS,
and the amount of activity there is in the community. The ability to
run the same code in the client as in the browser might be of some
interest. Also, being able use libraries like jQuery or PhantomJS in
command line programs is pretty interesting for things like screen
scraping the tagsoup HTML that is so prevalent on the Web.

If you end up needing to do RDF and XML processing from within NodeJS
and you aren't finding good library support you might want to find
databases (Sesame, eXist, etc) that have good HTTP APIs and use
something like request [5] if there isn't already support for it. I
wrote up why NodeJS was fun to use for Wikistream on my blog if you
are interested [6].

I recommend you try doing something small to get your feet wet with
NodeJS first before diving in with the rewrite. Good luck!

//Ed

[1] http://wikitweets.herokuapp.com
[2] http://wikistream.inkdroid.org
[3] http://inkdroid.org/journal/2011/11/07/an-ode-to-node/
[4] http://www.youtube.com/watch?v=jo_B4LTHi3I
[5] https://github.com/mikeal/request
[6] http://inkdroid.org/journal/2011/11/07/an-ode-to-node/

On Tue, May 8, 2012 at 5:24 PM, Randy Fischer randy.fisc...@gmail.com wrote:
 On Mon, May 7, 2012 at 11:17 PM, Ethan Gruber ewg4x...@gmail.com wrote:



 It was recently suggested to me that a project I am working on may adopt
 node.js for its architecture (well, be completely re-written for node.js).
 I don't know anything about node.js, and have only heard of it in some
 passing discussions on the list.  I'd like to know if anyone on code4lib
 has experience developing in this platform, and what their thoughts are on
 it, positive or negative.



 It's a very interesting project - I think of it as kind of non-preemptive
 multitasking framework, very much like POE in the Perl world, but with a
 more elegant way of managing the event queue.

 Where it could shine is that it accepts streaming, non-blocking HTTP
 requests.  So for large PUTs and POSTs, it could be a real win (most other
 web-server arrangements are going to require completed uploads of the
 request, followed by a hand-off to your framework of an opened file
 descriptor to a temporary file).

 My naive tests with it a year or so ago gave inconsistent results, though
 (sometime the checksums of large PUTs were right, sometimes not).

 And of course to scale up, do SSL, etc, you'll really need to put something

Re: [CODE4LIB] Anyone using node.js?

2012-05-09 Thread Ed Summers
On Wed, May 9, 2012 at 3:47 AM, Berry, Rob robert.be...@liverpool.ac.uk wrote:
 You almost certainly should not rewrite an entire codebase from scratch 
 unless there's an extremely good reason to do so. JoelOnSoftware did a good 
 piece on it - http://www.joelonsoftware.com/articles/fog69.html.

 Why has your project manager decided Node.js is the way to go instead of 
 something like Python or Perl? Just because it's a shiny new technology? 
 Python's got Twisted and Perl has POE if you want to do asynchronous 
 programming. They also both have a very large number of excellent quality 
 libraries to do innumerable other things.

I totally agree, it's all about the right tool for the job.

Just to clarify, NodeJS is quite a bit different than Twisted and POE
because the entire language and its supporting libraries are written
for event driven programming from the bottom up. When using Twisted
and POE you may end up needing existing libraries that are
synchronous, so the wins aren't as great, and things can
get...complicated. For a pretty even handed description of this check
out Paul Querna's blog post about why Rackspace decided to switch from
Twisted to NodeJS for their cloud monitoring dashboard applications
[1].

I am not saying Perl and Python are not good tools (they are) just
that the benefits of using NodeJS are not all hype.

//Ed

[1] 
http://journal.paul.querna.org/articles/2011/12/18/the-switch-python-to-node-js/


Re: [CODE4LIB] Anyone using node.js?

2012-05-09 Thread Berry, Rob
No, it's not all hype. I've used Node to write a server for ticket scanners at 
a festival and enjoyed working with it. It performed well and was stable. I'm 
just sceptical about someone who wants to throw away a codebase for something 
that, whether deserved or not, is generating a lot of buzz at the moment.

Though re Python I would say mixing Django with Twisted is a fairly blatant 
error. There are libraries built on Twisted to serve web-pages, and if you're 
doing event-driven programming you should really be using them.


From: Code for Libraries [CODE4LIB@LISTSERV.ND.EDU] on behalf of Ed Summers 
[e...@pobox.com]
Sent: 09 May 2012 09:24
To: CODE4LIB@LISTSERV.ND.EDU
Subject: Re: [CODE4LIB] Anyone using node.js?

On Wed, May 9, 2012 at 3:47 AM, Berry, Rob robert.be...@liverpool.ac.uk wrote:
 You almost certainly should not rewrite an entire codebase from scratch 
 unless there's an extremely good reason to do so. JoelOnSoftware did a good 
 piece on it - http://www.joelonsoftware.com/articles/fog69.html.

 Why has your project manager decided Node.js is the way to go instead of 
 something like Python or Perl? Just because it's a shiny new technology? 
 Python's got Twisted and Perl has POE if you want to do asynchronous 
 programming. They also both have a very large number of excellent quality 
 libraries to do innumerable other things.

I totally agree, it's all about the right tool for the job.

Just to clarify, NodeJS is quite a bit different than Twisted and POE
because the entire language and its supporting libraries are written
for event driven programming from the bottom up. When using Twisted
and POE you may end up needing existing libraries that are
synchronous, so the wins aren't as great, and things can
get...complicated. For a pretty even handed description of this check
out Paul Querna's blog post about why Rackspace decided to switch from
Twisted to NodeJS for their cloud monitoring dashboard applications
[1].

I am not saying Perl and Python are not good tools (they are) just
that the benefits of using NodeJS are not all hype.

//Ed

[1] 
http://journal.paul.querna.org/articles/2011/12/18/the-switch-python-to-node-js/


Re: [CODE4LIB] Anyone using node.js?

2012-05-09 Thread Ed Summers
On Wed, May 9, 2012 at 4:50 AM, Berry, Rob robert.be...@liverpool.ac.uk wrote:
 Though re Python I would say mixing Django with Twisted is a fairly blatant 
 error. There are libraries built on Twisted to serve web-pages, and if you're 
 doing event-driven programming you should really be using them.

Heh, but part of your argument for using POE or Twisted was that they
also both have a very large number of excellent quality libraries to
do innumerable other things. I think it's more like a slippery slope
of mixing programming paradigms than it is a blatant error. Also, I
think it was specifically the Django ORM code that bit them hardest,
not HTTP calls. Yes there are ORM options like adbmapper, but I think
you increasingly find yourself in the weeds on the fringe of the
Python community.

//Ed


Re: [CODE4LIB] Anyone using node.js?

2012-05-09 Thread Berry, Rob
No, fair enough, you are right. If that's the paradigm you want it would be a 
better bet to go for a language that has it built in from the ground up.

From: Code for Libraries [CODE4LIB@LISTSERV.ND.EDU] on behalf of Ed Summers 
[e...@pobox.com]
Sent: 09 May 2012 10:05
To: CODE4LIB@LISTSERV.ND.EDU
Subject: Re: [CODE4LIB] Anyone using node.js?

On Wed, May 9, 2012 at 4:50 AM, Berry, Rob robert.be...@liverpool.ac.uk wrote:
 Though re Python I would say mixing Django with Twisted is a fairly blatant 
 error. There are libraries built on Twisted to serve web-pages, and if you're 
 doing event-driven programming you should really be using them.

Heh, but part of your argument for using POE or Twisted was that they
also both have a very large number of excellent quality libraries to
do innumerable other things. I think it's more like a slippery slope
of mixing programming paradigms than it is a blatant error. Also, I
think it was specifically the Django ORM code that bit them hardest,
not HTTP calls. Yes there are ORM options like adbmapper, but I think
you increasingly find yourself in the weeds on the fringe of the
Python community.

//Ed


Re: [CODE4LIB] Anyone using node.js?

2012-05-09 Thread Ed Summers
On Wed, May 9, 2012 at 5:17 AM, Berry, Rob robert.be...@liverpool.ac.uk wrote:
 No, fair enough, you are right. If that's the paradigm you want it would be a 
 better bet to go for a language that has it built in from the ground up.

And (just so it isn't lost) you are absolutely right to question
whether there is a legitimate reason for wanting to do the rewrite :-)

//Ed


Re: [CODE4LIB] Anyone using node.js?

2012-05-09 Thread Godmar Back
On Tue, May 8, 2012 at 11:26 PM, Ed Summers e...@pobox.com wrote:


 For both these apps the socket.io library for NodeJS provided a really
 nice abstraction for streaming data from the server to the client
 using a variety of mechanisms: web sockets, flash socket, long
 polling, JSONP polling, etc. NodeJS' event driven programming model
 made it easy to listen to the Twitter stream, or the ~30 IRC channels,
 while simultaneously holding open socket connections to browsers to
 push updates to--all from within one process. Doing this sort of thing
 in a more typical web application stack like Apache or Tomcat can get
 very expensive where each client connection is a new thread or
 process--which can lead to lots of memory being used.


We've also been using socket.io for our cloudbrowser project, with great
success. The only drawback is that websockets don't (yet) support
compression, but that's not node.js fault. Another fault: you can't easily
migrate open socket.io connections across processes (yet). FWIW, since you
mention Rackspace - the lead student on the the cloudbrowser project has
now accepted a job at Rackspace (having turned down M$), in part because he
finds their technology/environment more exciting.

I need to dampen the enthusiasm about memory use a bit. It's true that
you're saving memory for additional threads etc., but - depending on your
application - you're also paying for that because V8 still lacks some
opportunities for sharing other environments have. For instance, if you run
25 Apache instances with say mod_whatever, they'll all share the code via
shared .so file. In Java/Tomcat, the JVM exploits, under the hood, similar
sharing opportunities.

V8/node.js, as of now, does not. This means if you need to load libraries
such as jQuery n times, you're paying a substantial price (we found on the
order of 1-2MB per instance), because V8 will not do any code sharing under
the hood.  That said, whether you need to load it multiple times depends on
your application - but that's another subtle and error prone issue.


 If you've done any JavaScript programming in the browser, it will seem
 familiar, because of the extensive use of callbacks. This can take
 some getting used to, but it can be a real win in some cases,
 especially in applications that are more I/O bound than CPU bound.
 Ryan Dahl (the creator of NodeJS) gave a presentation [4] to a PHP
 group last year which does a really nice job of describing how NodeJS
 is different, and why it might be useful for you. If you are new to
 event driven programming I wouldn't underestimate how much time you
 might spend feeling like you are turning our brain inside out.


The complications arising from event-based programming are an extensively
written-about topic of research; one available approach is the use of
compilers that provide a linear syntax for asynchronous calls. The TAME
system, which originally arose from research at MIT, is one such example.
Originally for C++, there's now a version for JavaScript available:
http://tamejs.org/  Though I haven't tried it myself, I'm eager to and
would also like to know if someone else has. The tamejs.org provides
excellent reading for why/how you'd want to do this.

 - Godmar


Re: [CODE4LIB] Anyone using node.js?

2012-05-09 Thread John Fereira
Here's one:  http://vivosearchlight.org/

It's a bookmarklet that installs simply by dragging a button on that web site 
to the menu bar in your browser.  Once installed you can go to any web page on 
the net, then click on the VIVO Searchlight link in the menu bar.  That 
action takes the text from the web site, does some simple text analysis, then 
sends common terms to a search engine that has indexed several instances of a 
semantic web application which contains data about researches.  A window then 
pops up at the top of the browser window which shows you who may be doing 
research in the subject area represented on the web page you're looking at.  
You can then highlight any text on that page and it sends just that bit of text 
to the search engine to refine results.  

-Original Message-
From: Code for Libraries [mailto:CODE4LIB@LISTSERV.ND.EDU] On Behalf Of Ethan 
Gruber
Sent: Tuesday, May 08, 2012 10:35 AM
To: CODE4LIB@LISTSERV.ND.EDU
Subject: Re: [CODE4LIB] Anyone using node.js?

Thanks, it really helps to get a list of projects using it so I can get a 
better sense of what's possible.

On Tue, May 8, 2012 at 10:23 AM, Cary Gordon listu...@chillco.com wrote:

 I have done some work with node building apps in the areas of mapping 
 and communication (chat, etc.).

 Looking at the list at

 https://github.com/joyent/node/wiki/Projects,-Applications,-and-Compan
 ies-Using-Node
 ,
 the emphasis on real-time stands out.

 Node is fast and lightweight, and is well suited to applications that 
 need speed and can take advantage of multiple channels.

 Thanks,

 Cary

 On Mon, May 7, 2012 at 8:17 PM, Ethan Gruber ewg4x...@gmail.com wrote:
  Hi all,
 
  It was recently suggested to me that a project I am working on may 
  adopt node.js for its architecture (well, be completely re-written 
  for
 node.js).
  I don't know anything about node.js, and have only heard of it in 
  some passing discussions on the list.  I'd like to know if anyone on 
  code4lib has experience developing in this platform, and what their 
  thoughts are
 on
  it, positive or negative.
 
  Thanks,
  Ethan



 --
 Cary Gordon
 The Cherry Hill Company
 http://chillco.com



Re: [CODE4LIB] Anyone using node.js?

2012-05-08 Thread Nate Vack
On Mon, May 7, 2012 at 10:17 PM, Ethan Gruber ewg4x...@gmail.com wrote:

 It was recently suggested to me that a project I am working on may adopt
 node.js for its architecture (well, be completely re-written for node.js).
 I don't know anything about node.js, and have only heard of it in some
 passing discussions on the list.  I'd like to know if anyone on code4lib
 has experience developing in this platform, and what their thoughts are on
 it, positive or negative.

I've only played a little bit, but my take is: you'll have more parts
to build than with other systems. If you need persistent connections,
it's gonna be neat; if you don't, it's probably not worth the bother.

The Peepcode screencasts on Node:

https://peepcode.com/screencasts/node

are probably worth your time and money.

-n


Re: [CODE4LIB] Anyone using node.js?

2012-05-08 Thread Cary Gordon
I have done some work with node building apps in the areas of mapping
and communication (chat, etc.).

Looking at the list at
https://github.com/joyent/node/wiki/Projects,-Applications,-and-Companies-Using-Node,
the emphasis on real-time stands out.

Node is fast and lightweight, and is well suited to applications that
need speed and can take advantage of multiple channels.

Thanks,

Cary

On Mon, May 7, 2012 at 8:17 PM, Ethan Gruber ewg4x...@gmail.com wrote:
 Hi all,

 It was recently suggested to me that a project I am working on may adopt
 node.js for its architecture (well, be completely re-written for node.js).
 I don't know anything about node.js, and have only heard of it in some
 passing discussions on the list.  I'd like to know if anyone on code4lib
 has experience developing in this platform, and what their thoughts are on
 it, positive or negative.

 Thanks,
 Ethan



-- 
Cary Gordon
The Cherry Hill Company
http://chillco.com


Re: [CODE4LIB] Anyone using node.js?

2012-05-08 Thread Ethan Gruber
Thanks.  I have been working on a system that allows editing of RDF in web
forms, creating linked data connections in the background, publishing to
eXist and Solr for dissemination, and will eventually integrate operation
with an RDF triplestore/SPARQL, all with Tomcat apps.  I'm not sure it is
possible to create, manage, and deliver our content with node.js, but I was
told by the project manager that Apache, Java, and Tomcat were showing
signs of age.  I'm not so sure about this considering the prevalence of
Tomcat apps both in libraries and industry.  I happen to be very fond of
Solr, and it seems very risky to start over in node.js, especially since I
can't be certain the end product will succeed.  I prefer to err on the side
of stability.

If anyone has other thoughts about the future of Tomcat applications in the
library, or more broadly cultural heritage informatics, feel free to jump
in.  Our data is exclusively XML, so LAMP/Rails aren't really options.

Ethan

On Tue, May 8, 2012 at 10:03 AM, Nate Vack njv...@wisc.edu wrote:

 On Mon, May 7, 2012 at 10:17 PM, Ethan Gruber ewg4x...@gmail.com wrote:

  It was recently suggested to me that a project I am working on may adopt
  node.js for its architecture (well, be completely re-written for
 node.js).
  I don't know anything about node.js, and have only heard of it in some
  passing discussions on the list.  I'd like to know if anyone on code4lib
  has experience developing in this platform, and what their thoughts are
 on
  it, positive or negative.

 I've only played a little bit, but my take is: you'll have more parts
 to build than with other systems. If you need persistent connections,
 it's gonna be neat; if you don't, it's probably not worth the bother.

 The Peepcode screencasts on Node:

 https://peepcode.com/screencasts/node

 are probably worth your time and money.

 -n



Re: [CODE4LIB] Anyone using node.js?

2012-05-08 Thread Andrew Gordon

Node is fairly new - so it would be a little experimental.
But it does have an active community, and there are quite a few useful 
packages; including a solr-client (http://search.npmjs.org/#/solr-client).


I would look into it, if only for the purposes of learning a little more 
about it and to see if it would work in the context of your needs.

-drew

On 5/8/12 9:17 AM, Ethan Gruber wrote:

Thanks.  I have been working on a system that allows editing of RDF in web
forms, creating linked data connections in the background, publishing to
eXist and Solr for dissemination, and will eventually integrate operation
with an RDF triplestore/SPARQL, all with Tomcat apps.  I'm not sure it is
possible to create, manage, and deliver our content with node.js, but I was
told by the project manager that Apache, Java, and Tomcat were showing
signs of age.  I'm not so sure about this considering the prevalence of
Tomcat apps both in libraries and industry.  I happen to be very fond of
Solr, and it seems very risky to start over in node.js, especially since I
can't be certain the end product will succeed.  I prefer to err on the side
of stability.

If anyone has other thoughts about the future of Tomcat applications in the
library, or more broadly cultural heritage informatics, feel free to jump
in.  Our data is exclusively XML, so LAMP/Rails aren't really options.

Ethan

On Tue, May 8, 2012 at 10:03 AM, Nate Vacknjv...@wisc.edu  wrote:


On Mon, May 7, 2012 at 10:17 PM, Ethan Gruberewg4x...@gmail.com  wrote:


It was recently suggested to me that a project I am working on may adopt
node.js for its architecture (well, be completely re-written for

node.js).

I don't know anything about node.js, and have only heard of it in some
passing discussions on the list.  I'd like to know if anyone on code4lib
has experience developing in this platform, and what their thoughts are

on

it, positive or negative.

I've only played a little bit, but my take is: you'll have more parts
to build than with other systems. If you need persistent connections,
it's gonna be neat; if you don't, it's probably not worth the bother.

The Peepcode screencasts on Node:

https://peepcode.com/screencasts/node

are probably worth your time and money.

-n






--
Andrew Gordon
MSI April 2011
School of Information
University of Michigan


Re: [CODE4LIB] Anyone using node.js?

2012-05-08 Thread Ethan Gruber
Thanks, it really helps to get a list of projects using it so I can get a
better sense of what's possible.

On Tue, May 8, 2012 at 10:23 AM, Cary Gordon listu...@chillco.com wrote:

 I have done some work with node building apps in the areas of mapping
 and communication (chat, etc.).

 Looking at the list at

 https://github.com/joyent/node/wiki/Projects,-Applications,-and-Companies-Using-Node
 ,
 the emphasis on real-time stands out.

 Node is fast and lightweight, and is well suited to applications that
 need speed and can take advantage of multiple channels.

 Thanks,

 Cary

 On Mon, May 7, 2012 at 8:17 PM, Ethan Gruber ewg4x...@gmail.com wrote:
  Hi all,
 
  It was recently suggested to me that a project I am working on may adopt
  node.js for its architecture (well, be completely re-written for
 node.js).
  I don't know anything about node.js, and have only heard of it in some
  passing discussions on the list.  I'd like to know if anyone on code4lib
  has experience developing in this platform, and what their thoughts are
 on
  it, positive or negative.
 
  Thanks,
  Ethan



 --
 Cary Gordon
 The Cherry Hill Company
 http://chillco.com



Re: [CODE4LIB] Anyone using node.js?

2012-05-08 Thread Godmar Back
On Tue, May 8, 2012 at 10:17 AM, Ethan Gruber ewg4x...@gmail.com wrote:

 Thanks.  I have been working on a system that allows editing of RDF in web
 forms, creating linked data connections in the background, publishing to
 eXist and Solr for dissemination, and will eventually integrate operation
 with an RDF triplestore/SPARQL, all with Tomcat apps.  I'm not sure it is
 possible to create, manage, and deliver our content with node.js, but I was
 told by the project manager that Apache, Java, and Tomcat were showing
 signs of age.  I'm not so sure about this considering the prevalence of
 Tomcat apps both in libraries and industry.  I happen to be very fond of
 Solr, and it seems very risky to start over in node.js, especially since I
 can't be certain the end product will succeed.  I prefer to err on the side
 of stability.

 If anyone has other thoughts about the future of Tomcat applications in the
 library, or more broadly cultural heritage informatics, feel free to jump
 in.  Our data is exclusively XML, so LAMP/Rails aren't really options.


We've used node.js (but not Express, their web app framework) to build our
own experimental AJAX framework (http://cloudbrowser.cs.vt.edu/ ). We also
have extensive experience with Tomcat-based systems.

Given that wide, and increasing use of node.js, I'm optimistic that it
should be stable and reliable enough for your needs; let me emphasize three
points you may want to consider.

a) You're programming in JavaScript/CoffeeScript, which is a higher-level
language than Java. My students are vastly more productive than in Java.
The use of CoffeeScript and require still allows for maintainable code.

b) node.js is a single-threaded environment. Reduced potential for some
race conditions, but requires an asynchronous programming style. If you've
done client-side AJAX, you'll find it familiar; otherwise, you need to
adapt. New potential for race conditions.

c) Scalability. Each node.js instance runs on a single core; modules exist
for clustering on a single machine. I don't know/don't believe session
state replication is as well supported as for Tomcat. On the other hand,
Tomcat can be a setup nightmare (in my experience).

d) Supporting libraries. We've found the surrounding infrastructure
excellent. A large community is developing for it http://search.npmjs.org/ .
The cool thing is that many client-side libraries work or are easily ported
(e.g. moment.js).

e) Doing XML in JavaScript. Though JavaScript as a language is intended to
be embedded in XML documents, processing XML in JavaScript can be almost as
awkward as in Java. JSON is clearly preferred and integrates very naturally.

 - Godmar


Re: [CODE4LIB] Anyone using node.js?

2012-05-08 Thread Hugh Cayless
Your triplestore and/or the client libraries you use to interface with it might 
well be Java too. While it's true that Apache, Java, and Tomcat are no longer 
the new hotness, they are solid and proven technologies. You would have to 
start breaking my fingers to convince me to ditch Solr. And as you say, nothing 
else (unless you want to go .NET) has that kind of XML support. I have hope for 
Saxon CE, but it's still in beta.

My experience of Libraries is that they are mostly dead conservative when it 
comes to what they'll support. So I doubt Tomcat is going away any time soon.

Hugh

On May 8, 2012, at 10:17AM, Ethan Gruber wrote:

 Thanks.  I have been working on a system that allows editing of RDF in web
 forms, creating linked data connections in the background, publishing to
 eXist and Solr for dissemination, and will eventually integrate operation
 with an RDF triplestore/SPARQL, all with Tomcat apps.  I'm not sure it is
 possible to create, manage, and deliver our content with node.js, but I was
 told by the project manager that Apache, Java, and Tomcat were showing
 signs of age.  I'm not so sure about this considering the prevalence of
 Tomcat apps both in libraries and industry.  I happen to be very fond of
 Solr, and it seems very risky to start over in node.js, especially since I
 can't be certain the end product will succeed.  I prefer to err on the side
 of stability.
 
 If anyone has other thoughts about the future of Tomcat applications in the
 library, or more broadly cultural heritage informatics, feel free to jump
 in.  Our data is exclusively XML, so LAMP/Rails aren't really options.
 
 Ethan
 
 On Tue, May 8, 2012 at 10:03 AM, Nate Vack njv...@wisc.edu wrote:
 
 On Mon, May 7, 2012 at 10:17 PM, Ethan Gruber ewg4x...@gmail.com wrote:
 
 It was recently suggested to me that a project I am working on may adopt
 node.js for its architecture (well, be completely re-written for
 node.js).
 I don't know anything about node.js, and have only heard of it in some
 passing discussions on the list.  I'd like to know if anyone on code4lib
 has experience developing in this platform, and what their thoughts are
 on
 it, positive or negative.
 
 I've only played a little bit, but my take is: you'll have more parts
 to build than with other systems. If you need persistent connections,
 it's gonna be neat; if you don't, it's probably not worth the bother.
 
 The Peepcode screencasts on Node:
 
 https://peepcode.com/screencasts/node
 
 are probably worth your time and money.
 
 -n
 


Re: [CODE4LIB] Anyone using node.js?

2012-05-08 Thread Cary Gordon
Node is about three years old, which makes it an infant in library
terms. Rails is about eight and still doesn't have a lot of traction.
Perl (25 years) and Java (17 years) seem to be considered proven.

Node.js might wipe the floor (or not) with Java and Perl someday, but
ATM, those tools have something that node won't have for a while --
libraries that are useful to libraries.

What node does have going for it is the broad userbase for Javascript
(also 17 years). The learning curve is pretty short, if you have that
background.

Thanks,

Cary

On Tue, May 8, 2012 at 7:37 AM, Andrew Gordon as...@umich.edu wrote:
 Node is fairly new - so it would be a little experimental.
 But it does have an active community, and there are quite a few useful
 packages; including a solr-client (http://search.npmjs.org/#/solr-client).

 I would look into it, if only for the purposes of learning a little more
 about it and to see if it would work in the context of your needs.
 -drew


 On 5/8/12 9:17 AM, Ethan Gruber wrote:

 Thanks.  I have been working on a system that allows editing of RDF in web
 forms, creating linked data connections in the background, publishing to
 eXist and Solr for dissemination, and will eventually integrate operation
 with an RDF triplestore/SPARQL, all with Tomcat apps.  I'm not sure it is
 possible to create, manage, and deliver our content with node.js, but I
 was
 told by the project manager that Apache, Java, and Tomcat were showing
 signs of age.  I'm not so sure about this considering the prevalence of
 Tomcat apps both in libraries and industry.  I happen to be very fond of
 Solr, and it seems very risky to start over in node.js, especially since I
 can't be certain the end product will succeed.  I prefer to err on the
 side
 of stability.

 If anyone has other thoughts about the future of Tomcat applications in
 the
 library, or more broadly cultural heritage informatics, feel free to jump
 in.  Our data is exclusively XML, so LAMP/Rails aren't really options.

 Ethan

 On Tue, May 8, 2012 at 10:03 AM, Nate Vacknjv...@wisc.edu  wrote:

 On Mon, May 7, 2012 at 10:17 PM, Ethan Gruberewg4x...@gmail.com  wrote:

 It was recently suggested to me that a project I am working on may adopt
 node.js for its architecture (well, be completely re-written for

 node.js).

 I don't know anything about node.js, and have only heard of it in some
 passing discussions on the list.  I'd like to know if anyone on code4lib
 has experience developing in this platform, and what their thoughts are

 on

 it, positive or negative.

 I've only played a little bit, but my take is: you'll have more parts
 to build than with other systems. If you need persistent connections,
 it's gonna be neat; if you don't, it's probably not worth the bother.

 The Peepcode screencasts on Node:

 https://peepcode.com/screencasts/node

 are probably worth your time and money.

 -n




 --
 Andrew Gordon
 MSI April 2011
 School of Information
 University of Michigan



-- 
Cary Gordon
The Cherry Hill Company
http://chillco.com


Re: [CODE4LIB] Anyone using node.js?

2012-05-08 Thread Ross Singer
On May 8, 2012, at 10:17 AM, Ethan Gruber wrote:
 
 in.  Our data is exclusively XML, so LAMP/Rails aren't really options.

^^ Really?  Nobody's going to take the bait with this one?

-Ross.

 
 Ethan
 
 On Tue, May 8, 2012 at 10:03 AM, Nate Vack njv...@wisc.edu wrote:
 
 On Mon, May 7, 2012 at 10:17 PM, Ethan Gruber ewg4x...@gmail.com wrote:
 
 It was recently suggested to me that a project I am working on may adopt
 node.js for its architecture (well, be completely re-written for
 node.js).
 I don't know anything about node.js, and have only heard of it in some
 passing discussions on the list.  I'd like to know if anyone on code4lib
 has experience developing in this platform, and what their thoughts are
 on
 it, positive or negative.
 
 I've only played a little bit, but my take is: you'll have more parts
 to build than with other systems. If you need persistent connections,
 it's gonna be neat; if you don't, it's probably not worth the bother.
 
 The Peepcode screencasts on Node:
 
 https://peepcode.com/screencasts/node
 
 are probably worth your time and money.
 
 -n
 


Re: [CODE4LIB] Anyone using node.js?

2012-05-08 Thread Nate Vack
On Tue, May 8, 2012 at 11:45 AM, Ross Singer rossfsin...@gmail.com wrote:
 On May 8, 2012, at 10:17 AM, Ethan Gruber wrote:

 in.  Our data is exclusively XML, so LAMP/Rails aren't really options.

 ^^ Really?  Nobody's going to take the bait with this one?

I can't see why they would; parsing XML in ruby is simply not possible.

;-)

-n


Re: [CODE4LIB] Anyone using node.js?

2012-05-08 Thread Nick Ruest
P͎̘̈̈̈Ä͖̈R̛̳̈̈̈S̡͇̈ͧ̈̽̈̈̈ͨÏ̙̐̈̈N͉̈ͤ̈̌̈͑̈̈͊G͓̈̈͐̈̽̈ ̈ͯ̈̈ͫ̈̌̈͛ͅẌ̿̈M͔̈͆̈̄̈̈̈͢L̙̈͋̈ͮ̈̈ ̠̼̈̈̈͋̈͏̈̉Ï̦̓̈ͦ̈̈̊̈Ṉ̈̈ ̷̈̈R̈̈ͣ̈͜Ü̙̹͖̍̈̈̈̈B̥̯̈̈̈̈̚Ÿ͎̱̈̈ͫ̈ ͖͚̈̈͌̈̈̈ͭ͜Ï̳͇̋̈̈̈́̈̈̄S̰̱͚̈̈̈̈̈ͬ͞ ̈̾̈S̡̝̩̈̈̿̈͊̈̈Ï̛̃̈̈M̴̈̀̈ͣ̈̈̈ͅP̈̾̈̈͗̈̈͝ͅL̈̈́̈̒̈Ÿ̷́̈̈ ̈̈̈N̠̪̈̈̈Ö̵̈̈̔̈͟T̈ͧ̈͗̈ͬ̈ 
̸̈̈̈͗̈ͫ̈͊͘P̈̓̈ͥ̈̂̈Ö͙̣͆̈̈͛̈ͤ̈S̞̈͒̈̈̈͊̈͠S͈̈̃̈̈ͦ̈̈͒͜Ḭ̈̈̈̈͟͝B̤͇̈̈̈L̈ͨ̈Ë̱



On 12-05-08 01:15 PM, Nate Vack wrote:

On Tue, May 8, 2012 at 11:45 AM, Ross Singerrossfsin...@gmail.com  wrote:

On May 8, 2012, at 10:17 AM, Ethan Gruber wrote:

in.  Our data is exclusively XML, so LAMP/Rails aren't really options.

^^ Really?  Nobody's going to take the bait with this one?

I can't see why they would; parsing XML in ruby is simply not possible.

;-)

-n


Re: [CODE4LIB] Anyone using node.js?

2012-05-08 Thread Ethan Gruber
For what it's worth, I have processed XML in PHP, Ruby, and Saxon/XSLT 2,
but I feel like I'm missing some sort of inside joke here.

Thanks for the info.  To clarify, I don't develop in java, but deploy
well-established java-based apps in Tomcat, like Solr and eXist (and am
looking into a java triplestore to run in Tomcat) and write scripts to make
these web services interact in whichever language seems to be the most
appropriate.  Node looks like it may be interesting to play around with,
but I'm wary of having to learn something completely new, jettisoning every
application and language I am experienced with, to put a new project into
production in the next 4-8 weeks.

Ethan

On Tue, May 8, 2012 at 1:15 PM, Nate Vack njv...@wisc.edu wrote:

 On Tue, May 8, 2012 at 11:45 AM, Ross Singer rossfsin...@gmail.com
 wrote:
  On May 8, 2012, at 10:17 AM, Ethan Gruber wrote:
 
  in.  Our data is exclusively XML, so LAMP/Rails aren't really options.
 
  ^^ Really?  Nobody's going to take the bait with this one?

 I can't see why they would; parsing XML in ruby is simply not possible.

 ;-)

 -n



Re: [CODE4LIB] Anyone using node.js?

2012-05-08 Thread Ross Singer
On May 8, 2012, at 2:01 PM, Ethan Gruber wrote:

 For what it's worth, I have processed XML in PHP, Ruby, and Saxon/XSLT 2,

So then explain why LAMP/Rails aren't really options.

It's hard to see how anybody can recommend node.js (or any other stack) based 
on this statement because without knowing _why_ these are inadequate.  My guess 
is that node's XML libraries are also libXML based, just like pretty much any 
other C-based language.

 but I feel like I'm missing some sort of inside joke here.
 
 Thanks for the info.  To clarify, I don't develop in java, but deploy
 well-established java-based apps in Tomcat, like Solr and eXist (and am
 looking into a java triplestore to run in Tomcat) and write scripts to make
 these web services interact in whichever language seems to be the most
 appropriate.  Node looks like it may be interesting to play around with,
 but I'm wary of having to learn something completely new, jettisoning every
 application and language I am experienced with, to put a new project into
 production in the next 4-8 weeks.

Eh, if your window is 4-8 weeks, then I wouldn't be considering node for this 
project.  It does, however, sound like you could really use a new project 
manager, because the one you have sounds terrible.

-Ross.

 
 Ethan
 
 On Tue, May 8, 2012 at 1:15 PM, Nate Vack njv...@wisc.edu wrote:
 
 On Tue, May 8, 2012 at 11:45 AM, Ross Singer rossfsin...@gmail.com
 wrote:
 On May 8, 2012, at 10:17 AM, Ethan Gruber wrote:
 
 in.  Our data is exclusively XML, so LAMP/Rails aren't really options.
 
 ^^ Really?  Nobody's going to take the bait with this one?
 
 I can't see why they would; parsing XML in ruby is simply not possible.
 
 ;-)
 
 -n
 


Re: [CODE4LIB] Anyone using node.js?

2012-05-08 Thread Ethan Gruber
I once had benchmarks comparing XML processing with Saxon/XSLT2 vs hpricot
and nokogiri, and Saxon is the most efficient XML processor there is.  I
don't have that data any more though, but that's why I'm not a proponent of
using PHP/Ruby for delivering and manipulating XML content.  Each platform
has its pros and cons.  I didn't mean to ruffle any feathers with that
statement.

On Tue, May 8, 2012 at 2:18 PM, Ross Singer rossfsin...@gmail.com wrote:

 On May 8, 2012, at 2:01 PM, Ethan Gruber wrote:

  For what it's worth, I have processed XML in PHP, Ruby, and Saxon/XSLT 2,

 So then explain why LAMP/Rails aren't really options.

 It's hard to see how anybody can recommend node.js (or any other stack)
 based on this statement because without knowing _why_ these are inadequate.
  My guess is that node's XML libraries are also libXML based, just like
 pretty much any other C-based language.

  but I feel like I'm missing some sort of inside joke here.
 
  Thanks for the info.  To clarify, I don't develop in java, but deploy
  well-established java-based apps in Tomcat, like Solr and eXist (and am
  looking into a java triplestore to run in Tomcat) and write scripts to
 make
  these web services interact in whichever language seems to be the most
  appropriate.  Node looks like it may be interesting to play around with,
  but I'm wary of having to learn something completely new, jettisoning
 every
  application and language I am experienced with, to put a new project into
  production in the next 4-8 weeks.

 Eh, if your window is 4-8 weeks, then I wouldn't be considering node for
 this project.  It does, however, sound like you could really use a new
 project manager, because the one you have sounds terrible.

 -Ross.

 
  Ethan
 
  On Tue, May 8, 2012 at 1:15 PM, Nate Vack njv...@wisc.edu wrote:
 
  On Tue, May 8, 2012 at 11:45 AM, Ross Singer rossfsin...@gmail.com
  wrote:
  On May 8, 2012, at 10:17 AM, Ethan Gruber wrote:
 
  in.  Our data is exclusively XML, so LAMP/Rails aren't really options.
 
  ^^ Really?  Nobody's going to take the bait with this one?
 
  I can't see why they would; parsing XML in ruby is simply not possible.
 
  ;-)
 
  -n
 



Re: [CODE4LIB] Anyone using node.js?

2012-05-08 Thread Ross Singer
On May 8, 2012, at 2:30 PM, Ethan Gruber wrote:

 I once had benchmarks comparing XML processing with Saxon/XSLT2 vs hpricot
 and nokogiri, and Saxon is the most efficient XML processor there is.  I
 don't have that data any more though, but that's why I'm not a proponent of
 using PHP/Ruby for delivering and manipulating XML content.  Each platform
 has its pros and cons.  I didn't mean to ruffle any feathers with that
 statement.

I don't think any feathers were ruffled, but it helps to understand what you're 
looking for.  Basically node is going to be in the same camp as PHP, Ruby, 
Python, Perl, etc. and rely on LibXML/LibXSLT (which means no XSLT2).

If Saxon is your primary tool, I think you're best off with something in the 
JVM (Java, JRuby, Groovy, etc.) or C#.

There's no reason, for example, you couldn't run Saxon with JRuby and Rails. 

But there's still that 4-8 week deadline.

-Ross.

 
 On Tue, May 8, 2012 at 2:18 PM, Ross Singer rossfsin...@gmail.com wrote:
 
 On May 8, 2012, at 2:01 PM, Ethan Gruber wrote:
 
 For what it's worth, I have processed XML in PHP, Ruby, and Saxon/XSLT 2,
 
 So then explain why LAMP/Rails aren't really options.
 
 It's hard to see how anybody can recommend node.js (or any other stack)
 based on this statement because without knowing _why_ these are inadequate.
 My guess is that node's XML libraries are also libXML based, just like
 pretty much any other C-based language.
 
 but I feel like I'm missing some sort of inside joke here.
 
 Thanks for the info.  To clarify, I don't develop in java, but deploy
 well-established java-based apps in Tomcat, like Solr and eXist (and am
 looking into a java triplestore to run in Tomcat) and write scripts to
 make
 these web services interact in whichever language seems to be the most
 appropriate.  Node looks like it may be interesting to play around with,
 but I'm wary of having to learn something completely new, jettisoning
 every
 application and language I am experienced with, to put a new project into
 production in the next 4-8 weeks.
 
 Eh, if your window is 4-8 weeks, then I wouldn't be considering node for
 this project.  It does, however, sound like you could really use a new
 project manager, because the one you have sounds terrible.
 
 -Ross.
 
 
 Ethan
 
 On Tue, May 8, 2012 at 1:15 PM, Nate Vack njv...@wisc.edu wrote:
 
 On Tue, May 8, 2012 at 11:45 AM, Ross Singer rossfsin...@gmail.com
 wrote:
 On May 8, 2012, at 10:17 AM, Ethan Gruber wrote:
 
 in.  Our data is exclusively XML, so LAMP/Rails aren't really options.
 
 ^^ Really?  Nobody's going to take the bait with this one?
 
 I can't see why they would; parsing XML in ruby is simply not possible.
 
 ;-)
 
 -n
 
 


Re: [CODE4LIB] Anyone using node.js?

2012-05-08 Thread Joe Hourcle
On May 8, 2012, at 2:18 PM, Ross Singer wrote:

 On May 8, 2012, at 2:01 PM, Ethan Gruber wrote:

[trimmed]

 Thanks for the info.  To clarify, I don't develop in java, but deploy
 well-established java-based apps in Tomcat, like Solr and eXist (and am
 looking into a java triplestore to run in Tomcat) and write scripts to make
 these web services interact in whichever language seems to be the most
 appropriate.  Node looks like it may be interesting to play around with,
 but I'm wary of having to learn something completely new, jettisoning every
 application and language I am experienced with, to put a new project into
 production in the next 4-8 weeks.
 
 Eh, if your window is 4-8 weeks, then I wouldn't be considering node for this 
 project.  It does, however, sound like you could really use a new project 
 manager, because the one you have sounds terrible.

But project managers don't 'add value' unless they actually do something.  If 
they just let you do things the way that you've done in the past, even if they 
worked, they could be replaced by any other project manager who knew enough not 
to micro-manage things.

And, if you actually managed to do the project on time, with them staying 
mostly hands-off, what does that tell people?  That they're not needed ... they 
need a project that's going to hell, so they can step in and 'fix' stuff.


-Joe

ps. and besides the obvious 'this is not the opinion of my employer, and may or 
may not be sarcasm' disclaimer, I've had a few instances where there was a 
non-quite-as-tight deadline and I had to learn something new ... but they 
footed the bill for sending me to a week of training

pps.  in all seriousness -- I know of someone who pulled crap like this, and 
then used it as a reason to fire the developer and replace them with one of the 
PM's friends who had the 'needed' skills ... then another instance where an 
outside consultant did a 'peer review' of our system 2 weeks before we were 
supposed to go live and then somehow got a contract to design  build a 
different system which took a year and cost the university $250k? $500k?, but 
he never delivered (hardware was shipped w/ empty drive arrays) ... so I might 
be a little more jaded than most in this scenario.  (but neither of those two 
anecdotes were at my current employeer)


Re: [CODE4LIB] Anyone using node.js?

2012-05-08 Thread Kevin Ford

 I was
 told by the project manager that Apache, Java, and Tomcat were showing
 signs of age.
-- Taking this statement at face value, and taking it to its logical end 
(that you'll have to migrate your application), I'm extremely doubtful 
that Apache, Java, and Tomcat are so near their ends of life that you 
must redo your app in less than 8 weeks time or risk technological 
obsolescence.  Far, far from it.  Showing signs of age is just saying 
their old (both Apache and Tomcat had support releases in April), not 
that they don't work or fit your precise needs.  In any event, if the 
timeline is real, then something's not right with the reason for 
changing everything over to something else or the person pushing this 
or  It's a little mind-boggling.


But, to make this a little more constructive, and assuming the 8 week 
deadline is real, I might consider something like MarkLogic given what 
you've outlined thus far [1].  That might allow you to preserve your 
XQuery/XSLT (providing that you have some since you are using eXist) and 
it gets you a replacement for Solr.  Being an XML database and 
application server, it is designed for XML documents.  Unfortunately, it 
is closed-source, but the company offers a free license option that 
might work for you.


If you are investigating something with PHP, Python, or Ruby, I would 
look at the Zorba XQuery processor [2], which has bindings for those 
three languages (and a few more) and, being a specific language for 
manipulating XML documents, should be more conducive to what you need to 
do with your files.  It's pure bonus if you can re-use your XQuery. 
There also appears to be some support for XSLT 1.0 [3].  I've not done 
anything with Zorba but install it on a dare.


Cordially,

Kevin

[1] http://community.marklogic.com/
[2] http://www.zorba-xquery.com/html/index
[3] http://www.zorba-xquery.com/html/modules/zorba/programming/xslt




On 05/08/2012 10:17 AM, Ethan Gruber wrote:

Thanks.  I have been working on a system that allows editing of RDF in web
forms, creating linked data connections in the background, publishing to
eXist and Solr for dissemination, and will eventually integrate operation
with an RDF triplestore/SPARQL, all with Tomcat apps.  I'm not sure it is
possible to create, manage, and deliver our content with node.js, but I was
told by the project manager that Apache, Java, and Tomcat were showing
signs of age.  I'm not so sure about this considering the prevalence of
Tomcat apps both in libraries and industry.  I happen to be very fond of
Solr, and it seems very risky to start over in node.js, especially since I
can't be certain the end product will succeed.  I prefer to err on the side
of stability.

If anyone has other thoughts about the future of Tomcat applications in the
library, or more broadly cultural heritage informatics, feel free to jump
in.  Our data is exclusively XML, so LAMP/Rails aren't really options.

Ethan

On Tue, May 8, 2012 at 10:03 AM, Nate Vacknjv...@wisc.edu  wrote:


On Mon, May 7, 2012 at 10:17 PM, Ethan Gruberewg4x...@gmail.com  wrote:


It was recently suggested to me that a project I am working on may adopt
node.js for its architecture (well, be completely re-written for

node.js).

I don't know anything about node.js, and have only heard of it in some
passing discussions on the list.  I'd like to know if anyone on code4lib
has experience developing in this platform, and what their thoughts are

on

it, positive or negative.


I've only played a little bit, but my take is: you'll have more parts
to build than with other systems. If you need persistent connections,
it's gonna be neat; if you don't, it's probably not worth the bother.

The Peepcode screencasts on Node:

https://peepcode.com/screencasts/node

are probably worth your time and money.

-n



Re: [CODE4LIB] Anyone using node.js?

2012-05-08 Thread Kevin Ford

 (and am
 looking into a java triplestore to run in Tomcat)
-- I don't know if the parenthetical was simply a statement or a 
solicitation - apologies if it was the former.


Take a look at Mulgara.  Drops right into Tomcat.

http://mulgara.org/

--Kevin



On 05/08/2012 02:01 PM, Ethan Gruber wrote:

For what it's worth, I have processed XML in PHP, Ruby, and Saxon/XSLT 2,
but I feel like I'm missing some sort of inside joke here.

Thanks for the info.  To clarify, I don't develop in java, but deploy
well-established java-based apps in Tomcat, like Solr and eXist (and am
looking into a java triplestore to run in Tomcat) and write scripts to make
these web services interact in whichever language seems to be the most
appropriate.  Node looks like it may be interesting to play around with,
but I'm wary of having to learn something completely new, jettisoning every
application and language I am experienced with, to put a new project into
production in the next 4-8 weeks.

Ethan

On Tue, May 8, 2012 at 1:15 PM, Nate Vacknjv...@wisc.edu  wrote:


On Tue, May 8, 2012 at 11:45 AM, Ross Singerrossfsin...@gmail.com
wrote:

On May 8, 2012, at 10:17 AM, Ethan Gruber wrote:


in.  Our data is exclusively XML, so LAMP/Rails aren't really options.


^^ Really?  Nobody's going to take the bait with this one?


I can't see why they would; parsing XML in ruby is simply not possible.

;-)

-n



Re: [CODE4LIB] Anyone using node.js?

2012-05-08 Thread Ethan Gruber
The 4-8 week deadline is more self-imposed than anything.  The plan is (or
was) to deploy the new version of this project by mid-late summer.  It is
already under way, with a working prototype, and I can probably mostly
finish it in 80-120 hours of solid work.  I want to deploy it as soon as we
can because other bigger, sexier projects depend on RDF delivered from this
project.  If it takes six months to completely rewrite this project for
node, or any non-java platform with which I have less experience, we've
thrown a monkey wrench into the development of our other projects.

As for triplestores:

Mulgara is on my list to check out, as is sesame.  Does mulgara support
SPARQL Update yet?  In theory, one should be able to post updates directly
from XForms into a triplestore which supports SPARQL Update.  Maybe this
warrants a separate thread.

On Tue, May 8, 2012 at 3:39 PM, Kevin Ford k...@3windmills.com wrote:

  (and am
  looking into a java triplestore to run in Tomcat)
 -- I don't know if the parenthetical was simply a statement or a
 solicitation - apologies if it was the former.

 Take a look at Mulgara.  Drops right into Tomcat.

 http://mulgara.org/

 --Kevin




 On 05/08/2012 02:01 PM, Ethan Gruber wrote:

 For what it's worth, I have processed XML in PHP, Ruby, and Saxon/XSLT 2,
 but I feel like I'm missing some sort of inside joke here.

 Thanks for the info.  To clarify, I don't develop in java, but deploy
 well-established java-based apps in Tomcat, like Solr and eXist (and am
 looking into a java triplestore to run in Tomcat) and write scripts to
 make
 these web services interact in whichever language seems to be the most
 appropriate.  Node looks like it may be interesting to play around with,
 but I'm wary of having to learn something completely new, jettisoning
 every
 application and language I am experienced with, to put a new project into
 production in the next 4-8 weeks.

 Ethan

 On Tue, May 8, 2012 at 1:15 PM, Nate Vacknjv...@wisc.edu  wrote:

  On Tue, May 8, 2012 at 11:45 AM, Ross Singerrossfsin...@gmail.com
 wrote:

 On May 8, 2012, at 10:17 AM, Ethan Gruber wrote:


 in.  Our data is exclusively XML, so LAMP/Rails aren't really options.


 ^^ Really?  Nobody's going to take the bait with this one?


 I can't see why they would; parsing XML in ruby is simply not possible.

 ;-)

 -n




Re: [CODE4LIB] Anyone using node.js?

2012-05-08 Thread Randy Fischer
On Mon, May 7, 2012 at 11:17 PM, Ethan Gruber ewg4x...@gmail.com wrote:



 It was recently suggested to me that a project I am working on may adopt
 node.js for its architecture (well, be completely re-written for node.js).
 I don't know anything about node.js, and have only heard of it in some
 passing discussions on the list.  I'd like to know if anyone on code4lib
 has experience developing in this platform, and what their thoughts are on
 it, positive or negative.



It's a very interesting project - I think of it as kind of non-preemptive
multitasking framework, very much like POE in the Perl world, but with a
more elegant way of managing the event queue.

Where it could shine is that it accepts streaming, non-blocking HTTP
requests.  So for large PUTs and POSTs, it could be a real win (most other
web-server arrangements are going to require completed uploads of the
request, followed by a hand-off to your framework of an opened file
descriptor to a temporary file).

My naive tests with it a year or so ago gave inconsistent results, though
(sometime the checksums of large PUTs were right, sometimes not).

And of course to scale up, do SSL, etc, you'll really need to put something
like Apache in front of it - then you lose the streaming capability.  (I'd
love to hear I'm wrong here).


-Randy Fischer


Re: [CODE4LIB] Anyone using node.js?

2012-05-08 Thread Ed Summers
I've been using NodeJS in a few side projects lately, and have come to
like it quite a bit for certain types of applications: specifically
applications that need to do a lot of I/O in memory constrained
environments. A recent one is Wikitweets [1] which provides a real
time view of tweets on Twitter that reference Wikipedia. Similarly
Wikistream [2] monitors ~30 Wikimedia IRC channels for information
about Wikipedia articles being edited and publishes them to the Web.

For both these apps the socket.io library for NodeJS provided a really
nice abstraction for streaming data from the server to the client
using a variety of mechanisms: web sockets, flash socket, long
polling, JSONP polling, etc. NodeJS' event driven programming model
made it easy to listen to the Twitter stream, or the ~30 IRC channels,
while simultaneously holding open socket connections to browsers to
push updates to--all from within one process. Doing this sort of thing
in a more typical web application stack like Apache or Tomcat can get
very expensive where each client connection is a new thread or
process--which can lead to lots of memory being used.

If you've done any JavaScript programming in the browser, it will seem
familiar, because of the extensive use of callbacks. This can take
some getting used to, but it can be a real win in some cases,
especially in applications that are more I/O bound than CPU bound.
Ryan Dahl (the creator of NodeJS) gave a presentation [4] to a PHP
group last year which does a really nice job of describing how NodeJS
is different, and why it might be useful for you. If you are new to
event driven programming I wouldn't underestimate how much time you
might spend feeling like you are turning our brain inside out.

In general I was really pleased with the library support in NodeJS,
and the amount of activity there is in the community. The ability to
run the same code in the client as in the browser might be of some
interest. Also, being able use libraries like jQuery or PhantomJS in
command line programs is pretty interesting for things like screen
scraping the tagsoup HTML that is so prevalent on the Web.

If you end up needing to do RDF and XML processing from within NodeJS
and you aren't finding good library support you might want to find
databases (Sesame, eXist, etc) that have good HTTP APIs and use
something like request [5] if there isn't already support for it. I
wrote up why NodeJS was fun to use for Wikistream on my blog if you
are interested [6].

I recommend you try doing something small to get your feet wet with
NodeJS first before diving in with the rewrite. Good luck!

//Ed

[1] http://wikitweets.herokuapp.com
[2] http://wikistream.inkdroid.org
[3] http://inkdroid.org/journal/2011/11/07/an-ode-to-node/
[4] http://www.youtube.com/watch?v=jo_B4LTHi3I
[5] https://github.com/mikeal/request
[6] http://inkdroid.org/journal/2011/11/07/an-ode-to-node/

On Tue, May 8, 2012 at 5:24 PM, Randy Fischer randy.fisc...@gmail.com wrote:
 On Mon, May 7, 2012 at 11:17 PM, Ethan Gruber ewg4x...@gmail.com wrote:



 It was recently suggested to me that a project I am working on may adopt
 node.js for its architecture (well, be completely re-written for node.js).
 I don't know anything about node.js, and have only heard of it in some
 passing discussions on the list.  I'd like to know if anyone on code4lib
 has experience developing in this platform, and what their thoughts are on
 it, positive or negative.



 It's a very interesting project - I think of it as kind of non-preemptive
 multitasking framework, very much like POE in the Perl world, but with a
 more elegant way of managing the event queue.

 Where it could shine is that it accepts streaming, non-blocking HTTP
 requests.  So for large PUTs and POSTs, it could be a real win (most other
 web-server arrangements are going to require completed uploads of the
 request, followed by a hand-off to your framework of an opened file
 descriptor to a temporary file).

 My naive tests with it a year or so ago gave inconsistent results, though
 (sometime the checksums of large PUTs were right, sometimes not).

 And of course to scale up, do SSL, etc, you'll really need to put something
 like Apache in front of it - then you lose the streaming capability.  (I'd
 love to hear I'm wrong here).


 -Randy Fischer