What does HackerNews think of javelin?

Spreadsheet-like dataflow programming in ClojureScript.

Language: Clojure

I asked around and there is another option. Something called "Incremental Computations". Here is a Clojure library. I think the examples kinda demo how it works

https://github.com/hoplon/javelin

It's sort of a version of option 3

There are some languages that do this, especially reactive languages and there are some libraries for other languages that work kinda like this, for example Rx[1] works kinda like this or maybe Clojure's Javelin[2]. You could make an Rx-like system that works somewhat like that in C++, or you could use coroutines or a task-based system like Intel TBB to implement something kinda like this. It of course wouldn't be a first-class thing like in Concurnas, but I reckon you could implement the basic idea.

As far as languages go, the ideas you showed look similar to how Esterel[3] works, or perhaps Occam[4].

[1] http://reactivex.io/

[2] https://github.com/hoplon/javelin

[3] https://en.wikipedia.org/wiki/Esterel

[4] https://en.wikipedia.org/wiki/Occam_(programming_language)

Spreadsheet-like dataflow programming actually works quite naturally in FP. See re-frame and javelin as examples:

https://github.com/Day8/re-frame

https://github.com/hoplon/javelin

> Glitches as demonstrated via the diamond pattern can be avoided by traversing the graph in topological order.

This is correct for DAGs which only propagate value (as in Javelin[1] and my own library DerivableJS[2]), but for graphs which propagate events (as in Rx), topological sorting would only work for those parts of the graph which are effectively propagating value. Events don't have an inherent dedupe operation, so it is very difficult to even imagine ways in which glitch avoidance could be automatically enforced. It would certainly require semantic program analysis.

Personally I think we should be avoiding the proliferation of events (as encouraged by Rx enthusiasts) for exactly this reason. Their imperative nature makes them very difficult to reason about.

[1]: https://github.com/hoplon/javelin

[2]: https://github.com/ds300/derivablejs

They aren't a problem if the operations at the leaves of the graph are idempotent, which is usually the case if these operations are UI repaints.

If the operations are for other effects - such as Ajax calls - then glitch elimination is handy. Eliminating glitches at the dataflow level prevents debounce logic from leaking out to the code performing the effects, preserving the clarity and generality of that code.

I find glitch elimination most useful when the dataflow graph is value-propagated, vs. event-propagated, as it is in the dataflow library I helped implement, Javelin - https://github.com/hoplon/javelin/

Javelin also supports transactional input, another feature that's helpful when building dataflow graphs on which effects other than UI-repaint are hung.

* figwheel -> https://github.com/adzerk-oss/boot-reload It's not as smart as figwheel because u can lose state, but it's mostly enough. We are actually quite fine with reloading the page manually most of the time.

* uberjar: If you use http://boot-clj.com/ instead of lein, you won't have issues with left-over files, because boot allows every build step to create a unique temp dir which gets erased on next run. Content amongst these temp dirs can be shared by a git-like object store and build tasks pass a virtual immutable file-system (called a fileset) between each other.

* templating: http://hoplon.io/ Your page is not a big data structure. It's an actual Clojure program, which generates DOM Elements directly. You can even call DOM Elements as functions to alter their attributes or their DOM children. Combined with https://github.com/hoplon/javelin you get reactivity in an unobtrusive way. You can separate you app state with it, just like you put data into a spreadsheet and wire up a chart to it which will update automatically. Your DOM is the equivalent of that chart in this case.

* cljs repl -> https://github.com/adzerk-oss/boot-cljs-repl but in practice it was hardly ever used by boot/hoplon people, so it's a bit neglected now.

* server-client state sharing: Hoplon + Javelin + https://github.com/hoplon/castra It's a bit under-documented... probably because it's so super simple... :) Castra does a remote function call via XHR and puts the result into a Javelin cell. If that cell is wired up to a DOM element (attribute or content), either directly or transformed by a formula cell, then your DOM updates automatically once the XHR call finishes. Errors are placed into an error cell, which can also be wired to the DOM...

* Falcor / GraphQL ... I have NOT done this yet but I'm planning to "just" pass Datomic queries via Castra to the backend and that's it. I can't "subscribe to live query" this way, but that's good enough for us. It's also just 1 HTTP end-point. No more RESTful rigidity... ;)

* Vim/REPL: We are just fine with the good old `(print)` and `(serve {:reload true})` from https://github.com/pandeiro/boot-http on the backend. Also we just use Sublime Text with paredit and lispindent. It's super fast even on 4-5 year old machines...

* Chestnut template / plugin: With boot this problem set shrinks to a size where distinction between template and plugin vanishes. You can create a .jar which defines a boot task. That task either creates a template project or defines a build step which u can intermix with other build steps using plain-vanilla function composition. Your environments are also just tasks combining specific build steps with specific options. Nothing custom or magical.

* Om: Again: Try Hoplon. Fraction of the complexity.

* CLJSJS: Your worries regarding extern files and maintenance are not a problem in practice really. We are maintaining a Semantic UI package https://github.com/exicon/hoplon-semantic-ui and just the other day I whipped up externs files for Google Analytics (3 lines), HubSpot (5 lines), Inspectlet (6 lines). See https://github.com/exicon/homepage/tree/master/src

Disclaimer:

I've started using Clojure ~10month ago.

Never really used Lein but experienced all of its pains via Grunt and Gulp I suspect...

Trained ~8 people to work with Boot & Hoplon during these months by pair programming with them. We don't really miss anything else, though we looked into Emacs, Vim, IntelliJ, LightTable.

There are some rough edges and missing documentation, but http://hoplon.discoursehosting.net/ and the #hoplon & #boot channels on http://clojurians.net/ Slack and freenode IRC https://botbot.me/freenode/hoplon/ were more than sufficient.