These are chat archives for opal/opal

19th
Jul 2015
Forrest Chang
@fkchang
Jul 19 2015 04:13
on opal book and what not, I'd be willing to contribute. @elia asked if I wanted to blog on the opalrb blog, which I also am willing to do. I've been trying to document things on my blog, I do have a "wrapping javascript" blog in the works, those semi recent questions I've had are part of it. I think republishing a number of those, like how @elia's mikamai post was reposted on the opal blog, might be a good start. I also toy with writing an actual book, but it would be at my pace and the topics I want/need to fill in my knowledge, so that order might not be the best order for others, though I think my idea of encapsulating the various ways of getting started via something like my long dormant https://github.com/fkchang/opal-starter-kit would be handy, in that
  • it would be super easy i.e. ```gem install opal-starter-kit; osk new static_project myproject
  • actual running code that has to stay running, vs readme's which get out of sync
  • as part of the above, stays in sync w/the latest opal versions
    That said, I also think a lot of these crazy dev tool ideas I have might be a better time of my already limited time too. So I don't know.
@dancinglightning on lissio, I like it, I suppose I should take the job of documenting/promoting @meh 's stuff, coz I like his stuff. I'd sort of planned to do opal-browser and lissio tutorials at some point
@catmando I'm listening. I also realize one of my desires for web_require has to do with wanting to keep opal-playground a static app. If I made it a server backed app, then I could do things differently. Since heroku stopped letting you have a 24/7 available free dyno, switching from static app came off the books for me
Forrest Chang
@fkchang
Jul 19 2015 04:50
@jaredcwhite opalist submission ahead of schedule, maybe enough time for another one...
Forrest Chang
@fkchang
Jul 19 2015 05:04
I might give @RickCarlino a run for his money this week
Bozhidar Batsov
@bbatsov
Jul 19 2015 05:35
hey everyone
I was wondering is there any particular reason why opal is not using Google’s Closure to simplify the code generation and stdlib implementation?
ClojureScript is sitting on top of Closure and its devs credit it a lot for cljs’s success
Torsten Rüger
@rubydesign
Jul 19 2015 06:04
@fkchang a blog is good. I find i complements a book, a book is the always up to date reference while the blog gives the changes.
And i think that leads to my only issue i have with gitbook. They are not very integrated into the site. Opal site looks nice and blog/book should fit under it. what do you think @vais . Also, it makes reviews easier as one can just not publish until reviewed. With gitbooks one would have to do branches and then the editing becomes a pain.
Vais Salikhov
@vais
Jul 19 2015 06:28
@dancinglightning I kinda like how it works on the Volt site http://voltframework.com/docs, looks pretty integrated to me, IDK :confused: IANAD (I Am Not A Designer) :wink: The website is managed in git right now, so editing would not be different unless I'm missing something - I don't have much experience with this.
Torsten Rüger
@rubydesign
Jul 19 2015 06:29
@vais gitbooks pubish automatically when you push to them
and by integrated i mean that the site’s menu isn’t there (or it’s look’n feel)
Vais Salikhov
@vais
Jul 19 2015 06:31
@bbatsov maybe @adambeynon can answer that one - the origins of Opal and the initial decisions are shrouded in mystery to me. There are alternative ways to parse Ruby as well, and @meah and @elia could explain the current status quo better than me.
Torsten Rüger
@rubydesign
Jul 19 2015 06:31
if you look at my site you see what i mean: the news/blog http://salama-vm.org/2015/07/01/hello-world-again.html is part of the site. But the book (click “the book”) is not
@vais current site is done with middleman, which allows for local viewing. Also makes for a more gradual transition
Vais Salikhov
@vais
Jul 19 2015 06:33
@dancinglightning I see what you mean. I guess Volt works around this by loading it in a frame. I think we've got bigger fish to fry in terms of content, which can then be re-purposed in a variety of ways. Very nice site, BTW!
Torsten Rüger
@rubydesign
Jul 19 2015 06:38
@vais thanks.yes volt uses an iframe. never noticed that. but you’re right it’s about content not tech.
Bozhidar Batsov
@bbatsov
Jul 19 2015 07:09
@vais Yeah, I was surprised you weren’t using the parser gem to parse the Ruby code
so, the same approach can definitely be applied to generate JS as well
but I’m guessing the project was started before parser rose to prominence
there’s already one gem unparser that generates Ruby code from the AST
Forrest Chang
@fkchang
Jul 19 2015 09:45
@bbatsov I was definitely thinking opal could use at least a closure post processor - at least pruning out unused code, etc. -- that being said, I only know about that stuff in name, and not in detail
Bozhidar Batsov
@bbatsov
Jul 19 2015 11:10
well, I'm not an expert either
but I know it's easier to implement certain things in terms of Closure's API
which very extensive, robust and highly optimized
and that their dead code elimination works really well
Vais Salikhov
@vais
Jul 19 2015 11:37
@bbatsov also, keep in mind that parsing and compilation currently work not only in Ruby, but also in Opal itself (e.g. TryOpal). This may or may not have been a factor in the decision regarding how parser/compiler currently works.
Mitch VanDuyn
@catmando
Jul 19 2015 12:55
@fkchang. Re gem service. The gem service would be a stand alone service. Opal playground would be a client and remain a static app! The opal gem service would be a be a "smart cdn" that cached compiled opal files that were extract ed from gems
AstonJ
@AstonJ
Jul 19 2015 14:10
Hi @vais and everyone talking about Opal docs/the book (sorry for the delay in commenting, I don’t use Gitter much these days so only see @’s when I fire it up). Yeah, I think docs, on whatever platform you choose is a great step forward. I would recommend to go with whatever is easiest for now though (Elixir uses Jekyll for their docs) though obviously the benefits of gitbook is it can create .mobi’s, .pdfs etc.

Here are some suggestions on what I think docs need to cover:

  • Introduction (what is Opal? What can you do with it? What can't you do with it? Why should you use it? etc) (page)
  • Setting up Opal (page)
  • Setting up Opal in a project (such as in Rails, in Sinatra, and other popular f/works) (page or two)
  • The basics of Opal (chapter)
  • Using Opal to do things that you'd usually use JS for - basics (such as https://pragmaticstudio.com/tutorials/rails-jquery-ajax and https://gorails.com/episodes/jquery-ujs-and-ajax) (chapter)
  • Using Opal to do things that you'd usually use JS for - advanced (using frameworks or creating frameworks etc) (chapter)
  • Then move on to other more complex stuff (chapter)
  • Troubleshooting / debugging etc (chapter)

Btw guys, you really should consider using the Opal strategies room on MetaRuby - this chat is going to fade within a few days, then a few weeks later we’ll be having the same discussion - how many times have we discussed docs this year alone?
AstonJ
@AstonJ
Jul 19 2015 14:19
Ok have posted a thread here in case you want to use it: http://metaruby.com/t/documentation-suggestions-for-opal/261/1
Vais Salikhov
@vais
Jul 19 2015 14:22
@AstonJ I see @elia has already created a docs repo under the Opal organization. Do you think suggestions should be sent as issues there? https://github.com/opal/docs/issues
AstonJ
@AstonJ
Jul 19 2015 14:30
Ok done opal/docs#1 :) I would suggest whatever platform you think will make discussing it easier and prove more productive - there are pros and cons of each platform (personally I prefer forums as they are better quipped to faciiliate discussion with the tools they offer.)
Vais Salikhov
@vais
Jul 19 2015 14:43
Cool, thanks, @AstonJ
Mitch VanDuyn
@catmando
Jul 19 2015 14:57
@dancinglightning posted a private chat to you (just because its not of general interest I think - don't know if you get notifications for such.)
Forrest Chang
@fkchang
Jul 19 2015 17:12
@bbatsov so do you have an idea of what might be a good 1st step to take wrt Closure? I think some low hanging fruit might be worth someone's time.
Bozhidar Batsov
@bbatsov
Jul 19 2015 17:20
probably the easiest thing to do would be implementing some missing corelib/stdlib functionality in terms of Closure
but of course, this has to be synced with the core team
as they might be against using it
this is a nice article on the topic, btw https://github.com/clojure/clojurescript/wiki/Google-Closure
Vais Salikhov
@vais
Jul 19 2015 17:37
Then: "By installing Java, you will be able to experience the power of Java"
Now: "ClojureScript is written in Clojure and ClojureScript interoperating with the Google Closure"
:+1:
Bozhidar Batsov
@bbatsov
Jul 19 2015 18:19
I’m hoping one day Opal will be as successful
these days it seems more people are picking up ClojureScript, than Clojure
and this speaks volumes
Vais Salikhov
@vais
Jul 19 2015 18:24
@bbatsov I didn't know you could put ads in GitHub projects https://github.com/clojure/clojurescript#yourkit :worried: I guess it comes with all the success...
meh.
@meh
Jul 19 2015 18:25
vais, we had something similar for BrowserStack
but then it stopped working and I couldn't be bothered to look into it
someone should revive that crap
and make it work on opal too instead of just on opal-browser
Vais Salikhov
@vais
Jul 19 2015 18:29
@meh so you mean that's not an ad? I don't see any connection between YourKit and anything else on that page, looks like a totally random promotion thing. Anyway, :+1: for BrowserStack or something like it...
meh.
@meh
Jul 19 2015 18:30
vais, BrowserStakc and YourKit are paid services, and they cost a ton
but they give it a free license to open source project
as long as you put you're using them somewhere visibile in your project
Vais Salikhov
@vais
Jul 19 2015 18:30
Right on, I see now
Torsten Rüger
@rubydesign
Jul 19 2015 18:31
@meh did you see the lissio issues ?
meh.
@meh
Jul 19 2015 18:32
dancinglightning, yes, I still have to tackle them, Italy's temperature is giving me a hard time
dancinglightning, do remind me every now and then because my memory sucks as well
especially when I'm losing neurons through sweat
Torsten Rüger
@rubydesign
Jul 19 2015 18:32
meh, don’t you get an email per issue ?
meh.
@meh
Jul 19 2015 18:33
dancinglightning, yeah, but I mark them as read since I get a bazillion of them :P
I read the issue, then forget about it
Vais Salikhov
@vais
Jul 19 2015 18:34
@meh yeah, that's like a "feature" of GitHub - there's no way to mark something as unread. I guess it's to discourage procrastination??
Torsten Rüger
@rubydesign
Jul 19 2015 18:34
@meh i really don’t want to be a nag. So if it’s not on your that is fine by me
on your list that is
meh.
@meh
Jul 19 2015 18:35
dancinglightning, don't worry, it wouldn't be a nag, it's just I follow/contribute/have a billion projects and I often forget about things :P
then I realize I have opened issues that were months old and I feel bad about replying after so long, so I forget again about them ◕ ◡ ◔
Torsten Rüger
@rubydesign
Jul 19 2015 18:36
meh, that for me means it’s not on the list. Which is fine.
meh.
@meh
Jul 19 2015 18:37
maybe that's the problem, I don't have a list, I just do things as I remember them, and if I get distracted I forget about everything else :P
Elia Schito
@elia
Jul 19 2015 21:55

@fkchang I'm more than eager to create a docs team on the opal org :)
wrt blog posts I think we should make good use of the list of links that @astonj gathered there on metaruby and repost it on opalrb.org

@bbatsov re parser gem

I think the parser gem started in march 2013, I discovered opal around 2011, but I think the first commit (2011) was already part of a rewrite.
We talked about migrating to the parser gem, and the roadmap was to

  1. make out parser output the same AST format as the parser gem
  2. switch to the parser gem

Unfortunately that's not going to happen unless @adambeynon get enough free time or someone else with enough time and compilers skill comes along

@catmando :+1: for the gem service!

Elia Schito
@elia
Jul 19 2015 22:04
Also re closure optimization I don't think Opal/Ruby are suitable for the kind of restrictions one must conform to: https://developers.google.com/closure/compiler/docs/limitations?csw=1
meh.
@meh
Jul 19 2015 22:06
yeah, Opal/Ruby are impossible for that
ClojureScript is lucky
Elia Schito
@elia
Jul 19 2015 22:07
@meh what can I do to fix opal-browser?
meh.
@meh
Jul 19 2015 22:07
elia, what's broken?
elia, you mean travis?
Elia Schito
@elia
Jul 19 2015 22:08
dunno, lol, I kinda saw there's something I can/should help with
meh.
@meh
Jul 19 2015 22:08
elia, it's lissio
Elia Schito
@elia
Jul 19 2015 22:08
ohisee
meh.
@meh
Jul 19 2015 22:08
I need the Lissio::Server and Lissio::Builder to get updated to the new sprockets business
but I have no clue how
Elia Schito
@elia
Jul 19 2015 22:10
k
@meh any reason to have the Gemfile.lock in the repo?
Elia Schito
@elia
Jul 19 2015 22:31
@meh meh/lissio#12
specs not passing tho
meh.
@meh
Jul 19 2015 23:00
elia, now I'm getting that I have a too recent phantomjs ◕ ◡ ◔
Elia Schito
@elia
Jul 19 2015 23:01
yeah, we're stuck with the 1.9.8 api
@meh looking through lissio/server code, I think you can use Opal::Server as is, possibly adding a middleware for static stuff
and a hook point for extension
meh.
@meh
Jul 19 2015 23:03
elia, I'm fine for using Opal::Server as long as every unexisting path still returns the index
Elia Schito
@elia
Jul 19 2015 23:04
ok, I think something can be hacked with rack without copypasting the whole server
*opal/server code
Probably a rack/cascade with [opal/server, opal/server/index] (pseudocode)
would do the trick
@meh saw the failing specs for TrueClass#true?, where does that come from? (just checked mri and it's not there)
meh.
@meh
Jul 19 2015 23:08
elia, in lissio?
not yet, still compiling phantom 1.8
Elia Schito
@elia
Jul 19 2015 23:08
yep
meh.
@meh
Jul 19 2015 23:08
it could take a while
this laptop is 7 years old
actually
I'm retarded
forgot there's a downgrade tool
Elia Schito
@elia
Jul 19 2015 23:10
I'm retarded too, they're just some old rspec syntax: be_true vs. be_truthy
meh.
@meh
Jul 19 2015 23:11
we're all retarded ◕ ◡ ◔
and a bunch of other failures, and a ton of warnings about dynamic requires
Elia Schito
@elia
Jul 19 2015 23:13
3 failures here, and the dyn requires would get away if we implemented per file compiler flags
meh.
@meh
Jul 19 2015 23:19
I'm getting 7 here
all in the router
elia, remove the Gemfile.lock if you feel like it, and add to gitignore
so we don't trample on eachothers
fixing the server, then I'll handle the lock and I'm done :)
meh.
@meh
Jul 19 2015 23:22
thanks
Elia Schito
@elia
Jul 19 2015 23:33
@meh done, I left a small thing to fix tho, which is support for static files, should be fairly easy to add anyway
meh.
@meh
Jul 19 2015 23:33
cool
Elia Schito
@elia
Jul 19 2015 23:34
VCL is the best paradimg
@meh oh, also was prerender working? b/c I think I just removed that as it seemed a noop
meh.
@meh
Jul 19 2015 23:37
it was a placeholder
Elia Schito
@elia
Jul 19 2015 23:38
ok, then consider the PR some example code 🌚
:D