This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-05-25
Channels
- # announcements (4)
- # babashka (13)
- # beginners (115)
- # cider (62)
- # clj-kondo (16)
- # cljdoc (4)
- # cljs-dev (5)
- # clojure (44)
- # clojure-europe (57)
- # clojure-greece (1)
- # clojure-italy (2)
- # clojure-nl (3)
- # clojure-spec (2)
- # clojure-uk (24)
- # clojurescript (58)
- # code-reviews (2)
- # community-development (6)
- # conjure (3)
- # core-async (9)
- # cursive (34)
- # datahike (3)
- # datalog (1)
- # datomic (67)
- # emacs (9)
- # events (5)
- # fulcro (9)
- # graalvm (1)
- # jobs (1)
- # lsp (24)
- # off-topic (20)
- # pathom (17)
- # polylith (11)
- # re-frame (21)
- # react (21)
- # reagent (3)
- # reitit (23)
- # releases (1)
- # remote-jobs (1)
- # ring (3)
- # sci (47)
- # tools-deps (7)
- # vim (15)
- # xtdb (4)
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 https://github.com/WebAssembly/gc
Perhaps of interest https://clojureverse.org/t/any-news-for-webassembly-for-clojure/5274
Also https://www.reddit.com/r/Clojure/comments/bjggh5/does_clojure_compile_to_web_assembly/
(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 https://en.wikipedia.org/wiki/WebAssembly#Security_considerations
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 clojure.tools.namespace.repl/refresh
?
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 clojure.tools.namespace 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
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
[metapattern]
(loop [result [] metapattern metapattern]
(if (seq metapattern)
(recur
;;;;;;;;;;;;
(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))
result)))
(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])
Each subvector represents the various values of the branch
yeah, that too, and I don't see a pattern between input and output at all, so hard to say
@dpsutton it’s not a cross product because a cross b is defined only when length a = length b
@dpsutton that’s the operation, but it’s not called cross product
cartesian product is the technical term i guess. maybe i misremembered but i thought there were largely interchangeable
i went back to halmos naive set theory to check. been a while since my set theory days. i was wrong and apologies
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? https://wiki.archlinux.org/title/Clojure#m2_repo_location