From: Chad Perrin Date: 2011-07-21T23:19:29+09:00 Subject: Re: Ruby in JavaScript, all projects are dead? --WYTEVAkct0FjGQmd Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jul 21, 2011 at 01:57:31PM +0900, David Masover wrote: > On Tuesday, July 19, 2011 05:41:47 PM Alexey Petrushin wrote: > > UPD, this one seems to be interesting and is very active. And (a big > > plus), it generates human readable js. > >=20 > > https://github.com/adambeynon/opal >=20 > I remember starting a project like this. I more or less gave up when I=20 > realized there didn't seem to be a good way to have it continue to genera= te=20 > human-readable JS, and also support continuations. >=20 > This seems to suffer from the same limitation. Notice there's no enumerat= ors.=20 > In MRI, I can do stuff like this: >=20 > ruby-1.9.2-p180 :010 > (1..10).each_cons(2).to_a > =3D> [[1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [6, 7], [7, 8], [8, 9], [9= , 10]]=20 >=20 > Opal doesn't do that -- all of the enumerable methods (each and friends)= =20 > simply die if I don't pass a block. >=20 > I guess if that ends up being the only edge case, and people are OK with = this,=20 > it makes sense. But it seems like the more weird corner cases like this, = the=20 > less benefit there is to trying to pretend it's a full-fledged Ruby. Even= if=20 > your gems don't hit any of the corner cases imposed by the interpreter it= self,=20 > you're still running in a restricted environment that may pose its own=20 > problems... It would be nice to have a full-fledged Ruby that compiles to human-readable JavaScript, but if it falls short of that level of completeness, that does not necessarily make it unworthy of developing and supporting (and, most importantly, of using). >=20 > Maybe it would be better to create a language specifically designed to wo= rk=20 > well in that environment -- to build on the good ideas from JavaScript, g= ive=20 > us Ruby-esque syntactic sugar, but to stick close enough that the resulti= ng=20 > JavaScript makes sense and is debuggable... and I just described CoffeeSc= ript. >=20 > So, it looks really, really cool, but I think I'm still going to use=20 > CoffeeScript if I use anything beyond pure JS. That might make sense. What I'd *really* like, though, is a fixed JavaScript. --=20 Chad Perrin [ original content licensed OWL: http://owl.apotheon.org ] --WYTEVAkct0FjGQmd Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAk4oMYUACgkQ9mn/Pj01uKXwxQCfVe1aWY+lPrkprUrAR9Vc6Xu3 TSYAnjoTW0kKLPQ/JnvC+XD60knNWX8n =zBkd -----END PGP SIGNATURE----- --WYTEVAkct0FjGQmd--