Live data from Hacker News

Opal: Ruby in Your Browser – the Basics

sitepoint.com

1–10 of 47 posts

Re: Opal: Ruby in Your Browser – the Basics

#2
I'm not terribly convinced by these things that compile to javascript. I don't much care for javascript, but I'd rather take the bull by the horns than deal with a bunch of generated code, especially in any kind of commercial setting where it's going to be a lot easier to hire JS people rather than people who are both X-lang and JS experts.

That said, it's very much a cool hack, and worth doing on that basis alone.

Re: Opal: Ruby in Your Browser – the Basics

#4
post #2

I'm not terribly convinced by these things that compile to javascript. I don't much care for javascript, but I'd rather take the bull by the horns than deal with a bunch of generated code, especially in any kind of commercial setting where it's going to be a lot easier to hire JS people rather than people who are both X-lang and JS experts. That said, it's very much a cool hack, and worth doing on that basis alone.

I'm inclined to agree. I'm not one of those Javascript bashers. It's a handy enough language and tweaking/hacking/breaking JS enabled webpages is the way a lot of us amateur coders dip a toe in the water.

Unfortunately I think JS is having a lot of responsibility heaped on its slightly creaky shoulders these days, due to the growth in mobile intarwebsing and every man and his dog looking for a quick way to build the app that is going to bring them fame and fortune. As a result of this, we're seeing a lot of these frameworks which compile [arguably!] 'better' fuller-featured languages down into JS.

Personally I'd rather a scenario where people could code in and embed this in HTML as easily and ubiquitously as JS can be embedded. A bit of a pipe-dream I know, but wouldn't it be great if we could exploit the cross-platform accessibility of web apps, without having to turn everyone into a Javascript hacker?

Re: Opal: Ruby in Your Browser – the Basics

#5

One big problem with this is that you still end up having to use raw JS anyway. Debugging is usually a big hassle too.

He may add source maps and debugging will not be cumbersome. Handling Coffeescript is not difficult if you can jump and add breakpoints in your browser over the original code.

Re: Opal: Ruby in Your Browser – the Basics

#6
If one needs to write code like:

    `#{context}.lineTo(#{x}, #{height})`
...you're doing it wrong. Please do figure out a way to "automagically" make things work without `...` or just don't bother.

`...` should be a last resort option for when you just need to do something that can't be done any other way, not something that should be peppered over the entire code.

Re: Opal: Ruby in Your Browser – the Basics

#8
post #5

One big problem with this is that you still end up having to use raw JS anyway. Debugging is usually a big hassle too.

He may add source maps and debugging will not be cumbersome. Handling Coffeescript is not difficult if you can jump and add breakpoints in your browser over the original code.

in Coffeescript you don't have to `...` jump to raw javascript every couple lines

Re: Opal: Ruby in Your Browser – the Basics

#9
post #6

If one needs to write code like: `#{context}.lineTo(#{x}, #{height})` ...you're doing it wrong. Please do figure out a way to "automagically" make things work without `...` or just don't bother. `...` should be a last resort option for when you just need to do something that can't be done any other way, not something that should be peppered over the entire code.

Could you explain what is so offensive about using `...` here?
Post reply on HN