Fork me on GitHub

is there any interest in the community to port clojure to webassembly? I know clojure is deeply tied to java ecosystem but being able to write clojure could that compiles to wasm can drive a lot growth and opportunities for both clojure and wasm for now, rust is the go to wasm supported language and that will probably remain forever c# is coming up as the 2nd good language with blazor - the huge push from Microsoft golang will probably end up next; if Clojure can try, it could take that space! people can mention clojurescript but that will miss the whole point!!


Does webassembly support garbage collection? I think there are proposals for it but I'm not sure if it's implemented


yeah.. not sure but the area seems active


(the former initially asks about cljs/wasm interop but some of the responses speak to the more general issue of transpilation to wasm)


The main benefits to Clojure/Script (and ClojureCLR) is that they bring with them access to vast, established ecosystems of libraries — I’m not sure how much of that you’d end up sacrificing to target WASM?


Seems like (the lack of) multithreading and GC in WASM would be big obstacles to porting Clojure to it. Also “A June 2019 study from the Technische Universität Braunschweig analyzed the usage of WebAssembly in the Alexa top 1 million websites and found the prevalent use was for malicious crypto mining, and that malware accounted for more than half of the WebAssembly-using websites studied.” 👀 — from


Any good tech is always used first by criminals, this is just expected at this point. Especially if it's low cost, low risk, high potential value. If anything, that quote from the wiki is a statement about how bad the browser is that it allows installation of such software without any real help to the average person using a browser to analyse what is installed and deal with it. Of course, such tools would first have to be developed not for the browser but for the OS, and there are lots on the market, but I am not sure I can trust them to such high degree as it would be necessary here.


If you are seeing 'targeting wasm' as a sacrifice and most of what wasm is about crypto and the security problems that are associated with it, I have to take that, this topic has don't have much relevance here


I thought it was mostly an interesting note about the tech -- I haven't really looked at WASM so @UJMU98QDC’s made me curious and the links above were just the first few things that I turned up, mostly relating to suitability for Clojure. I was genuinely surprised to see that statement on the wiki! 😐


Hi everyone, maybe stupid question, but is there any way to force certain namespace to reload each time when using My case is: I have a edn file and I'd like that any changes in this file to force reload in namespace which reads this file.


with pure you can use refresh-all. But this function will unload and load back everything tracked so far.


You can try to use some library to manage dependencies (like integrant) to achieve what you want. But this will affect for sure your project structure


@fmnoise I am not using tools.namespace refresh stuff, but you can force a reload using the :reload option in require


If i have a string such as "alias/keyword" how can i create a keyword with the namespace of the alias?


you can use the ns-whatever functions to resolve aliases


look it up in the map returned from ns-aliases etc

👍 3

Hi I’m trying to create a function that does the following: input: [[1] [1 2]], output: [[1 1] [1 2]] input: [[1 2] [2] [1 2]], output: [[1 2 1] [2 2 1] [2 2 2]] input: [[1 2] [1] [1 2]], output: [[1 1 1] [1 1 2] [2 1 1] [2 1 2]] This is what I have so far:

(defn match-meta-pattern
  (loop [result [] metapattern metapattern]
    (if (seq metapattern)
       (do (prn "meta" (first metapattern))
           (prn "->" result)
             (if-not (seq result)
               [[(nth (first metapattern) 0)]]
               (map (fn [next-pattern] (map (fn [running-pattern]
                              (conj running-pattern next-pattern)) result))
                (first metapattern))))
       (rest metapattern))


(defn cartesian [set & sets]
  (if (seq sets)
    (for [x    set
          tail (apply cartesian sets)]
      (conj tail x))
    (for [x set]
      (list x))))

(cartesian [1] [1 2])
(cartesian [1 2] [2] [1 2])
(cartesian [1 2] [1] [1 2])

🚀 3

can you explain the logic?


Each subvector represents the various values of the branch


you list a single input for each example, but your function takes 2 arguments


i did not understand the logic explanation 🙂


yeah, that too, and I don't see a pattern between input and output at all, so hard to say


i see the pattern


[[a b c] [d e]] -> [[a d] [a e] [b d] [b e] [c d] [c e]]


terminology is wierd though


this is a combinatorics thing


it's just a cross product?


none of the inputs have a 3 element vector as the first element


oh yeah, it's just a cross product


@dpsutton it’s not a cross product because a cross b is defined only when length a = length b


cross product with padding


that's not true




@dpsutton that’s the operation, but it’s not called cross product


a cross join


cartesian product is the technical term i guess. maybe i misremembered but i thought there were largely interchangeable


vectors and sets


i went back to halmos naive set theory to check. been a while since my set theory days. i was wrong and apologies

max minoS23:05:05

I'm trying to set my m2 repo location using profiles.clj, what is the difference between the :local-repo and the :repositories "local" here?