8 ms·
Something like this is nice, and might appeal to people that want a simple, reasonably 1:1 compilation comparison between the language and the underlying JS imp
by jaredcwhite 13y ago
Something like this is nice, and might appeal to people that want a simple, reasonably 1:1 compilation comparison between the language and the underlying JS implementation.
However, I personally am FAR more excited about something like http://opalrb.org http://opalrb.org which essentially provides a Ruby runtime in JS and lets you run complex code with real Ruby syntax and runtime library features.
I have been extensively testing Opal with just about everything I can throw at it and am constantly blown away by just how much it feels like I'm really running Ruby code client-side. Incredibly powerful stuff that would be a PITA to write in Javascript is a breeze with Opal. Browser compatibility doesn't seem to be an issue (IE 8, older Android, etc. all working).
Sorry, I know I sound like a fanboy now, and I swear I have no connection to the Opal devs (didn't even know about the project until last week), but since I've really really wanted for some time now to skip the "CoffeeScript" phase altogether and wait until I can write genuine Ruby front-end code that compiles to JS, I am super excited.
Good luck to RedScript though, that's also an interested project and, again, might appeal to people (not me) who want something extremely lightweight.
- dclowd9901 13y agoWhy not? Ruby-nuts have been trying to reshape JS into Ruby for years now. Might as well just go full balls on it.
- adamkittelson 13y agoOddly enough that was done years ago via Silverlight of all things. http://www.rubyinside.com/ironruby-silverlight-ruby-in-browser-3192.html http://www.rubyinside.com/ironruby-silverlight-ruby-in-brows...
- kibibu 13y agoApologies if you just used a neologism, but I believe the phrase is "full bore".
- prophetjohn 13y ago"Full balls" is pretty colloquial, but I imagine it was intentional. It makes sense to me. Kind of like "balls out" or "balls to the wall." Or even "balls deep." Y'know?
- dclowd9901 13y agoDefinitely intentional. I like to color up language or throw a curveball in a well-understood idiom. Nobody does that anymore, and they used to do it all the time. Now we just reuse the same tired idioms over and over again. Blah.
- atmosx 13y agoDo you think by using Opal or RedScript is possible to avoid learning JavaScript? Because CoffeeScript is all well and good but I really don't see how it is useful, except from maybe speeding up your development a little, since you need to know JavaScript in order to use it properly.
- jes5199 13y agoCoffeeScript doesn't have to eliminate JavaScript to be useful. Just having a better notation for passing anonymous functions as parameters makes such a huge difference on code clarity that I think it's worthwhile.
- smrtinsert 13y agoIt's amazing how many people on the web aren't interested in making their lives easier.
- halfninety 13y agoTry using promises, and a small utility function to convert library functions that take callbacks to ones that return a promise.
- stdbrouw 13y ago> Because CoffeeScript is all well and good but I really don't see how it is useful, except from maybe speeding up your development a little You have a weird concept of "useful" if "speeding up your development" isn't a part of it :-)
- dustingetz 13y agothe quote is "maybe speeding up your development a little"
- dragonwriter 13y ago> Do you think by using Opal or RedScript is possible to avoid learning JavaScript? RedScript essentially supports JS syntax plus Ruby-like syntax, and allows them to be freely mixed, so you probably need to learn JS for RedScript, especially if you ever have to read code that comes from someone else. Opal is Ruby, but allows inlining JS (using the mechanism regular Ruby uses for inline shell commands, essentially, the JS interpreter is the "system shell") which I suspect is going to be fairly heavily used in Opal projects until there are more Ruby wrappers around JS functions (e.g., DOM-related ones) necessary for even the most basic web work. So, you probably need to know JS to make effective use of Opal for now, though that may not be true forever.
- mistercow 13y agoDoes Opal generate source maps? That's a pretty big deal as the source generation gets further away from 1:1.
- rubyn00bie 13y agoIt indeed does. While not always perfect, are pretty useful. I account their lack of usefulness to deficits in how JS handles errors rather than the source map itself.
- denysonique 13y agoDoes Opal support Native to an extent to allow me to use it with existing libraries such as Backbone without the need of writing extensive wrappers? Opal is an awesome project, but the last time when I looked at it using JS libraries with it wasn't trivial.
- denysonique 13y agoKernel::Native
- nnq 13y ago> Incredibly powerful stuff that would be a PITA to write in Javascript ...care to elaborate on that? Javascript is a pretty versatile and expressive language imho and if you stay away from its dark corners and "anti-features" it's just as good as any other dynamic language (except languages with real metaprogramming facilities like lisps, but this is no the point), so I'd really like an example of a kind of problem/solution/pattern that is easy to express in Ruby code and hard in Javascript code.