And to answer the question about quick_sample vs sample, it has to do with resource management.
When your Lwd graph manipulates potentially expensive external resources (sockets, database connections, GPU buffers, …), you can provide hooks to be called when a resource is acquired (bound to a graph) and released (no longer reachable).
Contrary to the GC, Lwd resource management is predictable: a resource is released at the first sample where it is unreachable (using a reference counting scheme).
quick_sample is the simplest way to manage resources: it samples the graph and releases all resources immediately.
sample is a lower-level API that can be used to separate sampling from resource release. It is less relevant in a web environment where everything is managed by the javascript GC, but in native code it is convenient to efficiently interface with other runtimes (GTK widgets, OpenGL buffers, etc).