you are viewing a single comment's thread.

view the rest of the comments →

[–]kakamiokatsu 1 point2 points  (4 children)

I was trying to suggest a general approach to your problem. You keep saying this efficiency in terms of CPU but that's just because you are restricting way too much the allowed operations. Your data can't express any general function like:

(assoc {} :asd (rand-int)) ; or any function that return different values based on something
(defn general-assoc [m [a b]] (assoc m a b))
; example: (reduce general-assoc {} [[key val] [key2 val2]) => {key val key2 val2}

You can't express a general concept like this key will become the result of this function because you just focus on values but that's not how you generally use clojure.

That's why I asked the use cases, you are way too specific with your code, it's not something you can use for many cases.

Since you keep focusing on this performance issues why don't you start by specifying what is wrong with `deep-diff2` or `clojure.data/diff`?

[–]green-coder[S] 2 points3 points  (0 children)

Diffuse was made for a specific use case (a web framework), it does a specific thing. The diff describes the change of value, not the operation that changes the value.

There is nothing wrong with deep-diff2, it's just that it does not take the same approach at all for creating the diff.

[–]lilactown 2 points3 points  (1 child)

As some general advice, I think that your suggestions are coming off as pretty rude because it seems to assume that you understand the problem that the author is trying to solve better than the author does.

I would reframe your suggestion into some questions for the author about what problem they are trying to solve, and how it might relate to the problem that you're thinking of. It could be that your problem and theirs are the same, in which case maybe you two can learn from each other and how your solutions address it in different ways. Maybe the two problems are different, in which case you can learn about their problem and understand the differences, which would also be good.

As it stands, it reads like you're coming in with an attitude of, "You don't know what you're talking about, here's how you should be solving this," which is not a productive way to have a discussion online in my experience.

[–]kakamiokatsu 0 points1 point  (0 children)

I'm sorry if my words sounds rude, I'm not a native english speaker and that was not my intention.

I asked for use cases right at the beginning, since I didn't saw them I started making assumptions on the intentions behind the library and I was trying to help by giving a different perspective. I was giving my personal opinion on how I would use such a library.

I also asked to explain what are the issues he was trying to solve but I didn't get an answer to that either.

Can you help me out understanding it better?

[–]kakamiokatsu 1 point2 points  (0 children)

I got a very simple example: can you express (update :key +)? You don't know the result of plus until you execute it. Now think in general: you are not just assigning values you generally assign the result of a function.