Fork me on GitHub
#cherry
<
2022-08-16
>
mauricio.szabo00:08:04

So macros in cherry don't actually expand before emitting JS code, is that it?

borkdude01:08:07

They do expand before emit

borkdude01:08:53

But they only run in the JS hosted compiler

mauricio.szabo01:08:07

Right, do you think this is a problem? I always felt that Clojurescript macros are really weird...

borkdude04:08:17

Please elaborate

mauricio.szabo16:08:03

Do you think it's a problem that cherry and Clavascript macros will run only on ClojureScript, and have no access to JVM/Basbashka? What I feel is that Clojure macros are more "integrated" on the language - you don't have to worry about java elements "leaking" into the final source, or defining things on different files, etc...

mauricio.szabo16:08:52

One example is the hack we need to check (:ns &env) to know if we're compiling a CLJ macro or a CLJS one, because reader conditionals don't work right

zimablue19:08:39

hi, stupid question - what is the advantage of this vs self-hosted cljs [somehow output-modified to be es6 (a)] or is the (a) part so difficult that it motivates the whole project?

zimablue19:08:13

I asked the same question re babashka I know, it's the question that helps me grok what's actually going on xD

Cora (she/her)19:08:49

I'm pretty sure the advantage is mostly "Reducing friction between ClojureScript and JS tooling"

Cora (she/her)19:08:43

there are a bunch of ways this is achieved and some future goals listed int he readme. I'm sure someone can expand on more concrete differences but that's the gist of it

zimablue19:08:29

I understand that but don't understand what the main technical element of achieving that is beyond the self-hosted, whether it's (a) or something else

borkdude21:08:33

@zimablue Good questions: cherry is currently more an exploration of ideas than a final working product. It will take some time to see if it's better than what we have or whether it allows new things that were previously not easily feasible.

zimablue21:08:14

Thanks, it's not meant as a criticism I'm learning clojurescript and trying to understand, the complication and tooling are still a bit of a black hole to me. Because I'm working on an electron app bundle size is less relevant

borkdude21:08:09

Yes, JS is used in a wide variety of use cases. At the same time I'm also exploring #clavascript (with the help of some amazing people in that channel) which compiles more directly to JS without any of the CLJS "baggage" which can e.g. be used for ultra-small bundle sizes for cost savings on AWS or cloudflare, etc. It's about adding more use cases for Clojure(-ish) instead of "being better" than existing tools but what exactly those use cases are remains to be seen as these products aren't yet production-ready.