These are chat archives for opal/opal

11th
Oct 2017
Mitch VanDuyn
@catmando
Oct 11 2017 20:37
@/all dumb question. Does the opal compiler on the server (i.e. running as part of sprockets) run regular MRB ruby or is it running inside of a JS engine?
Forrest Chang
@fkchang
Oct 11 2017 20:53
whatever the server ruby is, MRI or Jruby
Mitch VanDuyn
@catmando
Oct 11 2017 21:01
okay... but just to be clear its not making the compilation be done inside of some JS engine right? We are trying to understand why it take sprockets 6 seconds to recompile just a few .rb files...
Forrest Chang
@fkchang
Oct 11 2017 22:08
I suspect that's more of an @elia question, though I'd guess Adam did most of that, opal compiler doesn't need JS to transpile opal to JS, not certain what the execjs requirement is for opal-rails, looking at the gemspec, I notice 2 things, 1) it's a development dependency so it's not required for deploy 2), most of the other development dependencies are to support testing, which require JS
Elia Schito
@elia
Oct 11 2017 22:20
@catmando the first thing you need to che is if the sprockets cache is working properly. Apart from that I guess could just be that Ruby is slow at this kind of code (compiling). On master the slowest part is the lexer, never checked for 0.10 but could easily be something similar.
Also if you happen to find the bottleneck and it is in fact optimizable I’m willing to do what I can to help as I see slow compilations at my workplace too
Forrest Chang
@fkchang
Oct 11 2017 22:47
wonder if we could port the compiler to crystal?
Elia Schito
@elia
Oct 11 2017 22:52
I was reading just yesterday an interesting pr with the parser (gem) reimplemented in c, it wasn’t merged but something like that despite the difficulty, would be very useful