Hacker News new | ask | show | jobs
by w01fe 4993 days ago
Sure! This particular way of expressing declarative structure may be specific to Clojure, but the basic ideas should be useful in any (especially dynamic) language with first-class functions.

The first idea is to take a complex system and express the set of components and their relationships declaratively, rather than procedurally. This is an old idea, and makes it possible to reason about the system, mock out components for testing, map over the components for monitoring, and more.

The second idea is simplicity. By making this declarative language as simple as possible, it becomes trivially easy to do all the things I just mentioned using the existing tools in the language, without needing to write complex library functions to support each use case.

For another example of a declarative system for composition you could look at 'react' in JS, which can be used in similar ways to Graph (and also supports things like async composition): https://github.com/jeffbski/react

2 comments

Thanks! That makes a lot of sense, and react looks like a really interesting project. I'll have to go back and reread the article with an eye for applying its ideas in Javascript / Coffeescript.
react looks interesting, although man, the stringly-typed bit sorta reinforces a lot of the Lisp quotes about being able to modify the language, etc. (Disclaimer: I've only just started studying Clojure in earnest over the last month or two. No zealot like a convert, eh?)