<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
<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
<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