News for hackers. Stuff that matters.

elia

Re:The #nosyntax movement on Wednesday June 18, 2014 @04:44AM (#7909075)
The connection is that while coding you get the contents through a visual representation, it's the same connection between any content and the medium through which comes to you.
Re:Opal: Ruby to JavaScript Compiler on Monday June 09, 2014 @10:13AM (#7868531)
> If you've got a way to compile Ruby to JS that has tolerable arithmetic perf and doesn't do type analysis or generate a huge volume of code, I would definitely like to know more about it.

Yeah, that's kinda the point, you can do that and preserve Ruby semantics?

Let me note here that is a strawman indeed, Dart has frozen classes, Ruby is a bit different. In order to do something like that you should inline a ton of ternary operator to check if the method has been redefined on that particular object.

Something like:

    (a._isNumber && !a._plusRedefined) ? a + 1 : a['$+'](1)
plus listening on new method definitions to set `_plusRedefined`.

It's definitively a trade off, readability will suffer.

Opal had optimized operators in the past (that assumed native operations on numbers), they could even be back in the near future. But what I see here is a comparison of two different language semantics. I agree that “compiling to JS is hard”, but I don't think that this demonstrates anything. What can be argued instead is that JS VMs could and should do that for us.

Re:Opal: Ruby to JavaScript Compiler on Monday June 09, 2014 @09:33AM (#7868338)
I had the same fear at first, but actually if you generate dynamically a method name you need to use `#__send__` (and friends) to call it.

Of course `#__send__` supports method_missing: https://github.com/opal/opal/blob/0-6-stable/opal/corelib/ba...

Re:Start a Rails 4 full-featured application with uWSGI on Wednesday December 11, 2013 @06:02AM (#6886976)
worth it