Coder Social home page Coder Social logo

Comments (11)

ubolonton avatar ubolonton commented on June 26, 2024

I think CSP can be used, but we need to first transform the json blob and its changes to a series of events somehow.

If I understand correctly, there can be 2 approaches to this, if we use CSP:

  • One single process with a big data structure representing the whole thing.
  • One process for the top line, one process for each track.

from js-csp.

zoomclub avatar zoomclub commented on June 26, 2024

My json blob is in the format the score structure and the BaaS it is hosted by requires it to be in. Essentially, the tracks are already a series of events (the spans). The number of tracks is dynamic so the CSP functions processes would also need to be dynamic. It seems that CSP is suitable for things like processing pointer events and network events, not entirely sure it extends to other use cases yet.

from js-csp.

zoomclub avatar zoomclub commented on June 26, 2024

I've always thought of my tracks as streams, as a musician and an engineer, there is no conflict there. The spans in the tracks (outer streams) have specific attribute types that represent further inner streams as well. Absolutely then, I already see everything as streams of data. Yet, I am only use to thinking about iterating through the tracks of JSON span data with classic loop constructs and not something fairly unknown like CSP.

So, my structure is one that is very suitable for applying FRP or RP to because it is a sequence of spans/events. Further more, the structure is actual expressing musical time via its attributes. Still, the musical structure is not one of those typical scenarios where the events are coming in off the internet or a pointer device, which is what all examples of RP and CSP as well always assume.

I'd like to learn how to turn my tracks and inner attributes into streams, not yet sure how? Then process them with RP/CSP operations, because that is the perfect kind of clean approach my structure is suited for. Problem is that CSP seems to be an enhanced version of RP but also more difficult that RP to apply to my structure so far.

None the less, I will stop thinking out loud and just link in some sites that explain their purpose quite well and are enlightening me a little more. They are about RP but its not all tied together with JS-CSP for me yet, still working at grounding the light so to speak :)

https://gist.github.com/staltz/868e7e9bc2a7b8c1f754
https://github.com/kriskowal/gtor

It would be great to read a future in depth article about JS-CSP and how it relates to FP and creates/handles different types of stream sources. Love this picture!

687474703a2f2f692e696d6775722e636f6d2f4149696d5138432e6a7067

from js-csp.

zoomclub avatar zoomclub commented on June 26, 2024

@ubolonton,

I've been discovering a few more things that are likely leading to a solution. My BaaS is Firebase so documents in Firebase need to be turned into streams. In the process of learning I have come across the following article where RXJS is used instead of JS-CSP:

http://blog.cryptoguru.com/2014/11/frp-using-rxjs-and-firebase.html

I'm new to JS-CSP and RXJS and there is much to know and do. Without losing focus it would be super if the much more knowledgeable JS-CSP core team might find the time to make a JS-CSP version of the demo in the article above. I think this would be a breakthrough and open yet more doors for JS-CSP.

from js-csp.

jlongster avatar jlongster commented on June 26, 2024

There is much to come :) We plan on doing a lot more demos/detc and improve marketing of the project. It will happen over the next few months.

from js-csp.

zoomclub avatar zoomclub commented on June 26, 2024

Rockin! Can we have a roadmap of what is coming, how can we help? Months is a very long time, how about a firedance with firebase sooner? Looking forward to your session at the React Conference :)

from js-csp.

jlongster avatar jlongster commented on June 26, 2024

It shouldn't really be months, but I never know when work is going to take up all my time. I've been busy the last month, but after the conference it'll definitely be my top priority to contribute here again. The first thing we should do is make a roadmap for sure. One of the problems is that we're not entirely sure (at least I'm not) what it looks like down the road. As this is new territory, we are still researching stuff and taking it slow to figure out what we should do.

I think soon we can finalize stuff like error handling and have a really good base though.

from js-csp.

zoomclub avatar zoomclub commented on June 26, 2024

Sounds real good! One more demo we know of now is turning firebase data into streams, so that as data is edited via firebase ops JS-CSP processors can observe given sections of data, break it into steams and process it six ways from sunday.

The processors could be auto called from firebase.on or engaged by use of some user tool. Just it should be done with a clean connection to firebase not via flux and all that jazz. I mean firebase is already immutable data and it is possible to define as many refs (cursors) as you might like. For this type of reactive processing it is best to stay as close to the metal as possible.

from js-csp.

ubolonton avatar ubolonton commented on June 26, 2024

@zoomclub I tried converting Firebase example (Firefox only):
https://gist.github.com/ubolonton/71d3cb081328dad1d41c

from js-csp.

zoomclub avatar zoomclub commented on June 26, 2024

@ubolonton Thanks for this sample, its great to have a start with JS-CSP and Firebase! Was there a project for this sample or only the gist? No sure how to resolve the following script path:

../../build/csp.bundled.browser.js

from js-csp.

ubolonton avatar ubolonton commented on June 26, 2024

@zoomclub I added it to https://github.com/ubolonton/js-csp/tree/master/examples#user-content-web

from js-csp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.