This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-03-02
Channels
- # aleph (6)
- # beginners (57)
- # boot (1)
- # cider (27)
- # clara (23)
- # cljs-dev (166)
- # clojure (287)
- # clojure-dev (23)
- # clojure-greece (1)
- # clojure-italy (2)
- # clojure-russia (13)
- # clojure-spec (34)
- # clojure-uk (36)
- # clojurescript (68)
- # core-async (63)
- # core-logic (1)
- # cursive (1)
- # data-science (1)
- # datomic (26)
- # duct (1)
- # emacs (10)
- # figwheel (8)
- # fulcro (2)
- # garden (16)
- # graphql (8)
- # hoplon (20)
- # jobs (2)
- # leiningen (10)
- # off-topic (16)
- # onyx (2)
- # portkey (5)
- # quil (1)
- # re-frame (63)
- # reagent (95)
- # reitit (6)
- # remote-jobs (1)
- # ring (6)
- # rum (1)
- # shadow-cljs (76)
- # spacemacs (26)
- # specter (11)
- # sql (7)
- # unrepl (68)
- # vim (2)
- # yada (2)
takeing it 1 step further, how can I override/js-resolve the node-repl, so that "mylib" within a .jar becomes "/mylib", this is for a project that I don't plan to build, just use the node-repl for live evaluation. To be percise, this :require https://github.com/hlolli/csound-wasm/blob/master/src/csound_wasm/node.cljs#L3 I'm hopeing to stay leagal from within a .jar file (so in another project I'm requireing this project).
yes! ๐ I'm hopeing to make this a clojurescript library, node library and a standalone browser js library.
it would probably work from the .jar, but within the project itself when compileing :node-library, it will complain.. I can try again
that's true, I bet it would, I'm going to see now if that will ruin the shadow-cljs release node
compilation.
but I do get some errors from "/csound_wasm/libcsound" that I didn't get from "libcsound" + :js-resolve. Namely
Closure compilation failed with 7 errors
--- csound_wasm/libcsound.js:81
Invalid module path "goog:shadow.js.shim.module$fs" for resolution mode "BROWSER"
--- csound_wasm/libcsound.js:82
Invalid module path "goog:shadow.js.shim.module$path" for resolution mode "BROWSER"
--- csound_wasm/libcsound.js:4253
Invalid module path "goog:shadow.js.shim.module$crypto" for resolution mode "BROWSER"
--- csound_wasm/libcsound.js:5166
Invalid module path "goog:shadow.js.shim.module$ws" for resolution mode "BROWSER"
--- csound_wasm/libcsound.js:5416
Invalid module path "goog:shadow.js.shim.module$ws" for resolution mode "BROWSER"
--- remaining errors ommitted ...
this file is kinda shit, automatically generated js->c/c++ patch from emscripten compiler
I wonder why it still differs, the :js-resolve and classpath require. The setup with :js-resolve, minified it all and didn't throw errors.
make: Entering directory '/mnt/c/Users/thheller/code/shadow-cljs/tmp/csound-wasm/node_modules/speaker/build'
CC(target) Release/obj.target/output/deps/mpg123/src/output/alsa.o
../deps/mpg123/src/output/alsa.c:19:28: fatal error: alsa/asoundlib.h: No such file or directory
#include <alsa/asoundlib.h>
they say for windows Windows: win32 Audio output for Windows (winmm).
whatever winmm is, need to look into that. Webaudio in node.js is a strange world.
but I added this module.exports = Module
at the end of the file. the minifier would otherwise not find the object.
ok, otherwise I could see if it's reasonable to patch this file to become ES6 compatable, but that sounds daunting
this seems to be work in progress https://github.com/kripken/emscripten/issues/5828
hmm, then there's the rust to wasm compiler, seperate of emscripten one, looking at wasm discussion in the wild, seems to be an overtake from the rust community.
I would still be tempted to compile it with js-resolve and change the require form and then bundle the jar. But the feature of ignoring certain js deps to be processed by closure is going to save headaches.
That was my initial plan. Was curious of the new features in shadow-cljs. But from this position, sounds way easier
Invalid module path "goog:shadow.js.shim.module$fs" for resolution mode "BROWSER"
this I can fix easily
jar for cljs is fine. jar for es6 is experimental but should be fine. jar for commonjs is broken.
Yes, then I dont stress about this, bundle the libcsound when/if emscripten compile better js binding files
Well, deep in this emscripten js jungle is their own FS bindings. So I could see why this confuses the compiler
it feels like integrating so heavily with google closure was not a good move for CLJS ๐ a lot of problems with CLJS today are caused by itโs dependence on it
@lilactown CLJS does not depend on it at all. I could do everything without the CLJS compiler. Closure is just far beyond every other JS tool out there when it comes to optimizing JS and I personally don't want to give that up.