Live data from Hacker News

RubyJS: A JavaScript standard library based on the Ruby core-lib

rubyjs.org

21–30 of 38 posts

Re: RubyJS: A JavaScript standard library based on the Ruby core-lib

#22

Is Underscore.js not good enough for you guys? Really?

underscorejs didn't provide me String methods, Time (with timezones), some number methods, and a few iterator methods i was used to from ruby land. Also i missed the chainability across types and iterators.

Re: RubyJS: A JavaScript standard library based on the Ruby core-lib

#23
post #3

I'm not a rubyist, and I can see how this can be nice for ruby developers, but IMHO, if you need javascript - use javascript. Why add another layer of complexity and error proneness? What happens when a different js programmer needs to review your code? Or when you need to write some Node.js code and forgot all about syntax? "The main motive is to have a decent standard library for JavaScript" - jQuery works just fin…

Prototype, Underscore, jQuery, Coffescript, .... RubyJS - nobody love pure JS, when you've got a chance to write nice code(short and descriptive) - why don't use this ability? And about "different js programmer needs to review your code" - if you don't know smth then you need to study it. That's a fundament of programming world(probably not only programming))

Re: RubyJS: A JavaScript standard library based on the Ruby core-lib

#25

If you're after a standard library for Javascript, you could do worse than including es5-shim. Which has the advantage of being a library that (partially) implements a standard: Ecmascript 5. > es5-shim.js and es5-shim.min.js monkey-patch a > JavaScript context to contain all EcmaScript 5 > methods that can be faithfully emulated with a > legacy JavaScript engine. It provides Array::map, Array::filter, Array::reduce…

Sure. You could do worse than RubyJS as well. This project is implementing the standard set by the reference implementation of Ruby and its standard library. And having used Ruby a bit, I’ve come to find its standard library quite good, as dynamic languages go. So it doesn’t much matter that ES5 features are “more native”—here and now, it’s still a matter of preference.

I don't really see why RubyJS would be better than PHP.js.

And I'm definitely not saying that PHP.js should be used.

[edit] To be more specific, I really don't see the point of using a third-party library when the native methods are available. IMHO, if you choose a language, you should stick with it.

Re: RubyJS: A JavaScript standard library based on the Ruby core-lib

#26
post #3

I'm not a rubyist, and I can see how this can be nice for ruby developers, but IMHO, if you need javascript - use javascript. Why add another layer of complexity and error proneness? What happens when a different js programmer needs to review your code? Or when you need to write some Node.js code and forgot all about syntax? "The main motive is to have a decent standard library for JavaScript" - jQuery works just fin…

Prototype, Underscore, jQuery, Coffescript, .... RubyJS - nobody love pure JS, when you've got a chance to write nice code(short and descriptive) - why don't use this ability? And about "different js programmer needs to review your code" - if you don't know smth then you need to study it. That's a fundament of programming world(probably not only programming))

Untrue. The ES5 standard contains most of the features required for any application (my main issue being the Date prototype which could easily be improved).

jQuery, Prototype and afaik Underscore helper functions have been wrote when the standard wasn't ready. Now that it is, developers should start using them.

Re: RubyJS: A JavaScript standard library based on the Ruby core-lib

#28

Is Underscore.js not good enough for you guys? Really?

I'm not a fan of RubyJS, but I dislike underscore for the same reason: it encourages people to use implementation specific versions fo existing ES5 standard methods [1].

I use ES5 shim instead. That way when I ditch support for IE8, I don't have to fix anything.

[1] Obviously Underscore doesn't have methods, it has utility functions attached to punctuation.

Re: RubyJS: A JavaScript standard library based on the Ruby core-lib

#29
post #9
post #2

How are callbacks handled in this library? I prefer js anonymous functions to Procs & lambdas in Ruby.

I do as we'll. After working in node for a bit I have come to appreciate how nice the call backs work, but I hate the fact I have to use them every where. Plus ruby has a few ways to implement callbacks which can be confusing.

Yes, as someone who really likes Ruby, this is probably my least favourite thing about it — the messy profusion of subtly-different functiony things (Procs, blocks, methods, ...).

Re: RubyJS: A JavaScript standard library based on the Ruby core-lib

#30
post #25

Earlier quoted context omitted.

Sure. You could do worse than RubyJS as well. This project is implementing the standard set by the reference implementation of Ruby and its standard library. And having used Ruby a bit, I’ve come to find its standard library quite good, as dynamic languages go. So it doesn’t much matter that ES5 features are “more native”—here and now, it’s still a matter of preference.

I don't really see why RubyJS would be better than PHP.js. And I'm definitely not saying that PHP.js should be used. [edit] To be more specific, I really don't see the point of using a third-party library when the native methods are available. IMHO, if you choose a language, you should stick with it.

RubyJS creator here. I was just missing so many (native) methods in javascript. i liked the standard library of javascript and there is an extensive public ruby testsuite that i could use to test my implementation against. Plus i liked the idea of taking something that already works elsewhere and translate it JS, instead of coming up with my own API. IMO it's the same as using underscore/lodash, stringjs, etc, just all in the same library with the same coding standards and interoperability between classes.
Post reply on HN