[LRUG] opal-rails

Steven Deobald steven at c42.in
Sat May 4 03:34:38 PDT 2013


Hi Riccardo,

I haven't used Opal in anger but I would caution you against the holy grail
of shared client/server code. I have written a reasonable amount of
Clojure/ClojureScript, which in theory makes this possible, but it's really
never come up as an attractive solution to any problem I've had. The sort
of code I've shared between the client and server in the past tends to be
small data-formatting functions, aggregations, and transformations -- all
of which are functional.

I've never used Meteor, so a grain of salt is required, but I'm not sure I
understand the appeal of accessing the database or other services directly
from your views.

On a weirdly related note, if you want to combine ClojureScript and Rails
instead, there exist a couple projects for getting ClojureScript into the
Rails asset pipeline:

https://github.com/yokolet/clementine
https://github.com/nicholasbs/clojurescript-rails

My reasons for choosing ClojureScript over CoffeeScript in the past are
simply due to the power and functional nature of the language. Obviously
there's still a mental gap between server and client code.


Steven Deobald
C42 -- www.c42.in -- www.rubymonk.com


On 3 May 2013 16:24, Riccardo Tacconi <rtacconi at gmail.com> wrote:

> Hi guys,
>
> Have you every thought to use Ruby in your Rails project instead of
> CoffeeScript to write your Javascript? I just found opal-rails which allows
> to develop Javascript with Ruby:
>
> https://github.com/opal/opal-rails
>
> I am not sure about the maturity of the project but this could allow us to
> extend Rails to work, if needed, as the Meteor Framework:
>
> client? do
>   # use jquery
>   # use angular.js
> end
>
> server? do
>   # back end stuff
> end
>
> What do you think?
>
> I see that is also possible to use Ruby on node.js:
> https://github.com/opal/opal-node#readme.
>
> Cheers,
>
> --
> Riccardo Tacconi
> Ruby on Rails and PHP development - System Administration
> VIRTUELOGIC LIMITED <http://www.virtuelogic.net/>
>
> http://github.com/rtacconi
> http://riccardotacconi.blogspot.com
> http://twitter.com/rtacconi
>
> _______________________________________________
> Chat mailing list
> Chat at lists.lrug.org
> http://lists.lrug.org/listinfo.cgi/chat-lrug.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lrug.org/pipermail/chat-lrug.org/attachments/20130504/32853c83/attachment.html>


More information about the Chat mailing list