tags:

views:

206

answers:

6

i want to create not only a web application, but a web application where everything is LIVE.

eg. if someone posts a message and then another one replies, then the creator will get on his webpage a notification.

and also i want to implement a chat in the web application.

i want these features to be implemented using true server-push (no javascript polling)!

because i only want to create web applications i don't think i will use java.

i wonder if i should use python, ruby or php for this?

thanks

+1  A: 

A question with a rather wide scope. Facebook Chat for example is an Erlang application.

The MYYN
+1  A: 

If you want it to be a web app, then you can forget about true server push. Comet is the closest you can come.

The server side language is pretty much irrelevant. Use whatever you are comfortable with.

For the client side, you have little choice but JavaScript (unless you want to use plug-ins)

David Dorward
but i have heard that php is not the language to choose for comet. a lot of users are recommending ruby or python. i want to know why.
never_had_a_name
+3  A: 

The following are your options:

  1. Using node.js
  2. Using webSocket
  3. Using XMPP in combination with Strophe.js. This requires a separate XMPP server like ejabberd or OpenFire.

Reference:

http://nodejs.org/

http://en.wikipedia.org/wiki/Web_Sockets

http://code.stanziq.com/strophe/

Khnle
+6  A: 

In Python you probably want Tornado as it was written for this use case. Twisted is also used for this sort of thing (they were doing server push before anyone), but I think Tornado will be easier to work with.

You could only really use PHP with this if you planned to set up a separate server to handle the long-lived connections needed for server-push, PHP itself can't handle that well (it's tied into Apache's process/worker/request system).

I'm sure something similar exists for Ruby (not sure what it is though), and you could use Node.js for server-side Javascript.

Ian Bicking
+2  A: 

I would recommend looking at Scala/Lift.

Scala is a statically-typed language for the Java VM.

Lift is a web framework written in Scala, which has extensive Comet support (this is what you basically asked "true server-push").

Lift can run in any Java Servlet container and together with Jetty's continuations it supports pushing updates to thousands of clients.

Just search for Scala/Lift and Chat on Google, implementing a simple chat application is basically some sort of "Hello World" in the Scala community and can be done in a few hundred lines of code.

soc
+1 for Lift. It was *specifically* designed for exactly these kinds of applications.
Jörg W Mittag
+2  A: 

you can use any language you want - just optimize it. prototype with php or whatever you like best.

either way - look into this: http://www.ape-project.org/

i think thats exactly what you want.

Tobias
but i dont get how i save information a user type in into the database and then push the changes to all the web browsers with ape. how can the ape server communicate with my mysql database?
never_had_a_name
through a gateway... like a php script, or python or c... or the plugin itself
Tobias
where do they describe how to integrate php with it? cause i have to do some business logic and save the text that is sent from the web browser to the ape server.
never_had_a_name
its a bit more complicated... i guess you have to try it out and lern it... :/ - also look into what Khnle wrote: strophe.js
Tobias