David Masover wrote in post #975080:
> On Friday, January 14, 2011 07:34:04 am Jonas Pfenniger (zimbatm) wrote:
>
> A final point: Browsers are getting fast enough that we should be able
> to do
> Ruby in Javascript. And not a server-side implementation, either -- I
> want the
> equivalent of JRuby. But this isn't really a limitation of Ruby, it's a
> limitation of browsers that we'd be working around. The above rants are
> things
> I actually feel are broken about Ruby as it is today.

I'm sorry to take this slightly off topic, but I just can't let this 
comment pass. I am currently building a language called Quby, which is a 
very Ruby-like language, that runs 100% in the browser (about 4,000 
lines of JS). There are differences (as it's Ruby-like not Ruby) with 
the main one being that it's tied to a canvas. But AFAIK it's the 
closest pure JS implementation of Ruby (although it's Quby, not Ruby).

It's still incomplete (no modules, classes but no inheritance and no 
line numbers reported for runtime errors) but you can already build 
things with it. Some examples are here: http://playmycode.com/play and 
you can play about with it here: http://playmycode.com/build/sandbox 
(feel free to signup and build something).


Back on topic, my number one gripe with Ruby has always been 'unexpected 
$end, expecting keyword_end' parse error. It's given when you load a 
file but you've missed out an 'end' keyword somewhere in your script. 
The parser has reached the end of the file and still expects to see one. 
The main issue is that you could be missing an 'end' anywhere in your 
script, yet it reports the error on the very last line (which is just 
useless).

The workaround is to usually cut out large chunks of my code and re-run 
until it parses, as this will tell me which chunk I am missing the end. 
Even if your file is only 500 lines long this is very tedious work for 
something that all other languages are typically good at.

I can understand why this might be very difficult (or impossible) for 
Ruby to catch, but that doesn't detract from it being very annoying. One 
thing that could be done would be to just try to predict where the end 
might be missing. This could be achieved if it looked at the tabbing of 
the lines.

-- 
Posted via http://www.ruby-forum.com/.