Hi!

I have some suggestions about transients (btw. the http://clojure.org/transients
is not linked from http://clojure.org).

Maybe before you give up reading the whole post I will post as first
the digression:
vars binding and transient are similar, however in the first case we
have thread isolation on reading and writing with reference covering/
hiding ability. Currently operations on transients structures seems to
be badly interfaced in Clojure and below is a deal:


Why do we have to deal with conj! and rest of foo! operations, when
there are much more functions like update-in, assoc-in etc. what about
them? In most my code I fail to use transient because of xyz-in
operations. More over I know that the code is whole executed by one
thread, since I know where the transient structure starts to exist and
when it ends. Tracking such code is easy task to do since most fast
compuations are free of side effects and thread intercommunication.

If the whole talk is about thread isolation (which is great feature),
then the interface should be simplified, in the way like - (transient
x) - attaches thread (which calls transient) reference to my structure
(object), when any other thread tries to modify x then the exception
is thrown. When I do (persistent x), the thread reference is detached
from the structure, so it becomes persistent and others threads can
concurrently modify it.

This would eleminate duplication of functions and allow for single
threaded computations. This would satisfy most computations related
with reduce operation and recurention. So easy to do, so easy to
track, yet not in Clojure ;-(. The (transient x) and (persistent x)
are required since the are explicit declaration of single thread
mutation.

Also it would be nice if such transient structures could be used in
binding clasues, since I have found other adoption - for example
thread is doing computations in a functional way - and with binded
transients I'm gathering statistics (time measurement, bytes counting
etc. in an imperative, side effecting, more like aspect way.)

What are your thoughts?

Thanks,

BTW. What does it mean "don't bash in place" - since for not all
people English is not a native language I suggest to use simpler words
in such formulations.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to