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