These are chat archives for opal/opal

29th
Apr 2015
Penn Su
@pencilcheck
Apr 29 2015 00:11
@ryanstout what do you mean? the compiled code? or the data?
or marshaling?
Ryan Stout
@ryanstout
Apr 29 2015 00:32
@elia the data.
Mostly I'm wishing json had a date type.
Forrest Chang
@fkchang
Apr 29 2015 02:34
@jaredcwhite ok, so I have about 2.5 hours. On it
@jaredcwhite the symptoms in that opal issue look very similar to what i remember seeing. I'm wondering if we need to do additional requiring in 0.8 vs 0.7
Vais Salikhov
@vais
Apr 29 2015 03:08
@AstonJ, this is my "two cents" only, please take with a grain of salt: Mongo is the elephant in the room. Nevermind its recent fall from grace, the meteoric rise and fall among the hipsters. The real issue is the disconnect between the general appeal and applicability of Volt on the one hand, and the narrow scope of Mongo on the other. Volt's association with Mongo will serve to hinder PR efforts attempted prior to the release of the data provider api. That is, if you want to talk about Volt and Rails in the same sentence, the Mongo-only issue has to be addressed.
Ryan Stout
@ryanstout
Apr 29 2015 03:10
@vais We're adding support for other databases, postgres support should be out shortly.
Jared White
@jaredcwhite
Apr 29 2015 03:16
@vais @ryanstout That's the only significant reason why I've been hesitant to dive deep into Volt. Knowing that postgres support is coming soon, I'm very excited to check that out!
Ryan Stout
@ryanstout
Apr 29 2015 03:17
I wish I had gotten the memo that everyone hated mongo before I started :-) Though that was two years ago, so everyone didn't then :-)
also, mongo was easier for me to implement due to a few reasons.
Jared White
@jaredcwhite
Apr 29 2015 03:56
Heh...3 years ago I built a Rails app using CouchDB. Found out that was even dumber than going with Mongo...ended up porting to postgres. Live and learn!
ylluminate
@ylluminate
Apr 29 2015 04:02
get excited @gabrielrios - note the very soon support of pgsql!
we used couch back about 5 years ago on a project @jaredcwhite. went surprisingly well. i still miss it sometimes, but pgsql just offers too much utility
Vais Salikhov
@vais
Apr 29 2015 05:02
@ryanstout two years ago everyone was loving mongo :) But seriously, this is not about loving or hating Mongo - I summarized my thoughts on this here in response to the 0.9.0 announcement. I really am excited about the promise of data provider API, and I know I'm not alone in this. I like to think that you tied Volt to Mongo on purpose, so that you get to build it out in relative calm, then drop Mongo and really take Volt public :) Cause there's no freaking chance in hell that a mongo-specific ruby framework is going to take the world by storm in 2015. But a storage-agnostic real-time isomorphic ruby framework that puts Rails to shame in terms of developer productivity just might ;)
Ryan Stout
@ryanstout
Apr 29 2015 05:03
@vais yea, I did mongo because it was fast to get up and running with.
(since Volt needs to parse queries and its easy to parse mongo queries)
@vais anyway, come chat in the volt gitter sometime if you want to chat more
Jared White
@jaredcwhite
Apr 29 2015 05:36
@fkchang got it, thanks!!!
Ryan Stout
@ryanstout
Apr 29 2015 05:42
does require_tree only work as a sprockets directive, or does it work directly in opal?
Elia Schito
@elia
Apr 29 2015 06:23
@ryanstout which version of Opal ?
on master I can tell it's parsed by the compiler and available as #required_trees iirc
Elia Schito
@elia
Apr 29 2015 07:48
@adambeynon ping
Adam Beynon
@adambeynon
Apr 29 2015 07:50
@elia yo yo
Elia Schito
@elia
Apr 29 2015 07:52
@adambeynon sup, anything you wanna take into 0.8 from this list https://github.com/opal/opal/milestones/0.8?
Adam Beynon
@adambeynon
Apr 29 2015 07:53
@elia hmmmmmmm, I had one thought which might help debugging. At the moment, when looking at stack traces, any blocks show up as $TMP_1, $TMP_2 etc, which isn’t very helpful. I thought about changing the temp variables names into something more useful
e.g. $block_in_array_each
Elia Schito
@elia
Apr 29 2015 07:53
that would be great
or even $Array_each
Adam Beynon
@adambeynon
Apr 29 2015 07:55
elia, yeap. its an easy fix, and would make debugging WAY easier. From what I can see, it would work in both chrome and safari in terms of stack traces
haven’t tried firefox, but I imagine it is a similar thingy
Elia Schito
@elia
Apr 29 2015 07:59
@adambeynon you already have it working locally?
Elia Schito
@elia
Apr 29 2015 08:36
I thought this was just local: https://travis-ci.org/opal/opal/jobs/60498552
@adambeynon @vais you ever saw that ^^^?
Vais Salikhov
@vais
Apr 29 2015 08:56
@elia ow snap! Yes, I saw it while running specs on Chrome and on Chrome only. I suspect this has something to do with how the JS runtime is compiled, since on the same machine nodejs did not have a problem with it, and Chrome did, and both are V8. Well, actually, Chrome has a more recent V8 than node, so maybe its a newer version of node being used to run the specs on travis?
Vais Salikhov
@vais
Apr 29 2015 09:01
Anyhow, the fix would be to fiddle with the TOLERANCE constant here: https://github.com/opal/rubyspec/blob/master/spec_helper.rb#L44
Currently TOLERANCE = 0.00003 unless Object.const_defined?(:TOLERANCE)
So, edit the spec_helper or define TOLERANCE before the specs are run.
Elia Schito
@elia
Apr 29 2015 09:30
@vais node v0.12 here, you have an earlier one?
Vais Salikhov
@vais
Apr 29 2015 09:34
$ node -v
v0.10.35
Elia Schito
@elia
Apr 29 2015 09:35
I guess we nailed it down
'%.8f' % (11226018484.0012 - 11226018484.001236)
=> "-0.00003624"
Vais Salikhov
@vais
Apr 29 2015 09:37
right, @elia, but I'm confused - I just did 2 PRs, one failed the other one didn't
Elia Schito
@elia
Apr 29 2015 09:37
My guess is that they're running on different machines
Vais Salikhov
@vais
Apr 29 2015 09:38
Hehe, that would explain it
Elia Schito
@elia
Apr 29 2015 09:38
and they're in the process of upgrading the default version of node
pushing a fix
Vais Salikhov
@vais
Apr 29 2015 09:38
Mystery solved :)
Elia Schito
@elia
Apr 29 2015 09:39
btw, 4.8k specs is awesome
Vais Salikhov
@vais
Apr 29 2015 09:40
:+1:
Elia Schito
@elia
Apr 29 2015 10:04
@vais so, you're still on the #format quest or you need another one? :P
Vais Salikhov
@vais
Apr 29 2015 10:26
@elia nope, that's 100% done. What do you have in mind?
Elia Schito
@elia
Apr 29 2015 10:27
nothing particular, just had a vague idea about trying to get the number of open issues / PR down
Vais Salikhov
@vais
Apr 29 2015 10:27
Do go on...
Elia Schito
@elia
Apr 29 2015 10:28
@vais got a bit envious when I saw the rubyhero sequel maintainer and they said he constantly keeps the number of issues at zero 😮
so maybe there are some quests ready in there
Vais Salikhov
@vais
Apr 29 2015 10:37
A few weeks back I reviewed every issue and closed what I could. I will comb through it again to see if there's anything I can pick off now that I've gained some experience with Opal ;)
That said, a lot of the issues are discussions, WIPs etc. I don't see anything wrong with having those around, as long as they don't go stale. And many of them are, but I would need your help with those...
Elia Schito
@elia
Apr 29 2015 10:39
I'll be happy to help of course!
Vais Salikhov
@vais
Apr 29 2015 10:39
@elia LOL, we have exactly 100 open issues
And a lot of those are compiler issues that I just can't bring myself to figure out. We need @adambeynon back!!!
Elia Schito
@elia
Apr 29 2015 10:42
where's the batman emoji
!
Elia Schito
@elia
Apr 29 2015 10:48
@adambeynon
_ ~/~/~/~/~/~/\~~/~/
                                      _  _                \/__/_|/_/_/_|_/_/
                            _____*~~~  **  ~~~*_____             \____/  
                         __* ___     |\__/|     ___ *__              
                       _*  / 888~~\__(8OO8)__/~~888 \  *_            
                     _*   /88888888888888888888888888\   *_          
                     *   |8888888888888888888888888888|   *
                    /~*  \8888/~\88/~\8888/~\88/~\8888/  *~
                   /  ~*  \88/   \/   (88)   \/   \88/  *~
                  /    ~*  \/          \/          \/  *~
                 /       ~~*_                      _*~~/
                /            ~~~~~*___ ** ___*~~~~~  /
               /                      ~  ~         /
              /                                  /
             /                                 /
            /                                /
           /                    t__n__r__  /        
          /                    | ####### |        
         /            ___      | ####### |             ____i__           /
        /  _____p_____l_l____  | ####### |            | ooooo |         qp
i__p__ /  |  ##############  | | ####### |__l___xp____| ooooo |      |~~~~|
 oooo |_I_|  ##############  | | ####### |oo%Xoox%ooxo| ooooo |p__h__|##%#|
 oooo |ooo|  ##############  | | ####### |o%xo%%xoooo%| ooooo |      |#xx%|
 oooo |ooo|  ##############  | | ####### |o%ooxx%ooo%%| ooooo |######|x##%|
 oooo |ooo|  ##############  | | ####### |oo%%x%oo%xoo| ooooo |######|##%x|
 oooo |ooo|  ##############  | | ####### |%x%%oo%/oo%o| ooooo |######|/#%x|
 oooo |ooo|  ##############  | | ####### |%%x/oo/xx%xo| ooooo |######|#%x/|
 oooo |ooo|  ##############  | | ####### |xxooo%%/xo%o| ooooo |######|#^x#|
 oooo |ooo|  ##############  | | ####### |oox%%o/x%%ox| ooooo |~~~$~~|x##/|
 oooo |ooo|  ##############  | | ####### |x%oo%x/o%//x| ooooo |_KKKK_|#x/%|
 ooo~\|ooo|~\##############  | ~\####### |oox%xo%%oox%~\ooooo |_|~|~\|xx%/|
 ooo ||oHo| |####AAAA######  |h||##XX### |x%x%WWx%%/ox||ooDoo |_| |Y||xGGx|
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  | ~~~~~~~
Vais Salikhov
@vais
Apr 29 2015 10:51
HOLY BATMAN! Startled me on Alt-Tab!
Anyway, @elia, we have 99 open issues now :) opal/opal#678 is closed
Elia Schito
@elia
Apr 29 2015 11:03
saw that, we're at 99 bottles now
Michał Kalbarczyk
@fazibear
Apr 29 2015 11:22
Hi, why this thing not work ?
`
var Test;

Test = (function() {
  function Test(a, b) {
    console.log(a);
    console.log(b);
    this.a = a;
    this.b = b;
  }

  Test.prototype.get_a = function() {
    return this.a;
  };

  Test.prototype.get_b = function() {
    return this.b;
  };

  return Test;

})();
`

class RTest < `Test`
end

puts RTest.new(1,2)
puts `new Test(1,2)`
Arguments passed to constructor is undefined
Michał Kalbarczyk
@fazibear
Apr 29 2015 11:29
Tried with RTest = Native(Test), but it also failed
Michał Kalbarczyk
@fazibear
Apr 29 2015 11:43
What I’m doing wrong ?
AstonJ
@AstonJ
Apr 29 2015 12:02
@vais I know Ryan has commented, but just wanted to say thanks for the feedback! (And yeah I agree, PG support is going to be a big plus :))
Elia Schito
@elia
Apr 29 2015 12:11
@fazibear the original constructor is mapped to ruby's #allocate you probably want to override RTest.new
@fazibear I must say tho that your expectation make sense, maybe it's worth opening an issue or a PR to discuss the thing
Forrest Chang
@fkchang
Apr 29 2015 12:59
We need something like http://elixir-lang.org/learning.html - of course, we need to make that content 1st
Michał Kalbarczyk
@fazibear
Apr 29 2015 13:10
@elia This one works, but its little bit hakish :)
  class RTest
    def self.new(a, b)
      Native(`new Test(#{a},#{b})`)
    end
  end
Elia Schito
@elia
Apr 29 2015 13:12

this should also work:

class RTest < `Test`
  def self.new(a,b)
    `new Test(a,b)`
  end
end

as the prototype is already augmented by inheriting from `Test`

Michał Kalbarczyk
@fazibear
Apr 29 2015 13:16
@elia, With your solution puts RTest.new(1,2).get_a not work
Elia Schito
@elia
Apr 29 2015 13:18
was missing a return
class RTest < `Test`
  def self.new(a,b)
    %x{return new Test(a,b);}
  end
end

puts RTest.new(1,2)
AstonJ
@AstonJ
Apr 29 2015 13:18
I was looking at that earlier @fkchang totally agree. What happened to those screencasts you promised me last year :p hehe
Vais Salikhov
@vais
Apr 29 2015 13:20
@elia Yeah, that kinda sucks, I wish there was a way to make @fazibear's original code "just work"
Michał Kalbarczyk
@fazibear
Apr 29 2015 13:21
@elia, no, still not work. [Error] TypeError: undefined is not a function (evaluating '$scope.get('RTest').$new(1, 2).$get_a()’)
AstonJ
@AstonJ
Apr 29 2015 13:23
I know screencasts are time consuming tho @fkchang, and one of the ideas behind metaruby.com was to get devs like @adambeynon @elia @meh @ryanstout etc to do a screen recording of some aspect of their project just explaining something in particular - they don’t have to worry about scripts, or it being nice like a screencast or keeping an eye on time, just an overview or as much detail as they like, and then I/the metaruby team re-record the info into a new digestible screencast. This seems like a really good, fast-track way to get info and quality screencasts out there without too much hassle for devs. What does everyone else think about this idea?
Michał Kalbarczyk
@fazibear
Apr 29 2015 13:48
@elia, thanks, now I get it :)
Forrest Chang
@fkchang
Apr 29 2015 14:37
@AstonJ screencasts is still on list of things to do. the opalist mailing list is giving some sort of deadline incentive to churn out all the material that's been piling up that I've meant to publish in some form or another. I was really hoping to come up with that smalltalk/lisp machine cool tooling I hinted at w/opal-inspector, but stalled waiting for the method/comment lookup stuff in opal. @adambeynon said it's still on his list though. Maybe @vais knows enough to put that in. I also thought I might be able to fake some of that functionality (small talk object browser type functionality) if I could programmatically call source maps. At least enough to make a really compelling video to inspire ppl
Forrest Chang
@fkchang
Apr 29 2015 14:47
@elia @adambeynon any of you guys use opal-jquery against IE8? Having a problem, suspect that self.new breaks on IE8 coz new is a reserved word and won't work on IE8
Elia Schito
@elia
Apr 29 2015 14:48
@fkchang I think it's fixed on master
Forrest Chang
@fkchang
Apr 29 2015 14:53
@elia is opal-jquery master against 0.8 ?
Elia Schito
@elia
Apr 29 2015 15:00
@fkchang opal master should be enough, opal-jquery master is probably a good idea too
AstonJ
@AstonJ
Apr 29 2015 15:26
Sounds good @fkchang. Quite a few people have expressed an interest in doing screen casts now which is great :) I think we definitely need some beginner tuts that introduce the concepts - just so people can get their heads around the idea.
Forrest Chang
@fkchang
Apr 29 2015 15:40
@elia we may submit a PR with the same self.new fix in the 0.7 since 0.8 doesn't work for us yet
Elia Schito
@elia
Apr 29 2015 15:40
sure, branch is 0-7-stable
Forrest Chang
@fkchang
Apr 29 2015 15:40
@AstonJ it's cool that there is interest in screen casts. I think beginner material of all kinds are needed.
I'd consider writing a book, but then I'd have to understand all that stuff ;) , and then find the time to do it
I think something that comprehensive will help, and more open source examples
I suspect one reservation people have is that they don't think opal is ready for production. Comprehensive instructions/examples can help. Or it's a case of "I'd love to do Ruby in the browser, but I don't know how to XXX" and at the moment, googling doesn't yield the answer.
Elia Schito
@elia
Apr 29 2015 15:44
:+1:
AstonJ
@AstonJ
Apr 29 2015 16:09

@fkchang yeah, book writing is haaard (at least if you are to do it properly). I started work on a Rails book once, but decided against it because Rails changes every year and you would need to make a long term commitment, keeping the book updated etc

I agree with you about the reservations people might have - Opal really could do with a few screencasts on how to use it (say in Rails). It's actually one of the reasons why I think Volt is appealing, cos Ryan has done all the nitty gritty and if you learn Volt, you also end up learning all those things that you might otherwise have thought about using Opal for.

I also think, that maybe as time goes on, Opal becomes the 'heart' of frameworks and tools like Volt, Fire and Clearspring, rather than something used independently. This I think makes sense on a number of fronts - the Opal team then only need to spend time helping a smaller number of devs - rather than thousands for example.

Rick Carlino
@RickCarlino
Apr 29 2015 21:09
What is this magic-breakpoint I keep hearing about?
Is that a debug tool?
Elia Schito
@elia
Apr 29 2015 23:43
@RickCarlino never heard of that…