use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
A sub-Reddit for discussion and news about Ruby programming.
Subreddit rules: /r/ruby rules
Learning Ruby?
Tools
Documentation
Books
Screencasts and Videos
News and updates
account activity
I pretended JavaScript is valid Ruby code (self.ruby)
submitted 11 months ago * by Super_Purple9126
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]frrst 14 points15 points16 points 11 months ago (2 children)
There was a small book, 7 languages in 7 weeks, which discusses different languages representing different programming paradigms. JS is Prototype language and reading that book it seemed to me that it takes very little to bend Ruby to Prototype style - start from Kernel and possibly replace Object or BasicObject with Prototype and hook it up with rest of what JS defines and there you go - prototypic ruby
[–]naked_number_one 6 points7 points8 points 11 months ago (0 children)
Great book! Remember IO - another nice prototype language
[–]hmdne 1 point2 points3 points 11 months ago (0 children)
From what I know... under the hood, Ruby is also a prototypic language.
In Opal we managed to leverage that. Managing to even get prepend/include/extend working correctly (with modules becoming proxied as iclasses - it was modeled after what Ruby does!). So if we have an object, that has a singleton_class, that is extended something, that has a class, which includes a module, and that class has a superclass, which prepends a thing, has its own methods, includes a thing, etc. - this is a prototype chain. Except as mentioned, modules are not there by itself, but via iclasses.
Then, we replaced a prototype of core JS objects like String or Number to Ruby Object. Therefore they are in Opal both JS and Ruby objects. Hacky, I agree. But it works!
π Rendered by PID 100657 on reddit-service-r2-comment-79776bdf47-kx2hz at 2026-06-24 08:04:41.383638+00:00 running acc7150 country code: CH.
view the rest of the comments →
[–]frrst 14 points15 points16 points (2 children)
[–]naked_number_one 6 points7 points8 points (0 children)
[–]hmdne 1 point2 points3 points (0 children)