Fork me on GitHub

I noticed the QA forum has some CSS styling issues when it comes to code formatting


multiline code blocks are shown as a single line


ah this might be a slight problem for the forum of a programming language =)


ClojureVerse, Reddit, Stackoverflow have no problems with this 😉


i'm sure the solution won't be long to materialize


though we'll kill the man by piling always more work on his back


^ 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

Theodor Thornhill12:07:49

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)

Theodor Thornhill13:07:20

@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!

👍 4

is there a library that lets you use EQL to query regular maps?


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


Why not just make another answer?


It does actually support comments but I have them turned off


because an answer has votes and refers to the original question.


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


turning comments on would be useful to me


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?


I mean, the indenting doesn't work there


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?


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 ( 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: If all your clients/servers will be able to use Sente, then it is nice library I think (used that on one demo app).


Aleph on the server and Google Closure on the client is one option. Senate does more though eg. user sessions


Aleph on server


I was thinking that one can use aleph also in clojurescript as client


Afaik it should be possible to use only aleph and manifolds Lib on client and server