adambeynon changed the topic of #opal to: http://opalrb.org - Ruby runtime and library on top of Javascript | 1.0.0 is near | This channel is logged at http://irclog.whitequark.org/opal
fkchang has quit [Ping timeout: 260 seconds]
e_dub has quit [Quit: It's a hard knock life]
e_dub has joined #opal
e_dub has quit [Ping timeout: 245 seconds]
e_dub has joined #opal
ivanoats has quit [Ping timeout: 245 seconds]
ivanoats has joined #opal
DrShoggoth has quit [Quit: Leaving]
fkchang has joined #opal
<marcandre> Hi! Looks like opal-node is quite out of date... I'm trying to update it and running in some difficulties. Anyone around that might be able to help?
<meh`> marcandre, I could try, but I have the feeling you're in a very unfortunate timezone
<meh`> all core developers are in Europe
<marcandre> I didn't realize that; I'll try to chat earlier in the day then, it's only ~6h.
<marcandre> The current opal-node tries to access `parser.requires`, which doesn't seem to be defined. Was that to make a list of the required opal libs? Is it gone, i.e. not needed anymore?
<meh`> marcandre, pretty much everything changed since then
<meh`> and I have the feeling it was meant more of a joke/PoC than anything
<marcandre> Really? Not sure how it's funny :-)
<meh`> marcandre, there's already Ruby, why would you run Opal on a server?
<marcandre> If you need to run js on the server, but would rather write opal...?
<marcandre> Also, I wanted to try writing a meteor app in opal...
<meh`> I don't know, it doesn't sound like it would blend easily
<meh`> sounds like you'd end up with some of the problems we have with angularjs
<meh`> but yeah, until something like meteor or angularjs exist for Opal/Ruby I don't see many other solutions
<marcandre> I'm curious to know what problems you're having with angular
<meh`> mostly its retarded cruft
<meh`> it uses $ and $$ as prefixes for their stuff, and so do we
<marcandre> oups
<meh`> also it uses the name of the function arguments to extract god knows what
<meh`> and they expect them to start with $
<meh`> but you can't have arguments starting with $ in Ruby
<meh`> and probably other issues
<meh`> marcandre, but if you're interested, I am working on something like angularjs for Opal
<marcandre> Lissio looks interesting :-)
lectrick_ has joined #opal
<marcandre> Still, I'd like to check how well (or not) opal can be used in meteor.
DouweM has quit [Ping timeout: 245 seconds]
lectrick has quit [Ping timeout: 245 seconds]
lectrick_ is now known as lectrick
<marcandre> Ah, I think I got it. I was passing a plain JS object instead of a Hash...
fkchang has quit [Ping timeout: 246 seconds]
marcandre has quit [Remote host closed the connection]
meh` has quit [Ping timeout: 246 seconds]
elia has joined #opal
<elia> ylluminate, thanks, who knows if it will bring somewhere… :)
kludge` has quit [Ping timeout: 265 seconds]
kludge` has joined #opal
<adambeynon> elia: with the opal haml filter in opal-rails, is the compiled opal code cached directly between requests?
<adambeynon> (first time im using the filter)
<elia> adambeynon, not sure, but I think yes
<adambeynon> elia: by the looks of it, aslong as there isnt any string interpolation #{foo}, then it is cached
<elia> good to know
<elia> adambeynon, kinda on the same line, one thing that bogs me very much is a way to invalidate sprockets cache between opal versions
<adambeynon> elia: yes, I find I have to restart pow as well (as it must be caching assets in memory sometimes too)
<elia> adambeynon, I think I never had that problem, but I often need to trash tmp/cache/assets
<elia> which sucks, technically speaking
<adambeynon> elia: sometimes trashing that folder does the job. I have a rake task that just removes that folder and touches tmp/restart.txt
<adambeynon> I cant imagine coffeescript has the same problem, their generated code doesnt really change at all
<elia> indeed, that's what I figured out too, for not being a problem for everyone else…
<elia> reading (now) through sprockets issues, seems that the right way is to influence somehow the digest calculated from the source file
<elia> if I can find a way to inject opal version before digest calculation it should work
<adambeynon> elia: sounds a good way to go. I will have a read up on it now as well
DouweM has joined #opal
elia has quit [Quit: Computer has gone to sleep.]
elia has joined #opal
<elia> adambeynon, PR on it's way, wondering if it's worth monkeypatching from opal-sprockets until it's merged
fkchang has joined #opal
marcandre has joined #opal
DrShoggoth has joined #opal
e_dub has quit [Remote host closed the connection]
GitHub138 has joined #opal
<GitHub138> opal/master a902b16 Marc-Andre Lafortune: Opal.compile and Opal.eval accept options (Hash or plain object)
<GitHub138> opal/master 7473df7 Adam Beynon: Merge pull request #451 from marcandre/compile_with_options...
<GitHub138> [opal] adambeynon pushed 3 new commits to master: http://git.io/Kw1qYA
<GitHub138> opal/master 55f625a Marc-Andre Lafortune: Opal.hash accepts plain object as argument
GitHub138 has left #opal [#opal]
GitHub175 has joined #opal
<GitHub175> [opal-haml] adambeynon pushed 1 new commit to master: http://git.io/byH_Dg
GitHub175 has left #opal [#opal]
<GitHub175> opal-haml/master 4d1296f Adam Beynon: Support building dynamic attributes at runtime (Buffer#attributes())
travis-ci has joined #opal
<travis-ci> [travis-ci] Build details : http://travis-ci.org/opal/opal/builds/14931408
<travis-ci> [travis-ci] opal/opal#1569 (master - 7473df7 : Adam Beynon): The build passed.
travis-ci has left #opal [#opal]
<ylluminate> np elia. i just submitted opal to dailyjs as well and noted this and the general status of opal.
<elia> ylluminate, I think I tried once to submit it to jsweekly, but afaik hasn't been published
<ylluminate> after my chat with ryanstewart2 and meh the other night, i started to rethink my approach of go+angular for a very large project we're about to undertake
<ylluminate> sorry, meant ryanstout, tab complete didn't like me ;)
<elia> ylluminate, i'll need to look it up in the logs… :)
<ylluminate> well, not a lot of detail as the project is very nondisclosed (read: under nda right now)
<ylluminate> but it was valuated at 700M and is a potentially enormous social network. my biggest headache is balancing between developer productivity / agility and actual performance as it is heavily realtime reliant
<ylluminate> we already are a ruby and rails house, so going with rails + opal would be a boon in terms of rapidity of development
<ylluminate> but i would probably have to figure out how to integrate firebase for the realtime / cached data and then use a more standard solution such as mongo or pgsql to store longer term data
<ylluminate> it has a lot of gaming going in it
<ylluminate> it was elia ryan said "angular is slow with a lot of data because of the dirty checking" and that is what got me thinking
<ylluminate> s/it was//
<adambeynon> ylluminate: are you leaning towards more server side rendering, or client side? or a bit of both?
<ylluminate> well, a bit of both. i want to be careful to not do everything in js for both seo/marketing purposes + to keep some logic safer on the server
<ylluminate> this project was initially incepted as a large actionscript app a couple years ago
<ylluminate> but then things have gotten to the point where js is quite superior at this point. but one concern has been ip protection
<ylluminate> and i keep getting beaten up over it b/c i'm not able to "guarantee" the client js code if i put most of the logic there
<adambeynon> it does depend a lot on the type of application, I suppose
<adambeynon> ylluminate: one slight benefit of client side opal is sharing of templates. the apps I work on are mostly client side, but all the erb templates get shared so rendering can take place on both
<adambeynon> and Im working on haml support now as well
<ylluminate> yeah, the haml support was attractive
<adambeynon> discourse (emberjs app) is a good flasgship of doing some basic server rendering for seo
<ylluminate> interesting
<ylluminate> are there any opal projects that we could look at at this point to see a somewhat robust example of it in action?
<ylluminate> the more we push to the client the better. it's so highly graphical and has so many realtime properties, the more client based the better
<ylluminate> at least for prototypical needs we might use rails and then replace pieces with go as we go (perhaps such as for the api access)
<adambeynon> ylluminate: as far as I know, all apps using opal are all private/internal
<adambeynon> a very small example app is the todos-app
<adambeynon> or meh` has one
<ylluminate> yeah, i had been afraid of that
<adambeynon> hundred lines of code style things
<ylluminate> gotcha
GitHub91 has joined #opal
<GitHub91> opal-haml/master c52b37e Adam Beynon: Add basic usage to readme
<GitHub91> [opal-haml] adambeynon pushed 1 new commit to master: http://git.io/XwIF_A
GitHub91 has left #opal [#opal]
<ylluminate> i see you started working on a framework with opal
<ylluminate> what's up with that?
<adambeynon> ylluminate: I cant show you my apps, but I could give you an overview of the code structure etc
<adambeynon> vienna?
<ylluminate> right
<adambeynon> or lissio?
<ylluminate> well, vienna saw it on your github repos
<adambeynon> ah right, yes. its aiming to be similar to backbone/spinejs
<adambeynon> if you are familiar with them
<ylluminate> but i'm interested in lissio i suppose as well. trying to understand anything that might be going to influence the way forward
<ylluminate> okay
<ylluminate> sure
<adambeynon> ylluminate: vienna works better with templates, or raw html - using haml/erb
<adambeynon> lissio has a DSL for creating html
<adambeynon> div { span { div "wow" } }
<adambeynon> that kinda thing
<elia> ylluminate, I recently found some joy using vanilla opal-browser
<adambeynon> ah yes, vienna relies on opal-jquery, where as lissio uses opal-browser directly
<ylluminate> that's one of the "disadvantages" of opal right now in that it's just a language. it's not a horrible situation considering this app we're building is from the ground up and could potentially be good for distilling out our own dsl and/or framework
<adambeynon> no need for vienna
<elia> and being ruby probably you app specific framework will emerge :)
<ylluminate> yeah
<ylluminate> this particular project is more of an app than a website
<ylluminate> it has a very desktop feel to it
<ylluminate> might even offer it as an "app" as well based on the core client codebase
<ylluminate> would make sense with opal and really working mostly on the client side
<ylluminate> anyone played with firebase with opal yet?
<adambeynon> I havent - all my work has been using a rails/psql backend
<adambeynon> no reason it cant work firebase though
<adambeynon> for js interaction, you can use either Native class, to wrap js objects, or write inline js code
<adambeynon> using backticks or x-strings
<ylluminate> curious, could you throw in https://github.com/oscardelben/firebase-ruby?
<ylluminate> not meaning you specifically, just the general "you" there on including a gem like this
<adambeynon> ylluminate: well, opal doesnt have `Net::HTTP` available, but we could write a custom browser version to handle those requests
<adambeynon> as we are in js though, having async net requests is a must, so we would have to slightly alter the `HTTP` api
<adambeynon> both opal-jquery and opal-browser offer a custom ajax/xmlhttprequest class
<adambeynon> using gems targetted at "normal ruby" might cause these slight assumptions which could break opal apps
<ylluminate> right
<ylluminate> i suspect that could be important to have a clean implementation of that
elia has quit [Ping timeout: 248 seconds]
elia has joined #opal
elia has quit [Ping timeout: 260 seconds]
<fkchang> adambeynon: when u test js objects from opal-rspec, do you just do something like js_obj = Native(`js.whatever("blah")`); expec(js_obj.foo("bar")).to eq("BAR")
<fkchang> I suppose I could try it, so I guess I'm just wondering if you have general patterns or tips
meh` has joined #opal
ryanstout has joined #opal
ylluminate has left #opal [#opal]
ylluminate has joined #opal
<ylluminate> any gotchas on running the todomvc? one of my guys just tried to run it and had some issues, but neither of us have had time to see what was preventing it from going yet
<meh`> adambeynon, ^
<fkchang> ylluminate: I've had problems until recently, when I last tried, say about a month-ish ago, it worked
<ylluminate> okay, i'll have to look at it more closely
<ylluminate> also, any "ide" of choice for opal at the moment? i usually use emacs and textmate, but i figured some folks might want to use rubymine if possible
<fkchang> ylluminate: I'm sure people just use their ruby env of choice
<ylluminate> yeah
<ylluminate> good deal
<fkchang> I've yet to try rubymine on my opal stuff, but I should
<ylluminate> i figured that rubymine will be nice for them
<fkchang> it ought to be
<ylluminate> my 13 year old son who's been working on js for the past 1.5 year is wanting to jump in
<fkchang> cool
<ylluminate> he uses sublimetext
<fkchang> how good is he at js
<ylluminate> not bad
<ylluminate> he's been starting to work on writing games
<ylluminate> been working with impactjs
<fkchang> I was going to make a screencast of me exploring a 2d js lab via opal in oapl-irb, might be fun for him to watch if I ever get to it
<ylluminate> i'm sure it would
<ylluminate> he has wanted to start working on ruby for a while. i think he started doing some tutorials about a month ago
<fkchang> I didn't realize impactjs was pay
<ylluminate> yeah
<ylluminate> it's pretty nice
<ylluminate> i was kind of glad he started with js as i got my start in c and so he has the background and feeling of how things are done in that way before jumping into ruby
elia has joined #opal
<ylluminate> i wonder, any examples of including js libs like this in opal and working with it? i thought i saw something like that floating around some time ago
<ylluminate> i'd like to kind of walk through how to use impact with opal for him
<meh`> ylluminate, the best way is always to write a full blown wrapper, so you can make it rubyesque
<fkchang> in short, if you just want the results you can use x strings, if you want to use the js object (in the OO sense and the extended hash) as a ruby object you have to wrap it as Native
<fkchang> I think the class based OO like the js stuff is, the easier it is to wrap that way, I would guess a lot of the time, you want to make your own wrappers to give then a nice ruby interface
<fkchang> I think opal-jquery is a good example, the ruby-fication of jquery really looks nicer than a straight port
<fkchang> I wrap codemirror as an object in opal-irb
<meh`> ylluminate, looking at how impactjs works it sounds like it's going to be a pain without a full blown wrapper
<fkchang> I wouldn't be surprised
<meh`> just seeing ig.Entity.extend({}) is not going to translate very well
<ylluminate> alright, lovely :)
<meh`> ylluminate, but it's really easy to write a ruby-esque wrapper
<ylluminate> okay, that's good to know
<fkchang> yeah, I think any attempt to imitate class based inheritance will not translate well
<meh`> that extend? just define self.inherited and do the magic internally
<fkchang> which seems to happen all the time in js libs
<meh`> class EntityBlob < Impact::Entity
<meh`> in the inherited you create an @internal object, and you pass some wrappers that call the actual methods
<meh`> init would translate to #initialize and so on
<meh`> a dozen lines at most
<ylluminate> hmm, that might make a nice screencast in terms of showing how one would go about writing a wrapper
<ylluminate> hey, have you guys tried getting pry to work with opal yet?
<meh`> not that I know of
<ylluminate> oh, not sure if you guys have seen the opalrb tag i created some time ago on SO: http://stackoverflow.com/tags/opalrb/info
<fkchang> ylluminate: I'd be surprised if pry would work, too many MRI internal stuff, I'd guess, but I will steal some pry features over time
<fkchang> adambeynon: u there?
marcandre has quit [Remote host closed the connection]
<ylluminate> pry and a couple sub libs are so exceptionally useful. really hope to see that
DrShoggoth has quit [Quit: Leaving]
<fkchang> elia: u know anything about setting up opal-rspec ?
elia has quit [Quit: Computer has gone to sleep.]