On Sat, Jul 21, 2007 at 02:18:55PM +0900, Patrick Erinn wrote:
I want to write a basic simulation (predator/prey) that has a simple GUI
that I can display using a website, using Ruby for the number crunching,
JS for the application GUI and HTML to handle whatever else on the page
(or something…I hear of terms like XHTML, XML and AJAX thrown around,
but I don’t have a firm grasp on them)
HTML reached version 4. Now there’s XHTML, and it looks like HTML
is going the way of the dinosaurs (thank goodness). You can effectively
think of XHTML as HTML 5. It is, in practice, just a better HTML, and
most of XHTML is strictly compatible with HTML. The most glaring
difference for the simplest use cases is that in XHTML you must close
tags. Another key difference is that with XHTML it is expected that
presentation details (such as font color, background color, typeface,
margin sizes, and so on) will be handled entirely by CSS rather than by
XML is a superset of XHTML. You probably won’t need it for what you’re
talking about doing.
really mostly XHTML rather than XML proper. When someone’s using AJAX,
between server and client to alter the content of the page and shuttle
data to and from the server without having to reload the whole page
time something changes. This is the sort of thing that allows, for
instance, Google Maps to be dragged around inside the page to view
different parts of the map.
I’m just coding in Windows, but would like the simulation to be visible
to any member of the public who visits the website that contains it
(with no user interaction at first, just a display to everyone watching
what’s happening). Is it feasible for this project to use all three
without needing to convert Ruby to JS, or would the project really just
You can run Ruby on the server to handle all data on that end.
can make the interface more “dynamic”.
I’m not entirely clear on what exactly you want to accomplish, but I
XHTML+CSS in the browser to provide the interface for the user. In
assuming you’re using Ruby on the server, I imagine you’d be using Ruby
to generate at least parts of a page to be sent to the user, including
object) to communicate with server’s Ruby scripts.
If you’re talking about something akin to Conway’s Game of Life, but
a predator/prey simulation as your model instead, you’ll have to make
some hard decisions about how much should be handled in the browser and
how much on the server.