Fork me on GitHub
Tangible Dream00:04:06

Did my post make sense?


Trying to write some cross-platform macros... Is there a more solid alternative to (find-ns 'cljs.analyzer) as per ? In principle it works, but for larger projects cljsbuild will fail because the conditional will return the wrong thing I believe


When you say "write some cross-platform macros" what do you mean?


What is the problem you're trying to solve?


macros that can be consumed from both clj and cljs codebases


Most macros you write will have that property.


Unless you're using self-hosted ClojureScript macros will be evaluated as Clojure whether you're targeting the JVM or JavaScript, which is fine.


> for larger projects cljsbuild will fail because the conditional will return the wrong thing I believe What do you mean?


> Most macros you write will have that property. not sure. If I need to emit x or y depending on the consumer's platform, I need a hack such as the linked one in Stackoverflow. I found this pattern which solved my issue


If you need the runtime behavior to be different depending on the host language why not macroexpand to a function call. You can then make the implementation of that function platform-dependent in one of the usual ways.


Just to be clear: are you questioning the need for a cross-platform macro?


Again, if you need the runtime behavior to differ depending on the host language you could have your macro expand to a function call where the function being called has both a Clojure and a ClojureScript implementation.


Yes. More or less I did that: grab (-> &env :ns some?) in the macro and pass that value as an argument to functions that are invoked from the macro


You don't need that hack.


Just define a function that wraps the platform-specific behavior and have your macro expand to a call to that function.


Note that example.macros/function's behavior differs depending on the runtime platform.


I'll try it thanks! It might get muddier though for things that actually need a macro, and/or per-platform ns variations (`clojure.spec.alpha` vs cljs.spec.alpha). I'll have to see.


Yeah, I'd be interested to see a situation where this breaks down, but I'm having trouble imagining one.


Note that there's no reason why function couldn't be defined in a namespace that has two completely different implementations, one .clj and one .cljs.


is it correct that cljs fingerprinting doens’t fingerprint source maps?


pretty sure we don't do that


but not for any particular reason


yeah, think it might be convenient to apply fingerprinting to both. Or maybe append the same sha’s to the source maps.


Is there a way to convert Google Closure annotations (e.g. in externs) into a more readable format like JSON or EDN?


I'm running lumo in a Win 10 cmd window. Anyone else experiencing the repl randomly quitting? Ex, (def pq #queue [1 2 3]), 50/50 chance it kicks out to command prompt. Using lumo 1.9.0, ClojureScript 1.10.439, Node.js v10.9.0.


fwiw there’s a new version of lumo


Thanks. Can't generate problem with Lumo 1.10.1.

hipster coder19:04:58

Please thread this… Does anyone have any thoughts on Deno’s impact on Clojurescript? How Deno uses html script includes to include JS libraries?

hipster coder19:04:52

The creator of node js left around 2012 and went to create Deno

hipster coder19:04:07

It still uses the V8 but also is written in Rust

hipster coder19:04:28

I am wondering if the use of Deno will impact whether Clojurescript uses npm and node js, because JS keeps forking into different projects

hipster coder20:04:58

I think Clojurescript is good because it can adapt to the JS stuff as JS keeps changing


ClojureScript isn't restricted to a single JS runtime

hipster coder20:04:45

Vert.x is using Rhino and Nashorn runtime machines… so Clojurescript can adapt to anything


But if Deno stays unpopular, you probably won't see a lot of cljs tooling around it

hipster coder20:04:48

my theory is Google pushed some of these ideas with V8 and Golang, to get around using the JVM

hipster coder20:04:06

because of the lawsuits between Oracle and Google for the past 10 years or so


But NodeJS doesn't use the JVM. So what would be the problem of it over Deno?


What's Deno ?


Has anyone that uses Oz ( and shadow-cljs had issued with vegaTooltip not having the function vega?


I’ve been looking into the commits and stuff but it just seems like the newer versions made that function disappear.


(js has never been and never will be my friend)