These are chat archives for opal/opal

30th
Jul 2015
@bbatsov ^ regarding the rumors of RubySpecs death being greatly exaggerated :wink:
Vais Salikhov
@vais
Jul 30 2015 04:04
Clipboard01.gif
A little more publicity for Opal :wink2:
Vais Salikhov
@vais
Jul 30 2015 04:49
Thanks to @chrisseaton (and @eregon obviously) :smile:
Jared White
@jaredcwhite
Jul 30 2015 15:07
@fkchang @elia My understanding of Crystal is that it has no visibility into the world of Rubygems -- it could maybe execute a system command and get the return of it...but I'm not sure how well that would work with Sprockets. You might need a Crystal server and a separate "asset" server that's still Ruby.
ylluminate
@ylluminate
Jul 30 2015 15:45
on the topic of crystal, i'm curious as to what you guys see as the real appeal at the moment for the language as far as using opal with it. wouldn't this be more akin to a ruby + coffeescript scenario (where crystal is the coffeescript, but is more ruby-like obviously)? from what i've understood, it's not syntactically a one-to-one relationship with ruby; while it has obvious (serious) performance advantages, it does introduce a quirky relationship where we can't just run gems out of the box, etc...
Jared White
@jaredcwhite
Jul 30 2015 15:56
@ylluminate The way I see it, the #1 reason people ditch Ruby on Rails as a web stack is performance. First you ditch it in client-world by using frontend frameworks in a single page app (SPA). Then you ditch it in server-world by building APIs in some other language (JS/Node, Go, etc.) But if you are building SPAs in Javascript, Go, etc., well that's no fun! What if we could use Ruby/Ruby-like languages for both frontend and backend dev with great performance? Seems like a win/win scenario. (Of course, there are valid arguments to be made that Rails really isn't that big of a performance problem for most webapps...Improvements to MRI in 2.2+, or switching to JRuby, using the latest app servers like Passenger 5, etc...and there are even arguments to be made that a more backend-focused approach with things like Turbolinks for frontend responsiveness are also decent solutions.)
But, y'know, NEW HOTNESS! :)
ylluminate
@ylluminate
Jul 30 2015 16:20
well that is my concern. raptor (passenger 5) has been amazing for us and i don't see the practicality of a loss of producitivity shifting to crystal, but i can see the "new hotness" argument, sure.
i could see a volt-like framework called "crystal-meth" that evokes the power of opal for the client side... ;)
Forrest Chang
@fkchang
Jul 30 2015 16:21
@ylluminate in my playing w/crystal thus far, I see it as a "subset of ruby" that ends up faster and w/smaller binaries than go. So my 1st thought is that I want to evangelize crystal as something rubyist can and should use in lieu of those times you would switch to golang or node -- which is generally performance based. That crystal makes binaries, and thus shippable w/o installing anything is an orthogonal perk. That being said, depending on the ruby you write, crystal will compile it directly, I grabbed some ruby mandelbrot code and it ran w/o modification - so I think constraining to a certain subset of ruby could work w/crystal in the backend. Since w/opal there are also things you have to do that don't work the same on the backend w/MRI or JRuby, I don't know if it would be that much of a change. That being said, crystal is still pretty early. I tried to get a simple websocket example working (that I want to hit on the front end from opal), and it turns out there's a fix or 2 that needs to get in for that to work. But, Crystal is also the only static language I can think of that has open classes, so I was able to monkey patch in the fixes w/o having clone, change and recompile crystal. We also spiked another application that uses JSON, which we encountered some issues. That might have some hinderances wrt to using crystal for webwork given the ubiquity of JSON, though hopefullly our issue on crystal will get some changes
Ultimately, if I can basically write Ruby and have it run as fast as golang, I'm pretty happy.
@jaredcwhite I suppose what @elia is suggesting is that that I use opal/sprockets rake task to do the compilation (possibly running under guard -- this is basically how people use grunt to do the equivalent of asset pipeline, set up the rules for grunt and then have it watch the source files)
That's probably a good 1st step in lieu of trying to implement asset pipeline directly in crystal
Forrest Chang
@fkchang
Jul 30 2015 16:29
@ylluminate good name crystal-meth, if only we could get some sort of opal reference into it too
ylluminate
@ylluminate
Jul 30 2015 16:33
there's no doubt that that name is memorable and would certainly catch eyes
it sounds like a fork of volt to use crystal that would mutually contribute would perhaps be beneficial and act as a healthy boon to the effort of volt. volt would be the pure ruby stack, meth would be the crystal stack version with the same opal effort going on
the idea of "hotness" is indeed accurate in that it's getting attention for the reasons noted, even though the practicality may be in question
Elia Schito
@elia
Jul 30 2015 17:41
As fun as it is the crystal-meth name I can see how it can raise issues like the cocaine gem did etc. Just a heads up ;)
For me crystal is being the solution to ship the agent for timesampler.com which so far was a gem nearly impossible to install for any non-ruby-developer. For I also tried a nw.js / atom-shell approach reusing nearly 100% of the code with Opal (which is a really cool project if you didn't know) but that too didn't end well, because you know… Node.js.
With crystal I almost finished porting the code with just its stdlib (+ the external fswatch) and I think that by tonight I can have a two executables shippable that I can easily wrap in an osx package and make people install it quite easily.
ylluminate
@ylluminate
Jul 30 2015 17:55
lol @elia the interesting point of crystal-meth is that it's not as confusing as something like cocaine. a gem named cociaine is kind of hard to grok and what's worse is that their description on rubygems is even worse: "A small library for doing (command) lines"... o.o Kinda odd and crazy, but meth is more akin to volt - well what does it mean? it doesn't matter per se because it's a framework and it's more about name recognition than describing what it is in the name for these framework cases. eg, rails doesn't necessarily make sense. you have to think about it quite a bit to pull in meaning, but the same could be said of methamphetamines as well - they, according to a quick google, release dopamine rapidly and thus create "reward, motivation, the experience of pleasure, and motor function" obviously it will be criticized, but it will definitely catch some positive attention as well in that perhaps it will shift the negatively connoted drug towards something more positive. lol... anywayzzz ;)
Gabriel Rios
@gabrielrios
Jul 30 2015 18:13
after seeing github remove a project for having word retard on it, It’s always good to have that in mind
Elia Schito
@elia
Jul 30 2015 18:19
@gabrielrios any link to the full story? I missed the drama this time…
ylluminate
@ylluminate
Jul 30 2015 18:20
just move to gitlab if needed... :D
this drama is getting disgustingly old
people are not "real" anymore unfortunately. too worried about things that absolutely shouldn't be made into mountains
i guess the next logical step for folks like this would be to make kids wear full body armor when playing soccer or perhaps just shutting down any and all social interaction for risk of being offended or dealing with potentially being offended
Elia Schito
@elia
Jul 30 2015 18:22
@gabrielrios nvm found it
Gabriel Rios
@gabrielrios
Jul 30 2015 18:24
@elia :+1:
Forrest Chang
@fkchang
Jul 30 2015 18:28
@elia cool beans on the installer. About how much work was it to port?
The big drawback for crystal performance wise, is that we're in nearly the same boat as node was before npm took off, that we'd have to port all these gems
or the functional equivalent
ylluminate
@ylluminate
Jul 30 2015 18:38
so what i'm gathering, there's no pkg mgmt tool for crystal yet, right?
that is a pretty big negative and not considering somehow tying in gems in any fashion is a huge loss
it might be smart if someone were to take rubygems and extend it with a crystal validator that would check projects to see if they're usable in crystal. it could be a simply badge on rubygems.org and could help project owners who are interested to be aware of that
Elia Schito
@elia
Jul 30 2015 19:02
Given Crystal is 95% ruby syntax I don't think it's that easy to port entire gems, probably more difficult than porting to Opal as a bunch of semantics change as well
ylluminate
@ylluminate
Jul 30 2015 19:03
well, i guess i'm saying that it would make sense to have a way to test and then perhaps have a mechanism in place to make gems both std ruby and crystal compliant; perhaps having some .cr.diff files or something. brainstorming obviously.
Elia Schito
@elia
Jul 30 2015 19:04
Sure would be cool to use crystal instead of c for ruby extensions
@fkchang I think around 3hrs so far
Forrest Chang
@fkchang
Jul 30 2015 19:21
@ylluminate I haven't figured out the shards thing yet, but it seems that you setup the equivalent of a Gemfile with links right to repos (which I have to guess is in the shard format), and it will include those -- sort of a built in bundler. No central repository outside of github ATM, from what I can tell
Mitch VanDuyn
@catmando
Jul 30 2015 20:05
Folks - Anyway "reinitialize" opal? Am working on some server side rendering with RubyRacer, and want to avoid recreating the RubyRacer context if at all possible. This would require (I think) some how reinitializing Opal... any ideas?
Forrest Chang
@fkchang
Jul 30 2015 22:01
I think one think I like about asset pipeline in the app is that you get compile errors in the app. I think I should hope to understand that better, because I'd like to catch opal-rspec compile errors in the app, but what happens is that opal-rspec just doesn't run the spec that has compile errors, and you get fooled unless you watch the spec count. @elia have u or @adambeynon given thought to that?
Elia Schito
@elia
Jul 30 2015 22:03
@catmando that depends on what get's "dirty", anyway Opal it's enough similar to Ruby to make it quite difficult I think
@fkchang that's probably just related to the server running in a thread (or fork) and thus swalloing errors without feedback, try opening an issue for that
Rick Carlino
@RickCarlino
Jul 30 2015 22:25
Many opal gems call .untaint when adding themselves to the file path. Why is that?
Elia Schito
@elia
Jul 30 2015 22:26
Because some people used tainting features in their setup, like $SAFE = some number
Rick Carlino
@RickCarlino
Jul 30 2015 22:26
Ah
Forrest Chang
@fkchang
Jul 30 2015 22:44
@elia it happens when you hit spec page in the rails app too, I'm pretty certain. When I get a chance to verify, I'll write an issue. On a note, has any of that changed in opal-rails for 0.7 -> 0.8, maybe it's better, I haven't upgraded