squint-cljs / squint

Light-weight ClojureScript dialect
https://squint-cljs.github.io/squint
650 stars 40 forks source link

squint compile --stdout #318

Closed jruz closed 1 year ago

jruz commented 1 year ago

Hi thanks a lot this is such a joy to use.

Could it be possible to add an option to print out the compilation output instead of writing the file?

I would like to integrate this as as vite/rollup plugin

borkdude commented 1 year ago

Of course! Would you like to provide a PR? It's not so hard to add. Else I'll do it.

jruz commented 1 year ago

awesome thanks, will send you a PR tomorrow

jruz commented 1 year ago

I think i got confused and I should be able to accomplish the same by importing the compiler

import { compileString } from 'squint-cljs/lib/compiler.js'

I'm a bit confused if I should be using cherry for this, same import is available in both packages but I get a different output from cherry, squint worked right away. I'll look into the details of the difference tomorrow.

borkdude commented 1 year ago

cherry is similar to squint, but has a different purpose, it's closer to the real CLJS in terms of data structures. If you just want to use squint, use squint, why would you use cherry?

borkdude commented 1 year ago

We can discuss on Clojurians Slack if you're hanging out there, perhaps it's a quicker way to sort this out.

jruz commented 1 year ago

Thanks I'll close this since I solved my need with the compiler and I'll ask around in slack if I run into smth else :)

borkdude commented 1 year ago

@jruz Cool. Is your work public? Perhaps we can add some docs on how to use the JS interface with rollup or otherwise.