-
Notifications
You must be signed in to change notification settings - Fork 27
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
Please export public API for javascript interop #43
Comments
Hi! Heads-up: I'm hesitant to expose an API if it implies that the software is likely to be in any way stable or has any particular guarantees about its behaviour (hence v0.0.x). The whole thing is an experimental research piece. If you're doing this to experiment, that's fine, as long as you're aware of this context. How many functions need to be exposed to js will depend on how deeply you want to play with things. If you want to run a basic HTM model and pull out predictions you could get away with just core/regions-in-series, whatever encoders you need, p/htm-step, and core/predictions. If you want to do anomaly detection you would also want core/column-state-freqs and core/region-seq. Happy to help with writing these wrappers. It will be a good excuse to finally spec the functions (with |
Hi Felix, Sounds great! Let's do it! Yeah, I couldn't really find good usage docs. Don't fuss over it not being "production ready". By the time any Open Source project reaches that stage it is often "obsolete" :P Software is fluid, we devs like to play... I think this is a great project with potential and would like to integrate it with some of my JS projects, currently using Aurelia (similar to Angular) with TypeScript. I tried my luck with ClojureScript before but found the learning curve pretty steep (also lack of good docs). I exported the entry points that seemed reasonable to Here is a good run down on how to do it: http://www.spacjer.com/blog/2014/09/12/clojurescript-javascript-interop/ If you could just describe the expected parameters and return values (Types) then we could do it for sure! Like what is a
So essentially the JS calls with an object and we then have to convert these to the records implementing the protocols, right? |
An htm object is pretty complex -- you can see a dump of one at https://github.com/htm-community/comportex/wiki/A-sample-workflow-with-the-REPL -- probably best to treat it as a black box from the js side. |
I'm continuing your work on a js API here: Still need functions to retrieve the active and predicted cells. |
btw It's not quite as simple as wholesale converting everything with |
Good job :) Looking at it now. Please add instructions on how to run the JS demo in
Then load up the Also please update the |
I made a commit with the things I found missing here: |
Thanks, that's useful. I incorporated those changes and merged into master. |
I started exposing a JS public API here:
kristianmandrup@275ecd7
From the Readme "The main API is in the namespaces core, protocols and encoders"
But the link to the blog post supposed to explain them is a dead link :(
Please help out! Thanks :)
I mainly need some help using
clj->js
andjs->clj
for correct interop.The text was updated successfully, but these errors were encountered: