<meh`>
fkchang`, ready for the lissio awesomeness?
yazgoo has joined #opal
<yazgoo>
Hi, how should I proceed if my script uses String#unpack ?
<meh`>
yazgoo, you don't, sadly
<meh`>
yazgoo, we haven't implemented pack and unpack yet
<meh`>
it's very hard to do in javascript
<meh`>
but it's in my TODO list
<yazgoo>
What if I reimplement it in ruby?
<meh`>
if you manage to, pull request welcome :)
<meh`>
but I assure you, it's hard
<meh`>
strings in javascript are UCS-2 encoded
<yazgoo>
Well, I just would need a subset of it ("C*"), so maybe that wouldn't be that hard?
<yazgoo>
Anyway, thanks :).
<meh`>
so you just want the characters in a string?
<meh`>
>> "abc".chars.map(&:ord)
<meh`>
=> [97, 98, 99]
<meh`>
just use that
<meh`>
it will work in opal
<meh`>
as long as they're below 127
<meh`>
it will work
<meh`>
then you hit the hard part :)
<fkchang`>
meh`: I happily await lissio awesomeness
<meh`>
fkchang`, the REST adapter will use the new promise stdlib
<meh`>
which allows for much awesomeness
<fkchang`>
meh`: catching some of the promise snippets, is it in opal-browser?
<meh`>
fkchang`, no, it will be in opal
<meh`>
in the stdlib
<fkchang`>
oh, I guess I'll need upgrade my stuff to use it. Good stuff
<meh`>
fkchang`, it's not there yet
<meh`>
should be in few hours
<meh`>
it's not easy to implement or think about
<meh`>
but makes the user code way more maintainable
<meh`>
or well, tomorrow
<fkchang`>
It's cool, I'm way behind on where opal-irb is version wise, so I'll need to take some time to upgrade, I think it'd be interesting to play w/the promise stuff in opal-irb
<meh`>
just don't overdo it
<meh`>
promises are to make code easier to handle, not harder :P
<dleedev>
meh`: opal-repl doesn't seem to support multi-line input
<meh`>
dleedev, yeah, it's pretty spartan
<meh`>
dleedev, I usually just have a Ruby source with what I need, and run the repl with opal-repl /tmp/whatever.rb
<dleedev>
meh`: method_added doesn't seem to be working
<meh`>
dleedev, yeah, it's not been implemented yet
<meh`>
it can't be enabled in the corelib so we still have to figure out the best way to go
<dleedev>
what do you mean it can't be enabled?
<meh`>
dleedev, if method_added is present in the corelib, it explodes
<meh`>
bootstrap problems
<meh`>
it would run when it's not been defined yet
<dleedev>
is there a plan to get it working?
<dleedev>
or no concrete solutions yet?
<meh`>
there is a plan, just no good solution yet
<meh`>
and there are more important things to work on
<meh`>
dleedev, but yeah, try to poke adambeynon for it :)
<adambeynon>
dleedev: yeah, it is on the list of things to do, but I havent given it a full go yet
<dleedev>
adambeynon: is there actually a way to make it work?
<adambeynon>
yes. opal used to support it, but as the runtime was re-written it was removed, and never got added back
<ryanstout>
meh`: is the issue that the core lib would trigger a bunch of method added events if you just has the generation step add them after each def ...
<adambeynon>
ryanstout: yes, basically, the corelib would cause a huge number of empty function invocations
<meh`>
ryanstout, yep
<adambeynon>
so somehow the compiler should skip method_added() for all the corelib files
<meh`>
we just need a good way to skip it in the corelib
<adambeynon>
I just need to work out a good way to do that without really crappy compiler hardcoding
<adambeynon>
magic comments might do the trick.....
<ryanstout>
yea, there's probably a better solution than just having a: window.opalCoreLibLoaded = false ; .. load core lib ... ; window.opalCoreLibLoaded = true;
<ryanstout>
hehe
<ryanstout>
I guess you would still have to invoke the method added function
<meh`>
adambeynon, http://sprunge.us/hSBX?rb if you're curious to see the promise implementation so far
<adambeynon>
ryanstout: one thought was to allow per-file compiler options - with method_added() being one of the options
<meh`>
I don't know if anyone but me can understand through that stuff
<meh`>
or through the Enumerator::Lazy stuff for what matters
<adambeynon>
meh`: why the inline javascript?
<meh`>
adambeynon, for ROFLSPEED
<meh`>
adambeynon, those are called often
<meh`>
I can change them if you think it's irrelevant tho
<adambeynon>
na, thats fine - just wondering if there was an opal bug you were overcoming ;)
<meh`>
now the hard part
<meh`>
the When stuff is probably the hardest
<meh`>
but it's oh so important
<meh`>
then it's done
<meh`>
then I have to figure out a way to add tests
<meh`>
adambeynon, where should I add the tests?
<meh`>
spec/opal/stdlib I guess
<meh`>
dleedev, anyway, just playing around or planning to use Opal in production? :)
<dleedev>
meh`: trying to see if it's something I can use
<dleedev>
meh`: don't want to start working on it to get bitten by an unsupported feature
<adambeynon>
dleedev: method_added is something that will be added sooner rather than later
<meh`>
dleedev, we're usually fast at adding things if they're needed
<meh`>
it's just none of us have had the need before