Better HN
topnewbestaskshowjobs
Log inSign up

elia

9 karma · joined Oct 21, 2012 (14y ago) · 10 submissions

@elia on twitter and github

[ my public key: https://keybase.io/elia; my proof: https://keybase.io/elia/sigs/W-zymkeIMYaXIJfs4vV20Dcgaql6sRn4NSN4KwPHMAk ]

Submissions

1.

Opal 0.7.0: require, kwargs, docs, testing, lots of fixes(opalrb.org ↗)

6 points · by elia · 11y ago · discuss

2.

Why JSON sucks for configuration files(dev.mikamai.com ↗)

4 points · by elia · 12y ago · 1 comment

3.

3 Simple examples from Ruby to Elixir(dev.mikamai.com ↗)

5 points · by elia · 12y ago · discuss

4.

Ruby: Shoes considering atom-shell + Opal as backend(github.com ↗)

2 points · by elia · 12y ago · 1 comment

comment 12y ago · link · parent

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.

6.

The #nosyntax movement(dev.mikamai.com ↗)

3 points · by elia · 12y ago · 2 comments

comment 12y ago · link · parent

> 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.

comment 12y ago · link · parent

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...

9.

Preview emails for any user with Rails 4.1(dev.mikamai.com ↗)

3 points · by elia · 12y ago · discuss

comment 12y ago · link · parent

worth it