elia has quit [Quit: Computer has gone to sleep.]
fkchang has quit [Ping timeout: 245 seconds]
kludge` has quit [Ping timeout: 248 seconds]
kludge` has joined #opal
denysonique has quit [*.net *.split]
davidboy has quit [*.net *.split]
davidboy has joined #opal
denysonique has joined #opal
denysonique has joined #opal
davidboy has joined #opal
davidboy has quit [Changing host]
denysonique has quit [Changing host]
fkchang has joined #opal
meh` has quit [Ping timeout: 248 seconds]
mike has joined #opal
mike is now known as Guest51196
adambeynon has joined #opal
elia has joined #opal
meh` has joined #opal
meh` has quit [Ping timeout: 252 seconds]
kludge` has quit [Ping timeout: 248 seconds]
kludge` has joined #opal
meh` has joined #opal
fkchang has quit [Ping timeout: 240 seconds]
<meh`> adambeynon, yo
<adambeynon> meh`: back to meh` then?
<meh`> adambeynon, yep
<meh`> adambeynon, any news?
<adambeynon> meh`: not a lot, converted one project to using rspec instead of opal-spec
<adambeynon> so nceee
<adambeynon> nice*
<adambeynon> meh`: it has also brought up another problem of false/true becoming objects when a method is called on them
<adambeynon> false.tap { |s| s != false }
<adambeynon> s becomes an instance of Boolean
<adambeynon> and therefore things like or/and/not break
<meh`> woah
<adambeynon> yeh.. kinda annoying
<adambeynon> truthy tests would need to become this:
<adambeynon> obj !== nil && (obj._isBoolean && obj != false)
<adambeynon> which is really ugly when trying to debug
<adambeynon> obj !== nil && obj !== false <- that is bad enough, which we use now
<elia> adambeynon, meh`, what about `var $if Opal.if`?
<meh`> elia, I don't know, we should benchmark it
<elia> totally agree
<elia> given there are no macros in js
<meh`> I mean, clean code is fun and all, until it slows down everything
<adambeynon> blocks and truthy checks are the two things that make opal code really hard to debug
Guest51196 is now known as fntzr
<adambeynon> also, I have been playing with the idea of compiling source line to target line
<adambeynon> e.g. a sexp on line 10 gets output to line 10 in javascript
<meh`> adambeynon, isn't it going to get even more unreadable?
<elia> adambeynon, that would make sourcemaps almost unnecessary
<meh`> that's what sourcemaps are for
<elia> which is a good thing™ of course
<meh`> having a `expr rescue expr` on a single line sounds ugly
<adambeynon> `try { expr } catch { expr }`
<adambeynon> its not too bad..
<meh`> with all the returns?
<meh`> and blockades?
<meh`> what about expr rescue expr if expr?
<elia> yeah, it can get pretty long
<adambeynon> to be honest, these days i am debugging in javascript instead of sourcemaps w/ opal
<adambeynon> even with coffeescript, debugging in js is just easier..
<adambeynon> brb...
<adambeynon> wayhay! over 900 github followers
<elia> *lunch*
<adambeynon> interesting results..
<meh`> what the
<meh`> why is it so slow on true/false
<meh`> elia, try adding a new Boolean(false)
<meh`> instead of false
<adambeynon> meh`: the ._isBoolean check does that internally, hence the overhead I think
<meh`> adambeynon, yes, that's what I want to find out :)
fntzr has quit [Quit: Leaving]
DouweM has joined #opal
fntzr has joined #opal
DrShoggoth has joined #opal
<elia> adambeynon, meh`, added
fkchang has joined #opal
<meh`> elia, is there no gem for opal-sourcemaps?
<meh`> jjjj
<meh`> derp
<adambeynon> meh`: its baked into Opal::Parser
<adambeynon> um
<adambeynon> actually, thats not true
<meh`> adambeynon, oh ok
<meh`> I thought it was something outside of it :)
<meh`> adambeynon, I'm reimplementing Opal::Server
<meh`> for lissio
<adambeynon> what changes?
<meh`> adambeynon, quite a few things
<meh`> every path but assets returns the index
<meh`> and it will do the prerendering
<meh`> elia, another request for the tests
<meh`> elia, cna you try with (obj != false && obj._isBoolean)?
<meh`> you can drop the new Boolean tests
<meh`> the order might give a huge boost
<meh`> the raw / false is 92% slower here
<meh`> than raw / nil
<meh`> so I think the order could bring both at the same speed
<meh`> elia, disregard that, did it myself
<meh`> I thought it wanted some kind of registration
<meh`> yeah
<meh`> good news
<meh`> now raw / false is the fastest lol
<meh`> with just a swap
<meh`> adambeynon, also wouldn't obj != false be good enough?
<elia> meh`, link please (happy you did it yourself, jsperf makes me feel unconfortable)
<meh`> I think there's no need for an obj._isBoolean test
<meh`> if it's not nil and not false, it's true
<meh`> `obj != false && obj !== nil` should be the fastest
<meh`> oh right
<meh`> forgot about the retarded js type cohercion semantics
<meh`> disregard that
<meh`> but still, swapping makes it faster
<meh`> probably slower when it's true
<adambeynon> yeah, != false is a pain to work with. the _isBoolean part is needed
<adambeynon> yay, javascript
GitHub126 has joined #opal
<GitHub126> opal/master 7712501 Adam Beynon: Support 'Module::foo bar' style command calls
<GitHub126> [opal] adambeynon pushed 1 new commit to master: http://git.io/ju5DDQ
GitHub126 has left #opal [#opal]
GitHub192 has joined #opal
GitHub192 has left #opal [#opal]
<GitHub192> [opal-rspec] adambeynon pushed 1 new commit to master: http://git.io/DhfS_A
<GitHub192> opal-rspec/master 8b8374e Adam Beynon: Stop stubbing message_expectation from rspec/mocks
travis-ci has joined #opal
<travis-ci> [travis-ci] opal/opal#1093 (master - 7712501 : Adam Beynon): The build passed.
<travis-ci> [travis-ci] Build details : http://travis-ci.org/opal/opal/builds/12425916
travis-ci has left #opal [#opal]
GitHub111 has joined #opal
<GitHub111> opal-rspec/master b9aada0 Adam Beynon: Update readme with fixed issue (parsing command calls)
<GitHub111> [opal-rspec] adambeynon pushed 1 new commit to master: http://git.io/lYUC7A
GitHub111 has left #opal [#opal]
fntzr has quit [Quit: Leaving]
elia has quit [Ping timeout: 252 seconds]
meh` has quit [Ping timeout: 265 seconds]
GitHub189 has joined #opal
<GitHub189> [opal] adambeynon pushed 1 new commit to master: http://git.io/H_Wvmw
GitHub189 has left #opal [#opal]
<GitHub189> opal/master 18e1002 Adam Beynon: Methods defined inside block should donate to modules (if inside module)
adambeynon has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
travis-ci has joined #opal
<travis-ci> [travis-ci] Build details : http://travis-ci.org/opal/opal/builds/12428804
travis-ci has left #opal [#opal]
<travis-ci> [travis-ci] opal/opal#1094 (master - 18e1002 : Adam Beynon): The build passed.
meh` has joined #opal
GitHub137 has joined #opal
<GitHub137> opal-rspec/master a8f781c Adam Beynon: Remove 1 fix now that upstream master donates methods from modules
<GitHub137> [opal-rspec] adambeynon pushed 1 new commit to master: http://git.io/VGQVmw
GitHub137 has left #opal [#opal]
GitHub115 has joined #opal
<GitHub115> [opal-rspec] adambeynon pushed 1 new commit to master: http://git.io/qxa0lw
GitHub115 has left #opal [#opal]
<GitHub115> opal-rspec/master c4848be Adam Beynon: Update readme for 1 more broken feature
Kilo`byte has joined #opal
<Kilo`byte> i wonder if i can compile opal with itself
<meh`> Kilo`byte, of course you can, that's what opal-parser.js is
<Kilo`byte> oh, didn't see that file
<Kilo`byte> nice :D
<meh`> :)
<Kilo`byte> well, i miss eval() not working
<Kilo`byte> might pr it in
<Kilo`byte> so it uses the javascript compiler and then evals the javascript :P
<meh`> Kilo`byte, eval works
<meh`> Kilo`byte, but you need to add opal-parser.js
<Kilo`byte> not in the web demo
<Kilo`byte> oh,
<Kilo`byte> k
<meh`> in what demo?
<meh`> the try opal on opalrb?
<Kilo`byte> yes
<meh`> yeah I think it's not there for size's sake
<meh`> it's kind of huge
<meh`> I think it's larger than the whole corelib
<Kilo`byte> hmm
<Kilo`byte> well, i am going to offer a debug console in my browser game i am planning. Might just make it dynamically load it on demand
<meh`> Kilo`byte, in that case you should look into opal-inspector
<Kilo`byte> so, open console => load opal-parser.js
<meh`> fkchang, ^
<meh`> Kilo`byte, fkchang is our browser inspector/repl guy
<Kilo`byte> ah
<Kilo`byte> whats inspector do? quick google didn't help mucj
<meh`> he's also going to keep a talk about opal at rubyconf
<Kilo`byte> nice
<meh`> Kilo`byte, I have the feeling the inspector is still internal and non-working
<Kilo`byte> ah
<Kilo`byte> k
<meh`> Kilo`byte, but I recall adambeynon being able to load an opal shell one of his production things
<Kilo`byte> you don't have to ping me for every message :P
<meh`> Kilo`byte, eh, good ol' IRC OCD
<meh`> see, I can't even stop ◕ ◡ ◔
<Kilo`byte> lol
<Kilo`byte> eval won't work in dat demo either :/
<Kilo`byte> lol
<Kilo`byte> Error: undefined method `eval' for main :(
<meh`> Kilo`byte, he probably didn't bundle opal-parser there either
<Kilo`byte> well
<meh`> gotta ask him, I'm the corelib/browser API guy
<Kilo`byte> well
<Kilo`byte> if he didn't include it, how would he compile ruby => js?
<Kilo`byte> meh`: ^
<meh`> Kilo`byte, yeah, that's kind of puzzling, I think it uses an alternate parser, made for IRB
<Kilo`byte> ah, k
<meh`> but again, not sure
<meh`> it may very well be missing the Kernel.eval hook
<Kilo`byte> meh
fkchang has quit [Ping timeout: 252 seconds]
meh` has quit [Quit: brb]
elia has joined #opal
meh` has joined #opal
ryanstewart2 has joined #opal
ryanstewart has quit [Ping timeout: 240 seconds]
fkchang has joined #opal
DrShoggoth has quit [Quit: Leaving]
<Kilo`byte> def eval(code)
<Kilo`byte> end
<Kilo`byte> `eval(#{Opal.parse(code)})`
<Kilo`byte> there we go
<Kilo`byte> so easy :P
<Kilo`byte> you know what?
<Kilo`byte> i learned about this today
<Kilo`byte> and it is already my favourite javascript related library
<Kilo`byte> meh`: how can i register a Kernel hook btw?
<elia> looking at the browser graph seems that safari 6.1 is really kickin'ass
<elia> Kilo`byte, you mean redefining Kernel#eval?
<Kilo`byte> yes
<elia> than it's module Kernel; def eval code; `eval(#{Opal.parse(code)})`; end; end
<elia> *then
<Kilo`byte> nice
<Kilo`byte> thanks
<elia> cc fkchang
<Kilo`byte> trying if i can get (for the fun only ofc, in production its dumb performance wise) a pice of javascript that looks for script tags with type="text/ruby" and evaluates them
<Kilo`byte> elia: how can i compile some ruby into javascript?
<Kilo`byte> /bin/opal stuff.rb stuff.js?
<elia> Kilo`byte, opal -c stuff.rb > stuff.js
<Kilo`byte> ah, thanls
<Kilo`byte> s/l/k/
adambeynon has joined #opal
<elia> Kilo`byte, if you incur in any issue lemme know, bin/opal still has some rough spots
<Kilo`byte> ah, k
<Kilo`byte> also, you having any experience with the jquery part?
<Kilo`byte> can't seem to find out how to add Element x as child to Element y
<adambeynon> y.append x
<adambeynon> or
<adambeynon> y << x
<Kilo`byte> ah, derp
<Kilo`byte> why didn't i try that
<Kilo`byte> :O
<Kilo`byte> TypeError: Object [object Object] has no method 'substring'
<Kilo`byte> didn't use substring in my code
<Kilo`byte> (on try page)
<Kilo`byte> oh
<elia> adambeynon, was adding Kernel#eval in corelib leaded by this line:
<Kilo`byte> thats in the partser
<elia> raise NotImplementedError unless defined?(Opal::Parser)
<Kilo`byte> umm
<Kilo`byte> derp
<elia> adambeynon, but fails on defined
<Kilo`byte> woot
<Kilo`byte> http://opalrb.org/try/#code:e%20%3D%20Element.new('script')%0Ae%5B%3Atype%5D%20%3D%20'text%2Fruby'%0Ae.html%20%3D%20'alert%20%22Hello%20World%22'%0AElement.find('body')%20%3C%3C%20e%0A%0ADocument.ready%3F%20do%0A%20%20Element.find('script%5Btype%3D%22text%2Fruby%22%5D').each%20do%20%7Ce%7C%0A%20%20%20%20puts%20'found'%0A%20%20%20%20%60eval(%23%7BOpal.parse(e.html)%7D)%60%0A%20%20end%0Aend
<Kilo`byte> maybe shouldve used shortener
<Kilo`byte> :P
<elia> :)
<Kilo`byte> wait
<Kilo`byte> thats redundand
<Kilo`byte> text/ruby scripts get evaluated
<adambeynon> Kilo`byte: yep, opal-parser.js already picks them up
<adambeynon> but only inline ones
<adambeynon> it doesnt load scripts with a src attribute
<adambeynon> elia: let me look into the defined? error
<elia> adambeynon, right now i'm trying to add the missing parts to defined? in the parser
GitHub84 has joined #opal
<GitHub84> opal/master 1cdbaea Adam Beynon: Methods defined on BasicObject should also be donated to bridged classes
GitHub84 has left #opal [#opal]
<GitHub84> [opal] adambeynon pushed 1 new commit to master: http://git.io/jMsbTw
<elia> adambeynon, but I suspect that it's related to the grammar…
<adambeynon> elia: does it output an error message at all?
<elia> adambeynon, nope
<adambeynon> elia: this is what we need to fix, I think: https://github.com/opal/opal/blob/master/lib/opal/parser.rb#L638-L639
<adambeynon> for some reason it is hardcoded to always return false
<adambeynon> colon2 === Foo::Bar
<elia> adambeynon, :)
travis-ci has joined #opal
<travis-ci> [travis-ci] opal/opal#1095 (master - 1cdbaea : Adam Beynon): The build passed.
<travis-ci> [travis-ci] Build details : http://travis-ci.org/opal/opal/builds/12438751
travis-ci has left #opal [#opal]
<elia> probably a stub added at some point…
<adambeynon> elia: haha, yeah. trying to get mspec working at a guess ;)
<elia> adambeynon, also the :ivar part seems wrong since it checks for nil equality
<elia> and im pretty sure ivars are #defined? even when nil
<adambeynon> elia: yeh, I think you're right. should use hasOwnProperty I think
<Kilo`byte> but really, this project is one of the coolest i've seen so far
<elia> adambeynon, i'll try to fix ivar, but i have no idea on how to fix the colon2
<Kilo`byte> i will prob never want to write javascript again
<adambeynon> Kilo`byte: opal is really fun to play with :)
<Kilo`byte> indeed
<adambeynon> elia: I will give colon2 a crack… not sure why I didn't implement it at the time
<Kilo`byte> especially with Rails
<elia> adambeynon, thanks
<adambeynon> meh`: RE your comment about Kernel#srand from before, it was just a stub as rspec uses it
<adambeynon> not sure we can really implement it properly
<adambeynon> well, we cant, but yeah
<elia> :gvars are ok, now :yield
meh` has quit [Ping timeout: 264 seconds]
meh` has joined #opal
GitHub56 has joined #opal
<GitHub56> [opal-rspec] adambeynon pushed 1 new commit to master: http://git.io/aoBFiw
GitHub56 has left #opal [#opal]
<GitHub56> opal-rspec/master 4f7da17 Adam Beynon: Remove another temp fix now fixes pushed upstream to opal
<elia> adambeynon, "defined? super()" requires grammar intervention I think…
<elia> :yield is covered
<elia> adambeynon, for defined? super we need a way to retrieve current super, now that knowledge is inside dispatch_super and process_super I think…
<adambeynon> elia: to clarify, `defined? super()` just checks if we can call super, yeah? rather than actually calling it and checking the result
<elia> adambeynon, yes, checks if it's available
<adambeynon> elia: right, because of the way super now works (to support modules, singletons, etc) we might need some runtime support for that
<elia> adambeynon, probably is best to extract the super lookup from where it's actuallly called
<elia> mmm, find_obj_super_dispatcher
<elia> adambeynon, is that function enough?
<adambeynon> elia: yes..well, it does raise an error currently if super() cant be found. we want to change that to return null
<adambeynon> which dispatch_super() can then handle the null value to raise an error
<adambeynon> so, defined? super()
<adambeynon> would then do something like
<adambeynon> find_obj_super_dispatcher(…) ? "super" : nil
<Kilo`byte> lol
<Kilo`byte> i could translate the haml parser into js
GitHub169 has joined #opal
<GitHub169> opal/master b03046a Elia Schito: Add support for #defined($gvar) and #defined?(yield)
<GitHub169> opal/master 371c010 Elia Schito: Better error message for unsupported #defined? args
<GitHub169> [opal] elia pushed 4 new commits to master: http://git.io/5gGzuA
GitHub169 has left #opal [#opal]
<GitHub169> opal/master c67ec04 Elia Schito: Avoid variable shadowing (could lead to errors in 1.8)
elia has quit [Read error: Connection reset by peer]
elia has joined #opal
ryanstewart2 has quit [Read error: Connection reset by peer]
<elia> adambeynon, right, but beware that the problem with defined? super() is that can't be parsed
ryanstewart has joined #opal
<adambeynon> elia: are you sure?
<adambeynon> % bundle exec bin/opal -c "a = defined? super()" --sexp
<adambeynon> [:lasgn, :a, [:defined, [:super, [:arglist]]]]
<elia> adambeynon, I got the error adding
<elia> language/defined_spec
<adambeynon> just checking it out now
travis-ci has joined #opal
<travis-ci> [travis-ci] Build details : http://travis-ci.org/opal/opal/builds/12440604
travis-ci has left #opal [#opal]
<travis-ci> [travis-ci] opal/opal#1096 (master - 0c93869 : Elia Schito): The build passed.
<adambeynon> elia: the first failing sytax I get is for local assignment
<adambeynon> bad defined? part: lasgn ([[:lasgn, :x, [:int, 2]]])
<adambeynon> argh, got to run
<adambeynon> I can fix tomorrow
adambeynon has quit [Quit: Textual IRC Client: www.textualapp.com]