This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-07-27
Channels
- # aleph (2)
- # announcements (7)
- # beginners (74)
- # clj-kondo (23)
- # cljdoc (3)
- # cljsrn (3)
- # clojure (42)
- # clojure-android (1)
- # clojure-uk (4)
- # clojuredesign-podcast (10)
- # clojurescript (4)
- # figwheel-main (19)
- # fulcro (19)
- # hoplon (4)
- # jobs (5)
- # juxt (8)
- # off-topic (5)
- # pathom (40)
- # perun (3)
- # shadow-cljs (56)
^ this occurs only when using triple backticks. when indenting as a code block it works fine
looking at your post, the syntax highlighter needs some work too... same problem on clojureverse
Hello! I am building a ray tracer in Clojure at the moment, and I am running into some slow performance. I represent matrices as NxN native vectors. As far as I know, best case performance for calculating the determinant is O(n^3) (Using naive algorithm). I use get-in and assoc-in to access these matrices. When profiling, inverting matrices is the most expensive operation. I see three solutions now: 1: Using transient to gain some speed. I didn’t notice a huge improvement from this change 2: Running in parallel. Is there a way to use loop recur in parallel? Pmap does not seem to improve things much 3: Using library like Neanderthal I’d like to use as few dependencies as possible for learning reasons, so I’d like to avoid Neanderthal or core.matrix as for now. Right now the whole thing is immutable, so I expect some overhead here anyways:) Right now, 100x50 picture with six spheres with lighting and textures takes 29 seconds, and 2440x1220 took 5 hours. I’m not sure if this is acceptable or not :) I hope my question is clear, and thanks!
@theodorthornhill I think using regular nested vectors to do compute-intensive matrix operations is a dead end no matter how you optimize it
there is a reason all programs that do lots of matrix operations use highly specialized/optimized matrix libraries
if you don’t want to use libraries, maybe you can switch from vectors to primitive Java arrays, that should give you much better performance than vectors (but still much worse than a library such as Neanderthal)
@schmee that’s what I thought. Maybe I’ll just adopt Neanderthal later! Would be interesting to see the performance gain that would give me! Thanks for your answer!
I don't know where else to ask, but I feel like some people here could point me in the right direction. What is the class of languages accepted by recursive descent parsers? Naive parsers without backtracking (or only weak backtracking) can clearly parse a superset of LL(1) grammars and they parse LL(1) grammars especially quickly as they won't need to backtrack. I believe that recursive descent with full backtracking (using continuations) can at least parse LL(k) grammars for any k while backtracking up to k steps for any wrong path. What other languages can these two algorithms parse? How does a recursive descent parser handle ambiguity? I imagine pretty well by backtracking and eventually finding a solution.
I would like to reply on this answer on the QA forum, but it seems it doesn't support comments like SO https://ask.clojure.org/index.php/8214/is-keys-destructuring-for-documentation-reasons-good-style?show=8217#a8217
Why not just make another answer?
It does actually support comments but I have them turned off
also you would have to @ a person to make clear it refers to someone else. it doesn't seem that forum was intented to be used that way as it doesn't let you reply on someone elses answer by quoting something
especially if answers are sorted on votes, making use of answers as comments gets confusing
Answers are sorted on votes
I’ll turn it on for answers
it seems triple-backquotes are interpreted as inline code. is that also configurable?
The editors are swappable and the markdown one is a little creaky. I will take a look at whether there is a better version.
I might actually have an old one installed, not sure
My team at work recently adopted the Apache Zeppelin UI for data querying via sql and Spark shell. It seems based on Scala. Has anyone been in this situation been able to use scala interop from clojure or clojure directly from Zeppelin?
I don't see Clojure in this list: https://zeppelin.apache.org/supported_interpreters.html
but starting to see things like https://github.com/DEX-Company/clj-zeppelin/blob/master/README.md
perhaps this... https://github.com/whamtet/zeppelin-clojure-interpreter/blob/master/README.md
Does anyone have an opinion on websocket libraries for a server in clj and client in cljs? Sente or something else?
For cljs I like just javascript interop, it's simple enough and not really happy with the few I tried. For the clj part I like the one integrated in Nginx-clojure, or if using GraphQL lacinia(not really a websocket library)
I use just WebSocket api in browsers (https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API). On last project, I needed to connect microcontrollers via websockets and Sente has some undocumented protocol which would have to be implemented in C . On server (ClojureScript) I used just some basic ws library: https://www.npmjs.com/package/ws. If all your clients/servers will be able to use Sente, then it is nice library I think (used that on one demo app).