Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose core.async through mori? #170

Closed
Chris-Andrews opened this issue Jul 30, 2015 · 2 comments
Closed

Expose core.async through mori? #170

Chris-Andrews opened this issue Jul 30, 2015 · 2 comments

Comments

@Chris-Andrews
Copy link

I'm interested in trying to use core.async from javascript. I know that js-csp exists and is great, but, in the same way that mori leverages real world usage and benchmarking through ClojureScript, using the actual core.async implementation offers the same benefits.

Would adding core.async functionality be desirable, or is it beyond the intended scope of mori? I can see an argument for keeping mori focused on immutable data structures (although it does include transducers and some extras now). If mori should remain focused on immutable data structures, would it be desirable to expose core.async via another "extras" type submodule, or create its own separate project?

I tried to mess with this a bit, but the ClojureScript build process is a bit foreign to me, and I noticed from #155 that there may be some issues with the build script right now. I tried the build approach from #155 and then testing using the mori/support files, but that wasn't working for me. I think I can work around this to try building and testing, but before I proceed any further I wanted to ask:

  1. Are there any special considerations that would make exposing core.async to javascript difficult? (my impression is no, since core.async obviously runs in javascript)
  2. Is there any interest in adding this to the mori extras, or in having it as a standalone library?
  3. Is there a recommended method for building and testing this?

Thanks!

@jcouyang
Copy link

jcouyang commented Aug 5, 2015

I'm looking for core.async port as well. so I have fork mori for experimental work for CSP https://github.com/jcouyang/conjs if you like to use core.async, I think it already works, you can find the test as good example https://github.com/jcouyang/conjs/blob/master/spec/mori-spec.js#L192
but only in form of callback,

async.take$(c ,function(x){
        expect(x).toBe('something in channel')
        done()
      })
      async.put$(c, 'something in channel')

so I also made some macros around it to achieve go style CSP here https://github.com/jcouyang/ru

go {
      var a <! channel1;
      var b <! channel2;
      ...
}

anyway core.async works pretty much in my fork, if @swannodette like it, i'm very happy to send a Pull Request back in mori.

@Chris-Andrews
Copy link
Author

I may have been mistaken in believing this is really possible. While core.async is obviously usable in a javascript environment, the use of macros probably means the compilation step is required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants