This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-03-07
Channels
- # announcements (3)
- # babashka (28)
- # bangalore-clj (6)
- # beginners (91)
- # calva (14)
- # cider (7)
- # clojars (6)
- # clojure (24)
- # clojure-europe (3)
- # clojure-nl (5)
- # clojure-uk (134)
- # clojuredesign-podcast (1)
- # clojurescript (16)
- # cryogen (3)
- # cursive (3)
- # data-science (1)
- # events (1)
- # fulcro (7)
- # jobs-discuss (1)
- # luminus (4)
- # malli (1)
- # re-frame (7)
- # shadow-cljs (74)
- # spacemacs (23)
- # sql (6)
- # tools-deps (2)
when writing anonymous function, is there a way to emit this
without additional assignment? (like no var this$ = this
)
The library I'm using (GPU.js) takes a JS function and transpiles it to a shader and it only takes the exact form of this.thread.x
not this$.thread.x
.
so to speak, the JS AST works as a DSL in GPU.js so accessing properties should be verbatim sometimes..
@namenu unfortunately no. this also doesn't sound like a good idea when using :advanced
compilation since it might heavily modify what your code looks like
Which library do people use for better js interop? I found https://github.com/appliedsciencestudio/https://github.com/appliedsciencestudio/js-interop …
yes, I was wondering if there's a optimization safe way to do this. (it works ok with *js
on dev)
You probably can write a regular JS file and add /** @nocompile */
at the very top of it, and use exports from CLJS in there.
is there no way to pre-generate the shader from the JS? I mean it sounds like a terrible idea to me to do that at runtime?
yes there is. but the purpose of GPU.js is abstracting out GLSL and direct use of gluing gl functions. https://github.com/gpujs/gpu.js/wiki/Quick-Concepts#simple-javascript for people like me who don't know the GLSL syntax but still want to use GPU for general purpose, it was kind of option I guess..?
yes I get that. seems like a neat idea. I just don't get the part of doing it at runtime. that means it requires parsing JS at runtime, meaning you need to embed a JS parser/analyzer etc
if you just do it beforehand you can still write plain JS but the final code only contains the already generated shader
no JS parser etc required at runtime ... equals smaller file sizes, faster startup, etc
but no clue what that library does so it may just be for technical reasons they don't do it