liquidcarrot / carrot

🥕 Evolutionary Neural Networks in JavaScript
https://liquidcarrot.io/carrot/
MIT License
293 stars 34 forks source link

Evaluate use of Clojurescript tooling for representing graph-like objects #176

Open GavinRay97 opened 4 years ago

GavinRay97 commented 4 years ago

Lisps are a very unique language. It is one of the only languages that is homoiconic, and this feature, combined with its S-Expressions and macro abilities let you do some pretty neat things with it.

Some data structures and tasks which would be fairly difficult to represent in other languages are trivial in Lisps.

Two tools seem like they could be helpful in this domain:


Ubergraph: https://github.com/Engelberg/ubergraph

Features

Ubergraph is a great choice for people who:

Features


Of the two, it seems like Fabric is much more comprehensive.

With Fabric, it should be possible to do multigraph/mix-cycle graphs arbitrarily, with async/parallel processing, automatic cycle/convergence detection, and easy dynamic network reconfiguration with reactive programming

postspectacular commented 4 years ago

Just to clarify: At this point in time, I cannot recommend using thi.ng/fabric anymore - it hurts to say it, but it's true. The project has been unmaintained for 3+ years now and much of the ideas and learnings have informed the newer, more powerful/flexible (and actively maintained) thi.ng/rstream packages (TypeScript), even though they're no direct replacement for some of Fabric's features, especially the semantic web/linked data oriented aspects. There's some ongoing development to bring back some of Fabric's triple/fact graph & SPARQL/Datalog inspired query DSL features, but this has been low priority thus far and somewhat of a slow-burner...

With rstream you can build similar dynamic dataflow graph structures (even cyclic ones), but the processing model is more flexible, e.g. via composable transducers and/or various high-level operators to split/merge/synchronize streams, add sidechain controls, fork-join w/ webworkers etc. Work on a visual node editor to construct/edit these graphs has started a while ago, currently paused, but will continue early next year.

Finally, whilst Fabric worked really well in Clojure (JVM), the lack of true multi-threading and the scalability issues of ClojureScript's core.async primitives turned out not be a great fit for using this project efficiently(!) in the browser - at least not with graphs consisting of 1000s of nodes (which is quite easily done)...

I hope this helps - please get in touch (maybe better via Discord) if you've got other questions...